Author: sletellier Date: 2012-06-28 17:37:40 +0200 (Thu, 28 Jun 2012) New Revision: 2344 Url: http://nuiton.org/repositories/revision/jaxx/2344 Log: - fixes #2146 : Add widget to select values in list - Rename ListSelectorUI to ComboToListSelector - Refactor all implementation - Add LisToListSelector component - Add demo of them - Add guava dependency Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ListSelectorDemo.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ComboToListSelector.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/GenericListModel.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelector.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListToListSelector.jaxx Removed: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/bean/ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorHandler.java trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx Modified: trunk/jaxx-demo/pom.xml trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jaxx Modified: trunk/jaxx-demo/pom.xml =================================================================== --- trunk/jaxx-demo/pom.xml 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-demo/pom.xml 2012-06-28 15:37:40 UTC (rev 2344) @@ -105,6 +105,11 @@ <artifactId>jxlayer</artifactId> </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> + <!-- test dependencies --> <dependency> Added: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ListSelectorDemo.jaxx =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ListSelectorDemo.jaxx (rev 0) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/ListSelectorDemo.jaxx 2012-06-28 15:37:40 UTC (rev 2344) @@ -0,0 +1,89 @@ +<!-- + #%L + JAXX :: Demo + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2008 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> +<jaxx.demo.DemoPanel> + <import> + jaxx.runtime.swing.ListSelector + com.google.common.collect.Lists + java.util.List + </import> + + <String id='addToolTip' javaBean='"Add"'/> + <String id='removeToolTip' javaBean='"Remove"'/> + + <script><![CDATA[ +void $afterCompleteSetup() { + + List<String> from = Lists.newArrayList(); + from.add("Value 1"); + from.add("Value 2"); + from.add("Value 3"); + from.add("Value 4"); + from.add("Value 5"); + List<String> to = Lists.newArrayList(); + to.add("Other"); + + comboToListSelector.init(from, to); + listToListSelector.init(from, to); +} +]]></script> + + <Table fill='both'> + <row> + <cell fill='horizontal' weightx='1'> + <JLabel text='jaxxdemo.listSelector.addToolTipLbl'/> + </cell> + <cell fill='horizontal' weightx='1'> + <JTextField id='addToolTipField' + text='{getAddToolTip()}' + onKeyReleased='setAddToolTip(addToolTipField.getText())'/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1'> + <JLabel text='jaxxdemo.listSelector.removeToolTipLbl'/> + </cell> + <cell fill='horizontal' weightx='1'> + <JTextField id='removeToolTipField' + text='{getRemoveToolTip()}' + onKeyReleased='setRemoveToolTip(removeToolTipField.getText())'/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1' columns='2'> + <ComboToListSelector id='comboToListSelector' + genericType='String' + addToolTip='{getAddToolTip()}' + removeToolTip='{getRemoveToolTip()}'/> + </cell> + </row> + <row> + <cell fill='horizontal' weightx='1' columns='2'> + <ListToListSelector id='listToListSelector' + genericType='String' + addToolTip='{getAddToolTip()}' + removeToolTip='{getRemoveToolTip()}'/> + </cell> + </row> + </Table> +</jaxx.demo.DemoPanel> Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java =================================================================== --- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java 2012-06-28 15:37:40 UTC (rev 2344) @@ -34,6 +34,7 @@ import jaxx.demo.component.jaxx.editor.ComboEditorDemo; import jaxx.demo.component.jaxx.editor.DatePickerDemo; import jaxx.demo.component.jaxx.editor.FileEditorDemo; +import jaxx.demo.component.jaxx.editor.ListSelectorDemo; import jaxx.demo.component.jaxx.editor.I18nEditorDemo; import jaxx.demo.component.jaxx.editor.NumberEditorDemo; import jaxx.demo.component.jaxx.editor.TimeEditorDemo; @@ -155,7 +156,8 @@ ComboEditorDemo.class, I18nEditorDemo.class, DatePickerDemo.class, - FileEditorDemo.class + FileEditorDemo.class, + ListSelectorDemo.class ); addMapping(n_("jaxxdemo.feature"), 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 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties 2012-06-28 15:37:40 UTC (rev 2344) @@ -213,6 +213,8 @@ jaxxdemo.init.closed=JAXXDemo was closed at %1$s jaxxdemo.init.context.done=Context initialized in %1$s jaxxdemo.init.ui.done=UI initialized. +jaxxdemo.listSelector.addToolTipLbl=Add button toolTip +jaxxdemo.listSelector.removeToolTipLbl=Remove button toolTip jaxxdemo.menu.file=File jaxxdemo.menu.file.locale=Languages jaxxdemo.menu.help= Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties 2012-06-28 15:37:40 UTC (rev 2344) @@ -21,7 +21,7 @@ Blue=Bleu Blue\:=bleu \: Bold=En gras -Button\ label\:=Libellé de l'action +Button\ label\:=Libell\u00E9 de l'action C=C CE=CE Cancel=Annuler @@ -35,12 +35,12 @@ Editable=Editable Email\ Address\:=Courriel Email\:=Courriel -Enabled=Activé +Enabled=Activ\u00E9 EnumEditor\ (country)\ \:=Editeur de pays EnumEditor\ (language)\ \:=Editeur de langue Fancy\ Button=Bouton 'Fancy' -First\ Name\:=Prénom -FirstName\:=Prénom \: +First\ Name\:=Pr\u00E9nom +FirstName\:=Pr\u00E9nom \: Font\ size=Taille de la police Font\ size\:\ = Fool\ me\ once= @@ -49,7 +49,7 @@ Green\:=Vert \: Greet= Help= -Inc\ (+)=Incrémenter (+) +Inc\ (+)=Incr\u00E9menter (+) Italic=Italique JAXX\ Demo= JMenu\ demo= @@ -70,26 +70,26 @@ Red\:=rouge \: Reset=Reinitialiser Show\ Background=Voir le fond -Show\ password\ dialog=Voir l'éditeur de mot de passe +Show\ password\ dialog=Voir l'\u00E9diteur de mot de passe Sign\ on=Signer Simple\ Button=Bouton simple Size\:=Taille \: Sources=Sources Spacing\:=Espacement \: -Start=Démarrer -Stop=Arrêter -Supported\ Swing\ components\:=Composants Swing supportés +Start=D\u00E9marrer +Stop=Arr\u00EAter +Supported\ Swing\ components\:=Composants Swing support\u00E9s Text2\:=Text 2 Text\:=Texte \: Total\:\ = -Underline=souligné +Underline=soulign\u00E9 Upper\ case\ text\:=Texte en majuscule Use\ the\ spinner\ to=Utiliser la jauge pour Username\:=Utilisateur \: -Vegetable=Légumes +Vegetable=L\u00E9gumes View=Vue Welcome\ to\ the\ JAXX\ framework\!=Bienvenu dans le framework JAXX -Working\ directory\:=Répertoire de travail +Working\ directory\:=R\u00E9pertoire de travail Yellow=Jaune You\ entered\:\ = Your\ name\:=Votre nom \: @@ -98,8 +98,8 @@ between\ these\ lines= button\ A=Bouton A button\ B=Bouton B -button\ C\ (full\ block)=Bouton C (blocage complêt) -button\ D\ (full\ block\ 2)=Bouton D (blocage complêt) +button\ C\ (full\ block)=Bouton C (blocage compl\u00EAt) +button\ D\ (full\ block\ 2)=Bouton D (blocage compl\u00EAt) cancel=Annuler close=Fermer close2=Fermer 2 @@ -143,12 +143,12 @@ jaxxdemo.action.configuration.tip=Modifier la configuration jaxxdemo.action.exit=Quitter jaxxdemo.action.exit.tip=Quitter JAXX Demo -jaxxdemo.action.fullscreen=Plein écran -jaxxdemo.action.fullscreen.tip=Passer en mode pleine écran +jaxxdemo.action.fullscreen=Plein \u00E9cran +jaxxdemo.action.fullscreen.tip=Passer en mode pleine \u00E9cran jaxxdemo.action.help=Aide jaxxdemo.action.help.tip=Affichier l'aide -jaxxdemo.action.locale.fr=Français -jaxxdemo.action.locale.fr.tip=Changer la langue en français +jaxxdemo.action.locale.fr=Fran\u00E7ais +jaxxdemo.action.locale.fr.tip=Changer la langue en fran\u00E7ais jaxxdemo.action.locale.uk=Anglais jaxxdemo.action.locale.uk.tip=Changer la langue en anglais jaxxdemo.action.normalscreen=Ecran normal @@ -156,10 +156,10 @@ jaxxdemo.action.remove=Supprimer jaxxdemo.action.show=Voir jaxxdemo.action.site=Site internet -jaxxdemo.action.site.tip=Accéder au site de l'application sur internet +jaxxdemo.action.site.tip=Acc\u00E9der au site de l'application sur internet jaxxdemo.common.actors=Acteurs jaxxdemo.common.age=Age -jaxxdemo.common.firstName=Prénom +jaxxdemo.common.firstName=Pr\u00E9nom jaxxdemo.common.id=Identifiant jaxxdemo.common.image=Image jaxxdemo.common.lastName=Nom @@ -167,7 +167,7 @@ jaxxdemo.common.movies=Films jaxxdemo.common.people=Acteur jaxxdemo.common.title=Titre -jaxxdemo.common.year=Année +jaxxdemo.common.year=Ann\u00E9e jaxxdemo.component.jaxx=Composants JAXX jaxxdemo.component.jaxx.editor=Editeurs jaxxdemo.component.swing=Composants Swing @@ -176,49 +176,51 @@ jaxxdemo.component.swing.form.text=Texte jaxxdemo.component.swing.layout=Layouts jaxxdemo.component.swing.menu=Menus -jaxxdemo.component.swing.window=Fenêtres -jaxxdemo.config.category.directories=Répertoires -jaxxdemo.config.category.directories.description=Répertoires de l'application +jaxxdemo.component.swing.window=Fen\u00EAtres +jaxxdemo.config.category.directories=R\u00E9pertoires +jaxxdemo.config.category.directories.description=R\u00E9pertoires de l'application jaxxdemo.config.category.other=Autre jaxxdemo.config.category.other.description=Autres options jaxxdemo.config.configFileName.description=Le nom du fichier de configuration -jaxxdemo.config.ui.demo.path=Chemin de la démo par défaut -jaxxdemo.config.ui.fontSize=La taille de la police à utiliser pour visualiser dans les sources -jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine écran -jaxxdemo.config.ui.locale=La langue utilisée par l'application +jaxxdemo.config.ui.demo.path=Chemin de la d\u00E9mo par d\u00E9faut +jaxxdemo.config.ui.fontSize=La taille de la police \u00E0 utiliser pour visualiser dans les sources +jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine \u00E9cran +jaxxdemo.config.ui.locale=La langue utilis\u00E9e par l'application jaxxdemo.config.ui.logLevel=Level de log jaxxdemo.config.ui.logPatternLayout=Pattern des log -jaxxdemo.datePickerEditor.dateResult=Affichage du résultat +jaxxdemo.datePickerEditor.dateResult=Affichage du r\u00E9sultat jaxxdemo.datePickerEditor.patternLayout=Pattern de date jaxxdemo.datePickerEditor.showPopupButton=Afficher le boutton pour ouvrir la popup -jaxxdemo.feature=Fonctionnalités +jaxxdemo.feature=Fonctionnalit\u00E9s jaxxdemo.feature.databinding=Data binding jaxxdemo.feature.nav=API JAXX pour les arbres jaxxdemo.feature.validation=Validation -jaxxdemo.fileEditor.acceptAllFileFilterUsed=Accèpte tout les FileFilter -jaxxdemo.fileEditor.directoryEnabled=Activer la sélection des files -jaxxdemo.fileEditor.extsDescLbl=Description des extensions (séparées par des virgules, ex \: Texte (*.txt), Images (*.png)) +jaxxdemo.fileEditor.acceptAllFileFilterUsed=Acc\u00E8pte tout les FileFilter +jaxxdemo.fileEditor.directoryEnabled=Activer la s\u00E9lection des files +jaxxdemo.fileEditor.extsDescLbl=Description des extensions (s\u00E9par\u00E9es par des virgules, ex \: Texte (*.txt), Images (*.png)) jaxxdemo.fileEditor.extsLbl=Extensions (separated by comma, ex \: txt, png) -jaxxdemo.fileEditor.fileEnabled=Activer la sélection des fichiers +jaxxdemo.fileEditor.fileEnabled=Activer la s\u00E9lection des fichiers jaxxdemo.fileEditor.titleLbl=Titre du dialog d'ouverture de fichier jaxxdemo.fun=Fun jaxxdemo.i18neditor.configuration=Configuration jaxxdemo.i18neditor.popup.title=Titre de la popup jaxxdemo.i18neditor.popupBorderText=Titre de la popup -jaxxdemo.i18neditor.selected.locale=Langue sélectionnée +jaxxdemo.i18neditor.selected.locale=Langue s\u00E9lectionn\u00E9e jaxxdemo.i18neditor.showIcon=Afficher les icones jaxxdemo.i18neditor.showPopupIcon=Afficher les icones dans la popup jaxxdemo.i18neditor.showPopupText=Afficher les textes dans la popup jaxxdemo.i18neditor.showText=Afficher le text -jaxxdemo.init.closed=JAXX Demo a été fermé à %1$s -jaxxdemo.init.context.done=Initialisation du contexte terminée en %1$s. -jaxxdemo.init.ui.done=Initialisation de l'interface graphique terminée. +jaxxdemo.init.closed=JAXX Demo a \u00E9t\u00E9 ferm\u00E9 \u00E0 %1$s +jaxxdemo.init.context.done=Initialisation du contexte termin\u00E9e en %1$s. +jaxxdemo.init.ui.done=Initialisation de l'interface graphique termin\u00E9e. +jaxxdemo.listSelector.addToolTipLbl=Add button toolTip +jaxxdemo.listSelector.removeToolTipLbl=Remove button toolTip jaxxdemo.menu.file=Fichier jaxxdemo.menu.file.locale=Langues jaxxdemo.menu.help=Aide jaxxdemo.menu.showLogs=Afficher les logs -jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s chargée. -jaxxdemo.message.goto.site=Accéder au site de JAXX Demo (%1$s) +jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s charg\u00E9e. +jaxxdemo.message.goto.site=Acc\u00E9der au site de JAXX Demo (%1$s) jaxxdemo.navigation.actor.title=Acteur jaxxdemo.navigation.actors.title=Acteurs jaxxdemo.navigation.movie.title=Film @@ -226,25 +228,25 @@ jaxxdemo.numbereditor.applyNumberPattern=Appliquer le pattern jaxxdemo.numbereditor.autoPopup=Affichage automatique popup jaxxdemo.numbereditor.configuration=Configuration -jaxxdemo.numbereditor.model=Résultat -jaxxdemo.numbereditor.model.float=Valeur décimale \: %1$s -jaxxdemo.numbereditor.model.int=Valeur entière \: %1$s -jaxxdemo.numbereditor.model.numberPattern=Format de l'éditeur \: %s +jaxxdemo.numbereditor.model=R\u00E9sultat +jaxxdemo.numbereditor.model.float=Valeur d\u00E9cimale \: %1$s +jaxxdemo.numbereditor.model.int=Valeur enti\u00E8re \: %1$s +jaxxdemo.numbereditor.model.numberPattern=Format de l'\u00E9diteur \: %s jaxxdemo.numbereditor.numberPattern.configuration=Pattern du nombre jaxxdemo.numbereditor.showPopupButton=Afficher le boutton de popup jaxxdemo.numbereditor.showReset=Afficher le boutton de reset -jaxxdemo.numbereditor.useFloat=Utiliser les décimales +jaxxdemo.numbereditor.useFloat=Utiliser les d\u00E9cimales jaxxdemo.numbereditor.useSign=Utiliser le signe jaxxdemo.timeeditor.editor=Editeur de temps jaxxdemo.timeeditor.label=Label -jaxxdemo.timeeditor.model=Résultat -jaxxdemo.timeeditor.value=Heure sélectionnée \: %1$tH\:%1$tM +jaxxdemo.timeeditor.model=R\u00E9sultat +jaxxdemo.timeeditor.value=Heure s\u00E9lectionn\u00E9e \: %1$tH\:%1$tM jaxxdemo.title.about=A propos de JAXX Demo... jaxxdemo.title.showLog=Logs de JAXX Demo jaxxdemo.tree.tabtitle=Arbre jaxxdemo.treeTable.tabtitle=Arbre tableau -jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas été trouvé, il faut au moins la version 1.6u10 de java. -jaxxdemo.warning.no.ui=Aucun environnement graphique détecté +jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas \u00E9t\u00E9 trouv\u00E9, il faut au moins la version 1.6u10 de java. +jaxxdemo.warning.no.ui=Aucun environnement graphique d\u00E9tect\u00E9 model0.f0= model0.f1= model0.file...= Modified: trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties =================================================================== --- trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties 2012-06-28 15:37:40 UTC (rev 2344) @@ -21,7 +21,7 @@ Blue=Bleu Blue\:=bleu \: Bold=En gras -Button\ label\:=Libellé de l'action +Button\ label\:=Libell\u00E9 de l'action C=C CE=CE Cancel=Annuler @@ -35,12 +35,12 @@ Editable=Editable Email\ Address\:=Courriel Email\:=Courriel -Enabled=Activé +Enabled=Activ\u00E9 EnumEditor\ (country)\ \:=Editeur de pays EnumEditor\ (language)\ \:=Editeur de langue Fancy\ Button=Bouton 'Fancy' -First\ Name\:=Prénom -FirstName\:=Prénom \: +First\ Name\:=Pr\u00E9nom +FirstName\:=Pr\u00E9nom \: Font\ size=Taille de la police Font\ size\:\ = Fool\ me\ once= @@ -49,7 +49,7 @@ Green\:=Vert \: Greet= Help= -Inc\ (+)=Incrémenter (+) +Inc\ (+)=Incr\u00E9menter (+) Italic=Italique JAXX\ Demo= JMenu\ demo= @@ -70,26 +70,26 @@ Red\:=rouge \: Reset=Reinitialiser Show\ Background=Voir le fond -Show\ password\ dialog=Voir l'éditeur de mot de passe +Show\ password\ dialog=Voir l'\u00E9diteur de mot de passe Sign\ on=Signer Simple\ Button=Bouton simple Size\:=Taille \: Sources=Sources Spacing\:=Espacement \: -Start=Démarrer -Stop=Arrêter -Supported\ Swing\ components\:=Composants Swing supportés +Start=D\u00E9marrer +Stop=Arr\u00EAter +Supported\ Swing\ components\:=Composants Swing support\u00E9s Text2\:=Text 2 Text\:=Texte \: Total\:\ = -Underline=souligné +Underline=soulign\u00E9 Upper\ case\ text\:=Texte en majuscule Use\ the\ spinner\ to=Utiliser la jauge pour Username\:=Utilisateur \: -Vegetable=Légumes +Vegetable=L\u00E9gumes View=Vue Welcome\ to\ the\ JAXX\ framework\!=Bienvenu dans le framework JAXX -Working\ directory\:=Répertoire de travail +Working\ directory\:=R\u00E9pertoire de travail Yellow=Jaune You\ entered\:\ = Your\ name\:=Votre nom \: @@ -98,8 +98,8 @@ between\ these\ lines= button\ A=Bouton A button\ B=Bouton B -button\ C\ (full\ block)=Bouton C (blocage complêt) -button\ D\ (full\ block\ 2)=Bouton D (blocage complêt) +button\ C\ (full\ block)=Bouton C (blocage compl\u00EAt) +button\ D\ (full\ block\ 2)=Bouton D (blocage compl\u00EAt) cancel=Annuler close=Fermer close2=Fermer 2 @@ -143,12 +143,12 @@ jaxxdemo.action.configuration.tip=Modifier la configuration jaxxdemo.action.exit=Quitter jaxxdemo.action.exit.tip=Quitter JAXX Demo -jaxxdemo.action.fullscreen=Plein écran -jaxxdemo.action.fullscreen.tip=Passer en mode pleine écran +jaxxdemo.action.fullscreen=Plein \u00E9cran +jaxxdemo.action.fullscreen.tip=Passer en mode pleine \u00E9cran jaxxdemo.action.help=Aide jaxxdemo.action.help.tip=Affichier l'aide -jaxxdemo.action.locale.fr=Français -jaxxdemo.action.locale.fr.tip=Changer la langue en français +jaxxdemo.action.locale.fr=Fran\u00E7ais +jaxxdemo.action.locale.fr.tip=Changer la langue en fran\u00E7ais jaxxdemo.action.locale.uk=Anglais jaxxdemo.action.locale.uk.tip=Changer la langue en anglais jaxxdemo.action.normalscreen=Ecran normal @@ -156,10 +156,10 @@ jaxxdemo.action.remove=Supprimer jaxxdemo.action.show=Voir jaxxdemo.action.site=Site internet -jaxxdemo.action.site.tip=Accéder au site de l'application sur internet +jaxxdemo.action.site.tip=Acc\u00E9der au site de l'application sur internet jaxxdemo.common.actors=Acteurs jaxxdemo.common.age=Age -jaxxdemo.common.firstName=Prénom +jaxxdemo.common.firstName=Pr\u00E9nom jaxxdemo.common.id=Identifiant jaxxdemo.common.image=Image jaxxdemo.common.lastName=Nom @@ -167,7 +167,7 @@ jaxxdemo.common.movies=Films jaxxdemo.common.people=Acteur jaxxdemo.common.title=Titre -jaxxdemo.common.year=Année +jaxxdemo.common.year=Ann\u00E9e jaxxdemo.component.jaxx=Composants JAXX jaxxdemo.component.jaxx.editor=Editeurs jaxxdemo.component.swing=Composants Swing @@ -176,49 +176,51 @@ jaxxdemo.component.swing.form.text=Texte jaxxdemo.component.swing.layout=Layouts jaxxdemo.component.swing.menu=Menus -jaxxdemo.component.swing.window=Fenêtres -jaxxdemo.config.category.directories=Répertoires -jaxxdemo.config.category.directories.description=Répertoires de l'application +jaxxdemo.component.swing.window=Fen\u00EAtres +jaxxdemo.config.category.directories=R\u00E9pertoires +jaxxdemo.config.category.directories.description=R\u00E9pertoires de l'application jaxxdemo.config.category.other=Autre jaxxdemo.config.category.other.description=Autres options jaxxdemo.config.configFileName.description=Le nom du fichier de configuration -jaxxdemo.config.ui.demo.path=Chemin de la démo par défaut -jaxxdemo.config.ui.fontSize=La taille de la police à utiliser pour visualiser dans les sources -jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine écran -jaxxdemo.config.ui.locale=La langue utilisée par l'application +jaxxdemo.config.ui.demo.path=Chemin de la d\u00E9mo par d\u00E9faut +jaxxdemo.config.ui.fontSize=La taille de la police \u00E0 utiliser pour visualiser dans les sources +jaxxdemo.config.ui.fullscreen=Pour afficher l'aplication en mode pleine \u00E9cran +jaxxdemo.config.ui.locale=La langue utilis\u00E9e par l'application jaxxdemo.config.ui.logLevel=Level de log jaxxdemo.config.ui.logPatternLayout=Pattern des log -jaxxdemo.datePickerEditor.dateResult=Affichage du résultat +jaxxdemo.datePickerEditor.dateResult=Affichage du r\u00E9sultat jaxxdemo.datePickerEditor.patternLayout=Pattern de date jaxxdemo.datePickerEditor.showPopupButton=Afficher le boutton pour ouvrir la popup -jaxxdemo.feature=Fonctionnalités +jaxxdemo.feature=Fonctionnalit\u00E9s jaxxdemo.feature.databinding=Data binding jaxxdemo.feature.nav=API JAXX pour les arbres jaxxdemo.feature.validation=Validation -jaxxdemo.fileEditor.acceptAllFileFilterUsed=Accèpte tout les FileFilter -jaxxdemo.fileEditor.directoryEnabled=Activer la sélection des files -jaxxdemo.fileEditor.extsDescLbl=Description des extensions (séparées par des virgules, ex \: Texte (*.txt), Images (*.png)) +jaxxdemo.fileEditor.acceptAllFileFilterUsed=Acc\u00E8pte tout les FileFilter +jaxxdemo.fileEditor.directoryEnabled=Activer la s\u00E9lection des files +jaxxdemo.fileEditor.extsDescLbl=Description des extensions (s\u00E9par\u00E9es par des virgules, ex \: Texte (*.txt), Images (*.png)) jaxxdemo.fileEditor.extsLbl=Extensions (separated by comma, ex \: txt, png) -jaxxdemo.fileEditor.fileEnabled=Activer la sélection des fichiers -jaxxdemo.fileEditor.titleLbl=Titre de la fenêtre de sélection de fichier +jaxxdemo.fileEditor.fileEnabled=Activer la s\u00E9lection des fichiers +jaxxdemo.fileEditor.titleLbl=Titre de la fen\u00EAtre de s\u00E9lection de fichier jaxxdemo.fun=Fun jaxxdemo.i18neditor.configuration=Configuration jaxxdemo.i18neditor.popup.title=Titre de la popup jaxxdemo.i18neditor.popupBorderText=Titre de la popup -jaxxdemo.i18neditor.selected.locale=Langue sélectionnée +jaxxdemo.i18neditor.selected.locale=Langue s\u00E9lectionn\u00E9e jaxxdemo.i18neditor.showIcon=Afficher les icones jaxxdemo.i18neditor.showPopupIcon=Afficher les icones dans la popup jaxxdemo.i18neditor.showPopupText=Afficher les textes dans la popup jaxxdemo.i18neditor.showText=Afficher le text -jaxxdemo.init.closed=JAXX Demo a été fermé à %1$s -jaxxdemo.init.context.done=Initialisation du contexte terminée en %1$s. -jaxxdemo.init.ui.done=Initialisation de l'interface graphique terminée. +jaxxdemo.init.closed=JAXX Demo a \u00E9t\u00E9 ferm\u00E9 \u00E0 %1$s +jaxxdemo.init.context.done=Initialisation du contexte termin\u00E9e en %1$s. +jaxxdemo.init.ui.done=Initialisation de l'interface graphique termin\u00E9e. +jaxxdemo.listSelector.addToolTipLbl=Tooltip du boutton ajouter +jaxxdemo.listSelector.removeToolTipLbl=Tooltip du boutton enlever jaxxdemo.menu.file=Fichier jaxxdemo.menu.file.locale=Langues jaxxdemo.menu.help=Aide jaxxdemo.menu.showLogs=Afficher les logs -jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s chargée. -jaxxdemo.message.goto.site=Accéder au site de JAXX Demo (%1$s) +jaxxdemo.message.config.loaded=Configuration de JAXX Demo v. %1$s charg\u00E9e. +jaxxdemo.message.goto.site=Acc\u00E9der au site de JAXX Demo (%1$s) jaxxdemo.navigation.actor.title=Acteur jaxxdemo.navigation.actors.title=Acteurs jaxxdemo.navigation.movie.title=Film @@ -226,25 +228,25 @@ jaxxdemo.numbereditor.applyNumberPattern=Appliquer le pattern jaxxdemo.numbereditor.autoPopup=Affichage automatique popup jaxxdemo.numbereditor.configuration=Configuration -jaxxdemo.numbereditor.model=Résultat -jaxxdemo.numbereditor.model.float=Valeur décimale \: %1$s -jaxxdemo.numbereditor.model.int=Valeur entière \: %1$s -jaxxdemo.numbereditor.model.numberPattern=Format de l'éditeur \: %s +jaxxdemo.numbereditor.model=R\u00E9sultat +jaxxdemo.numbereditor.model.float=Valeur d\u00E9cimale \: %1$s +jaxxdemo.numbereditor.model.int=Valeur enti\u00E8re \: %1$s +jaxxdemo.numbereditor.model.numberPattern=Format de l'\u00E9diteur \: %s jaxxdemo.numbereditor.numberPattern.configuration=Pattern du nombre jaxxdemo.numbereditor.showPopupButton=Afficher le boutton de popup jaxxdemo.numbereditor.showReset=Afficher le boutton de reset -jaxxdemo.numbereditor.useFloat=Utiliser les décimales +jaxxdemo.numbereditor.useFloat=Utiliser les d\u00E9cimales jaxxdemo.numbereditor.useSign=Utiliser le signe jaxxdemo.timeeditor.editor=Editeur de temps jaxxdemo.timeeditor.label=Label -jaxxdemo.timeeditor.model=Résultat -jaxxdemo.timeeditor.value=Heure sélectionnée \: %1$tH\:%1$tM +jaxxdemo.timeeditor.model=R\u00E9sultat +jaxxdemo.timeeditor.value=Heure s\u00E9lectionn\u00E9e \: %1$tH\:%1$tM jaxxdemo.title.about=A propos de JAXX Demo... jaxxdemo.title.showLog=Logs de JAXX Demo jaxxdemo.tree.tabtitle=Arbre jaxxdemo.treeTable.tabtitle=Arbre tableau -jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas été trouvé, il faut au moins la version 1.6u10 de java. -jaxxdemo.warning.no.ui=Aucun environnement graphique détecté +jaxxdemo.warning.nimbus.landf=Le look and Feel Nimbus n'a pas \u00E9t\u00E9 trouv\u00E9, il faut au moins la version 1.6u10 de java. +jaxxdemo.warning.no.ui=Aucun environnement graphique d\u00E9tect\u00E9 model0.f0= model0.f1= model0.file...= Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ComboToListSelector.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ComboToListSelector.jaxx (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ComboToListSelector.jaxx 2012-06-28 15:37:40 UTC (rev 2344) @@ -0,0 +1,60 @@ +<!-- + #%L + JAXX :: Widgets + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2008 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a 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% + --> +<ListSelector genericType='B'> + <row> + <cell fill='horizontal' weightx='1' anchor="west"> + <JComboBox id='from' + model='{fromModel}' + renderer='{getRenderer()}'/> + </cell> + <cell anchor='east'> + <JToolBar id='actions' floatable='false'> + <JButton id="add" + toolTipText='{getAddToolTip()}' + actionIcon='add' + enabled='{isAddEnabled()}' + onActionPerformed='add()'/> + + <JButton id="remove" + toolTipText='{getRemoveToolTip()}' + actionIcon='remove' + enabled='{isRemoveEnabled()}' + onActionPerformed='remove()'/> + + </JToolBar> + </cell> + </row> + <row> + <cell columns='2' fill='both' weightx='1' weighty='1'> + <JScrollPane id='listPane'> + <JList id='to' + model='{toModel}' + selectionModel='{toModel}' + font-size='11' + onMouseClicked='if (event.getClickCount()==2) { remove(); }' + cellRenderer='{getRenderer()}'/> + </JScrollPane> + </cell> + </row> +</ListSelector> \ No newline at end of file Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/GenericListModel.java =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/GenericListModel.java (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/GenericListModel.java 2012-06-28 15:37:40 UTC (rev 2344) @@ -0,0 +1,227 @@ +/* + * #%L + * JAXX :: Widgets + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2008 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a 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.runtime.swing; + +import com.google.common.collect.Lists; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import java.util.List; +import javax.swing.ComboBoxModel; +import javax.swing.DefaultListModel; +import javax.swing.DefaultListSelectionModel; +import javax.swing.event.ListDataListener; + +/** + * @author sletellier <letellier@codelutin.com> + */ +public class GenericListModel<B> extends DefaultListSelectionModel implements ComboBoxModel { + + protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + + public static final String PROPERTY_SELECTED_VALUE = "selectedValues"; + + protected DefaultListModel delegate = new DefaultListModel(); + + protected List<B> selectedValues; + + public GenericListModel() { + this.selectedValues = Lists.newArrayList(); + } + + public void setElements(List<B> values) { + for (B value : values) { + addElement(value); + } + } + + public List<B> getElements() { + int size = delegate.getSize(); + List<B> result = Lists.newArrayList(); + for (int i=0;i<size;i++) { + result.add((B) delegate.get(i)); + } + return result; + } + + public void addElement(int index, B valueToAdd) { + delegate.add(index, valueToAdd); + } + + public void addElement(B valueToAdd) { + delegate.addElement(valueToAdd); + } + + public void addElements(List<B> valuesToAdd) { + for (B value : valuesToAdd) { + addElement(value); + } + } + + public List<B> getSelectedValues() { + return Lists.newArrayList(selectedValues); + } + + public void removeElements(List<B> values) { + for (B value : values) { + delegate.removeElement(value); + } + unSelectItems(values); + } + + protected void unSelectItems(List<B> values) { + List<B> oldValue = Lists.newArrayList(selectedValues); + selectedValues.removeAll(values); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + protected void unSelectItem(B value) { + List<B> oldValue = Lists.newArrayList(selectedValues); + selectedValues.remove(value); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + public void addSelectedItem(B toSelect) { + List<B> oldValue = Lists.newArrayList(selectedValues); + selectedValues.add(toSelect); + int index = selectedValues.indexOf(toSelect); + super.addSelectionInterval(index, index); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + public boolean hasSelectedIndex() { + return !selectedValues.isEmpty(); + } + + @Override + public void addSelectionInterval(int index0, int index1) { + List<B> oldValue = Lists.newArrayList(selectedValues); + addSelectionIntervalWithFire(index0, index1); + super.addSelectionInterval(index0, index1); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + @Override + public void setSelectionInterval(int index0, int index1) { + List<B> oldValue = Lists.newArrayList(selectedValues); + selectedValues.clear(); + addSelectionIntervalWithFire(index0, index1); + super.setSelectionInterval(index0, index1); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + @Override + public void removeSelectionInterval(int index0, int index1) { + List<B> oldValue = Lists.newArrayList(selectedValues); + if (index0 > index1) { + int tmp = index1; + index1 = index0; + index0 = tmp; + } + for (int i=index0;i<=index1;i++) { + selectedValues.remove(i); + } + super.removeSelectionInterval(index0, index1); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + protected void addSelectionIntervalWithFire(int index0, int index1) { + if (index0 > index1) { + int tmp = index1; + index1 = index0; + index0 = tmp; + } + for (int i=index0;i<=index1;i++) { + B value = (B)delegate.getElementAt(i); + selectedValues.add(value); + } + } + + @Override + public void clearSelection() { + List<B> oldValue = Lists.newArrayList(selectedValues); + selectedValues.clear(); + super.clearSelection(); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + @Override + public int getSelectionMode() { + return MULTIPLE_INTERVAL_SELECTION; + } + + @Override + public void setSelectedItem(Object anItem) { + List<B> oldValue = this.selectedValues; + selectedValues = Lists.newArrayList((B)anItem); + firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); + } + + @Override + public Object getSelectedItem() { + if (selectedValues.isEmpty()) { + return null; + } + return selectedValues.get(0); + } + + @Override + public int getSize() { + return delegate.size(); + } + + @Override + public Object getElementAt(int index) { + return delegate.get(index); + } + + @Override + public void addListDataListener(ListDataListener l) { + delegate.addListDataListener(l); + } + + @Override + public void removeListDataListener(ListDataListener l) { + delegate.removeListDataListener(l); + } + + public void addPropertyChangeListener(PropertyChangeListener listener) { + pcs.addPropertyChangeListener(listener); + } + + public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { + pcs.addPropertyChangeListener(propertyName, listener); + } + + public void removePropertyChangeListener(PropertyChangeListener listener) { + pcs.removePropertyChangeListener(listener); + } + + public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { + pcs.removePropertyChangeListener(propertyName, listener); + } + + protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { + pcs.firePropertyChange(propertyName, oldValue, newValue); + } +} \ No newline at end of file Copied: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelector.jaxx (from rev 2337, trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx) =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelector.jaxx (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelector.jaxx 2012-06-28 15:37:40 UTC (rev 2344) @@ -0,0 +1,110 @@ +<!-- + #%L + JAXX :: Widgets + + $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% + --> +<Table insets='0' genericType='B' abstract='true'> + + <import> + java.util.List + javax.swing.DefaultComboBoxModel + javax.swing.DefaultListModel + javax.swing.DefaultListCellRenderer + java.beans.PropertyChangeEvent + java.beans.PropertyChangeListener + </import> + + <String id='addToolTip' javaBean='"+"'/> + + <String id='removeToolTip' javaBean='"-"'/> + + <GenericListModel id='fromModel' + genericType='B'/> + + <Boolean id='addEnabled' javaBean='Boolean.FALSE'/> + <Boolean id='removeEnabled' javaBean='Boolean.FALSE'/> + + <GenericListModel id='toModel' + genericType='B'/> + + <ListCellRenderer id='renderer' javaBean='new DefaultListCellRenderer()'/> + + <script><![CDATA[ + +protected void $afterCompleteSetup() { + toModel.addPropertyChangeListener(GenericListModel.PROPERTY_SELECTED_VALUE, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + setRemoveEnabled(toModel.hasSelectedIndex()); + } + }); + fromModel.addPropertyChangeListener(GenericListModel.PROPERTY_SELECTED_VALUE, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + setAddEnabled(fromModel.hasSelectedIndex()); + } + }); +} + +/** + * @return the datas from. + */ +public List<B> getFromDatas() { + return fromModel.getElements(); +} + +/** + * @return the data to. + */ +public List<B> getToDatas() { + return toModel.getElements(); +} + +/** + * Initialize the component. + * + * @param from datas to set + * @param to datas to set + */ +public void init(List<B> from, List<B> to) { + fromModel.setElements(from); + toModel.setElements(to); +} + +public void add() { + moveSelect(fromModel, toModel); +} + +public void remove() { + moveSelect(toModel, fromModel); +} + +protected void moveSelect(GenericListModel<B> from, GenericListModel<B> to) { + List<B> selectedValues = from.getSelectedValues(); + from.removeElements(selectedValues); + to.addElements(selectedValues); +} + +]]> + </script> + +</Table> \ No newline at end of file Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelector.jaxx ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorHandler.java =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorHandler.java 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorHandler.java 2012-06-28 15:37:40 UTC (rev 2344) @@ -1,179 +0,0 @@ -/* - * #%L - * JAXX :: Widgets - * - * $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.runtime.swing; - -import jaxx.runtime.SwingUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.*; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; - -/** - * @author sletellier <letellier@codelutin.com> - * @since 2.2.3 - */ -public class ListSelectorHandler <B> { - - public static final Log log = LogFactory.getLog(ListSelectorHandler.class); - - protected ListSelectorUI<B> listSelector; - - public ListSelectorHandler(final ListSelectorUI<B> listSelector) { - this.listSelector = listSelector; - } - - protected JComboBox getCombo() { - return listSelector.getCombo(); - } - - protected JList getList() { - return listSelector.getList(); - } - - /** - * @return the datas from the combo box. - */ - public java.util.List<B> getComboDatas() { - java.util.List<B> datas = new java.util.ArrayList<B>(); - ComboBoxModel comboModel = getCombo().getModel(); - for (int i = 0, j = comboModel.getSize(); i < j; i++) { - B g = (B) comboModel.getElementAt(i); - datas.add(g); - } - return datas; - } - - /** - * @return the data for the list. - */ - public java.util.List<B> getListDatas() { - java.util.List<B> datas = new java.util.ArrayList<B>(); - ListModel listModel = getList().getModel(); - for (int i = 0, j = listModel.getSize(); i < j; i++) { - B g = (B) listModel.getElementAt(i); - datas.add(g); - } - return datas; - } - - /** - * Initialize the component. - * - * @param toCombo datas to set in combo - * @param toList datas to set in list - */ - public void init(java.util.List<B> toCombo, java.util.List<B> toList) { - setComboDatas(toCombo); - setListDatas(toList); - // after init, always unmodified editor - // TODO should avoid to fire a changed ? - listSelector.setModified(false); - - HidorButton hidor = listSelector.getHidor(); - hidor.addPropertyChangeListener("targetVisible", new PropertyChangeListener() { - - @Override - public void propertyChange(PropertyChangeEvent evt) { - if (log.isDebugEnabled()) { - log.debug("target visible changed <" + evt.getOldValue() + ":" + evt.getNewValue() + ">"); - } - if (!listSelector.isShowHidor() || !listSelector.isEnabled()) { - return; - } - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - log.info("invalidate " + listSelector.getParent().getName()); - listSelector.listPane.invalidate(); - } - }); - } - }); - } - - /** - * Transfert the {@code b} data from combo box to list. - * - * @param b the data to transfert - */ - protected void transfertToList(B b) { - ((DefaultListModel) getList().getModel()).addElement(b); - ((DefaultComboBoxModel) getCombo().getModel()).removeElement(b); - listSelector.setModified(true); - } - - /** - * Transfert the {@code b} data from list to combo box. - * - * @param bs the data to transfert - */ - protected void transfertToCombo(B[] bs) { - for (B b : bs) { - ((DefaultListModel) getList().getModel()).removeElement(b); - ((DefaultComboBoxModel) getCombo().getModel()).addElement(b); - } - listSelector.setModified(true); - } - - /** - * @param enabled databinding - * @return {@code true} if add button should be enabled - */ - protected boolean updateAddEnabled(boolean enabled) { - return enabled && getCombo().getModel().getSize() > 0; - } - - /** - * @param enabled databinding - * @return {@code true} if remove button should be enabled - */ - protected boolean updateRemoveEnabled(boolean enabled) { - return enabled && getList().getModel().getSize() > 0; - } - - /** - * Set the data in combo box model. - * - * @param toCombo datas to set in combo box model - */ - protected void setComboDatas(java.util.List<B> toCombo) { - SwingUtil.fillComboBox(getCombo(), toCombo, null); - //Note : there is a case when combo was selected, then come here with an empty - // combo model : no propertyChanged is fired, so add button stays enabled... - listSelector.processDataBinding("add.enabled"); - } - - /** - * Set the data in the list model. - * - * @param toList datas to set in list model - */ - protected void setListDatas(java.util.List<B> toList) { - SwingUtil.fillList(getList(), toList, null); - } -} Deleted: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListSelectorUI.jaxx 2012-06-28 15:37:40 UTC (rev 2344) @@ -1,128 +0,0 @@ -<!-- - #%L - JAXX :: Widgets - - $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% - --> -<JPanel layout='{new BorderLayout()}' genericType='B'> - - <import> - java.util.List - javax.swing.DefaultComboBoxModel - javax.swing.DefaultListModel - </import> - - <!-- show hidor property --> - <Boolean id='showHidor' javaBean='false'/> - - <Boolean id='modified' javaBean='false'/> - - <String id='addToListTip' javaBean='"+"'/> - - <String id='addToComboTip' javaBean='"-"'/> - - <ListCellRenderer id='renderer' javaBean='null'/> - - <!-- ui handler --> - <ListSelectorHandler id='handler' genericType='B' constructorParams='this'/> - - <script><![CDATA[ - -public void setHandler(ListSelectorHandler<B> handler) { - this.handler = handler; -} - -/** - * @return the datas from the combo box. - */ -public List<B> getComboDatas() { - return handler.getComboDatas(); -} - -/** - * @return the data for the list. - */ -public List<B> getListDatas() { - return handler.getListDatas(); -} - -/** - * Initialize the component. - * - * @param toCombo datas to set in combo - * @param toList datas to set in list - */ -public void init(List<B> toCombo, List<B> toList) { - handler.init(toCombo, toList); -} -]]> - </script> - - <JScrollPane id='listPane' constraints='BorderLayout.CENTER' - columnHeaderView='{header}'> - <!--minimumSize='{SwingUtil.newMinDimension()}'>--> - <!--verticalScrollBarPolicy='vertical_scrollbar_always'--> - <JPanel layout="{new BorderLayout()}" minimumSize='{getMinimumSize()}'> - <JList id='list' - constraints='BorderLayout.CENTER' - enabled='{isEnabled()}' - model='{new DefaultListModel()}' - font-size='11' - onMouseClicked='if (event.getClickCount()==2) { handler.transfertToCombo((B[]) list.getSelectedValues()); }' - cellRenderer='{getRenderer()}'/> - </JPanel> - - </JScrollPane> - - <Table id="header" insets='0' constraints='BorderLayout.SOUTH'> - <row> - <cell fill='horizontal' weightx='1' anchor="west"> - <JComboBox id='combo' enabled='{isEnabled()}' - model='{new DefaultComboBoxModel()}' - renderer='{getRenderer()}'/> - </cell> - <cell anchor='east'> - <JToolBar id='actions' floatable='false'> - <JButton id="add" - toolTipText='{getAddToListTip()}' - actionIcon='add' - enabled='{handler.updateAddEnabled(combo.isEnabled() && combo.getSelectedIndex() > -1)}' - onActionPerformed='handler.transfertToList((B) combo.getSelectedItem());'/> - - <JButton id="remove" - toolTipText='{getAddToComboTip()}' - actionIcon='remove' - enabled='{handler.updateRemoveEnabled(list.isEnabled() && list.getSelectedIndex() > -1)}' - onActionPerformed='handler.transfertToCombo((B[]) list.getSelectedValues())'/> - - <HidorButton id="hidor" - target='{list}' - visible='{isShowHidor()}' - enabled='{isEnabled()}' - hideTip='{_("listSelector.hideList")}' - showTip='{_("listSelector.showList")}' - targetVisible='{true}'/> - </JToolBar> - </cell> - </row> - </Table> - -</JPanel> Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListToListSelector.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListToListSelector.jaxx (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/ListToListSelector.jaxx 2012-06-28 15:37:40 UTC (rev 2344) @@ -0,0 +1,64 @@ +<!-- + #%L + JAXX :: Widgets + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2008 - 2012 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a 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% + --> +<ListSelector genericType='B'> + <import> + javax.swing.SwingConstants + </import> + + <row> + <cell fill='both' weightx='1' weighty='1'> + <JList id='from' + model='{fromModel}' + selectionModel='{fromModel}' + onMouseClicked='if (event.getClickCount()==2) { add(); }' + cellRenderer='{getRenderer()}'/> + </cell> + <cell anchor='north'> + <JToolBar id='actions' floatable='false' orientation='{SwingConstants.VERTICAL}'> + <JButton id="add" + toolTipText='{getAddToolTip()}' + actionIcon='add' + enabled='{isAddEnabled()}' + onActionPerformed='add()'/> + + <JButton id="remove" + toolTipText='{getRemoveToolTip()}' + actionIcon='remove' + enabled='{isRemoveEnabled()}' + onActionPerformed='remove()'/> + + </JToolBar> + </cell> + <cell fill='both' weightx='1' weighty='1'> + <JScrollPane id='listPane'> + <JList id='to' + model='{toModel}' + selectionModel='{toModel}' + font-size='11' + onMouseClicked='if (event.getClickCount()==2) { remove(); }' + cellRenderer='{getRenderer()}'/> + </JScrollPane> + </cell> + </row> +</ListSelector> \ No newline at end of file Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jaxx 2012-06-27 12:07:56 UTC (rev 2343) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/FileEditor.jaxx 2012-06-28 15:37:40 UTC (rev 2344) @@ -64,13 +64,13 @@ ]]></script> <JTextField id='pathField' - constraints='{BorderLayout.CENTER}' + constraints='BorderLayout.CENTER' enabled='{isEnabled()}' text='{getStartPath()}' onFocusLost='setSelectedFile(new File(pathField.getText()))'/> <JButton id='boutonXslLocation' - constraints='{BorderLayout.EAST}' + constraints='BorderLayout.EAST' enabled='{isEnabled()}' actionIcon='open' onActionPerformed='handler.openLocation()'/>