08/16: move double list to widgets-select module
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See http://git.nuiton.org/jaxx.git commit df5e3d941d74b5ffa1b8bf3d5829c2f80e180fa0 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Nov 30 12:23:13 2014 +0100 move double list to widgets-select module --- jaxx-widgets-select/pom.xml | 70 +++++++++------------- .../jaxx/widgets/select}/FilterableDoubleList.css | 14 ++--- .../jaxx/widgets/select}/FilterableDoubleList.jaxx | 16 ++--- .../select}/FilterableDoubleListConfig.java | 2 +- .../select}/FilterableDoubleListHandler.java | 10 ++-- .../widgets/select}/FilterableDoubleListModel.java | 2 +- .../select/session/FilterableDoubleListState.java | 66 ++++++++++++++++++++ .../i18n/jaxx-widgets-select_en_GB.properties | 14 +++++ .../i18n/jaxx-widgets-select_es_ES.properties | 14 +++++ .../i18n/jaxx-widgets-select_fr_FR.properties | 14 +++++ 10 files changed, 159 insertions(+), 63 deletions(-) diff --git a/jaxx-widgets-select/pom.xml b/jaxx-widgets-select/pom.xml index 3854dc3..07d0f4c 100644 --- a/jaxx-widgets-select/pom.xml +++ b/jaxx-widgets-select/pom.xml @@ -37,6 +37,14 @@ <name>JAXX :: Widgets Select</name> <description>Widgets to select data (using combobox, jlist, doublelist...)</description> + <properties> + <jaxx.addProjectClassPath>true</jaxx.addProjectClassPath> + <jaxx.addSourcesToClassPath>true</jaxx.addSourcesToClassPath> + <jaxx.autoImportCss>true</jaxx.autoImportCss> + <jaxx.addAutoHandlerUI>true</jaxx.addAutoHandlerUI> + <!--jaxx.useUIManagerForIcon>true</jaxx.useUIManagerForIcon--> + </properties> + <dependencies> <!-- sibiling dependencies --> @@ -49,7 +57,7 @@ <dependency> <groupId>${project.groupId}</groupId> - <artifactId>jaxx-widgets-doublelist</artifactId> + <artifactId>jaxx-widgets-common</artifactId> <version>${project.version}</version> </dependency> @@ -57,16 +65,6 @@ <groupId>org.swinglabs.swingx</groupId> <artifactId>swingx-common</artifactId> </dependency> - - <dependency> - <groupId>org.swinglabs.swingx</groupId> - <artifactId>swingx-core</artifactId> - </dependency> - - <dependency> - <groupId>org.swinglabs.swingx</groupId> - <artifactId>swingx-autocomplete</artifactId> - </dependency> <dependency> <groupId>org.nuiton.i18n</groupId> @@ -84,46 +82,16 @@ </dependency> <dependency> - <groupId>org.nuiton</groupId> - <artifactId>nuiton-converter</artifactId> - </dependency> - - <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> </dependency> <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - </dependency> - - <dependency> - <groupId>commons-primitives</groupId> - <artifactId>commons-primitives</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-collections4</artifactId> - </dependency> - - <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - </dependency> - - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - - <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <scope>provided</scope> @@ -150,8 +118,28 @@ <plugins> <plugin> + <groupId>${project.groupId}</groupId> + <artifactId>jaxx-maven-plugin</artifactId> + <version>${project.version}</version> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> <groupId>org.nuiton.i18n</groupId> <artifactId>i18n-maven-plugin</artifactId> + <configuration> + <entries> + <entry> + <basedir>${project.build.directory}/generated-sources/java</basedir> + </entry> + </entries> + </configuration> <executions> <execution> <goals> diff --git a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleList.css b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleList.css similarity index 91% rename from jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleList.css rename to jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleList.css index 76cc729..578c770 100644 --- a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleList.css +++ b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleList.css @@ -24,12 +24,12 @@ enabled:{isEnabled()}; } -#filterPanel { +.filterable { visible: {isFilterable()}; } #filterFieldLabel { - actionIcon: "filter"; + actionIcon: "doublelist-filter"; } #universeList { @@ -38,7 +38,7 @@ #addButton { toolTipText:"beandoublelist.button.add"; - actionIcon:"bean-doublelist-select"; + actionIcon:"doublelist-select"; } #selectedList { @@ -48,7 +48,7 @@ #removeButton { toolTipText:"beandoublelist.button.remove"; - actionIcon:"bean-doublelist-unselect"; + actionIcon:"doublelist-unselect"; } #popup { @@ -77,21 +77,21 @@ } #selectedListMoveUpAction { - actionIcon: "bean-doublelist-up"; + actionIcon: "doublelist-up"; text: "bean.action.selected.move.up"; toolTipText: "bean.action.selected.move.up.tip"; enabled:{model.isSelectedUpEnabled()}; } #selectedListMoveDownAction { - actionIcon: "bean-doublelist-down"; + actionIcon: "doublelist-down"; text: "bean.action.selected.move.down"; toolTipText: "bean.action.selected.move.down.tip"; enabled:{model.isSelectedDownEnabled()}; } #selectedListRemoveAction { - actionIcon: "bean-doublelist-unselect"; + actionIcon: "doublelist-unselect"; text: "bean.action.selected.remove"; toolTipText: "bean.action.selected.remove.tip"; enabled:{model.isRemoveEnabled()}; diff --git a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleList.jaxx b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleList.jaxx similarity index 91% rename from jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleList.jaxx rename to jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleList.jaxx index 048d46c..7f73602 100644 --- a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleList.jaxx +++ b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleList.jaxx @@ -40,16 +40,16 @@ <!-- show showSelectPopupEnabled property --> <Boolean id='showSelectPopupEnabled' javaBean='true'/> - <!-- flag to reverse the sort --> - <Boolean id='reverseSort' javaBean='false'/> - <!-- show highlightFilterText property --> <Boolean id='highlightFilterText' javaBean='false'/> <!-- model --> <FilterableDoubleListModel id='model' genericType='O' initializer='getContextValue(FilterableDoubleListModel.class)'/> - <!-- sort index property --> + <!-- flag to reverse the sort (this state can be saved by SwingSession) --> + <Boolean id='reverseSort' javaBean='false'/> + + <!-- sort index property (this state can be saved by SwingSession) --> <Integer id='index' javaBean='0'/> <!-- model of sorted property --> @@ -83,14 +83,14 @@ </row> <row> <cell columns='3' fill='both'> - <JPanel layout='{new BorderLayout()}' id='filterPanel'> + <JPanel layout='{new BorderLayout()}' id='topPanel'> <JPanel layout='{new BorderLayout()}' constraints='BorderLayout.WEST'> - <JLabel id='filterFieldLabel' constraints='BorderLayout.WEST'/> - <JToolBar id='toolbarLeft' constraints='BorderLayout.EAST'> + <JLabel id='filterFieldLabel' styleClass='filterable' constraints='BorderLayout.WEST'/> + <JToolBar id='toolbarLeft' styleClass='filterable' constraints='BorderLayout.EAST'> <JButton id='resetButton' onActionPerformed='filterField.setText("")'/> </JToolBar> </JPanel> - <JTextField id='filterField' constraints='BorderLayout.CENTER'/> + <JTextField id='filterField' styleClass='filterable' constraints='BorderLayout.CENTER'/> <JToolBar id='toolbarRight' constraints='BorderLayout.EAST'> <JToggleButton id='changeDecorator' onActionPerformed='handler.togglePopup()'/> </JToolBar> diff --git a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListConfig.java b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListConfig.java similarity index 96% rename from jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListConfig.java rename to jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListConfig.java index aceb5cc..caf5de3 100644 --- a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListConfig.java +++ b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListConfig.java @@ -1,4 +1,4 @@ -package org.nuiton.jaxx.widgets.editor.bean; +package org.nuiton.jaxx.widgets.select; import java.io.Serializable; diff --git a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListHandler.java b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListHandler.java similarity index 98% rename from jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListHandler.java rename to jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListHandler.java index 56b4d78..cf1749f 100644 --- a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListHandler.java +++ b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListHandler.java @@ -1,4 +1,4 @@ -package org.nuiton.jaxx.widgets.editor.bean; +package org.nuiton.jaxx.widgets.select; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; @@ -7,7 +7,6 @@ import com.google.common.collect.Lists; import jaxx.runtime.SwingUtil; import jaxx.runtime.spi.UIHandler; import jaxx.runtime.swing.JAXXButtonGroup; -import jaxx.runtime.swing.editor.bean.BeanUIUtil; import jaxx.runtime.swing.model.JaxxFilterableListModel; import jaxx.runtime.swing.renderer.DecoratorListCellRenderer; import jaxx.runtime.swing.renderer.FilteredDecoratorListCellRenderer; @@ -16,6 +15,7 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.DecoratorUtil; import org.nuiton.decorator.JXPathDecorator; import org.nuiton.decorator.MultiJXPathDecorator; +import org.nuiton.jaxx.widgets.DecoratorPopupHandler; import org.nuiton.jaxx.widgets.MutateOnConditionalPropertyChangeListener; import org.nuiton.util.beans.BeanUtil; @@ -54,7 +54,7 @@ public class FilterableDoubleListHandler<O extends Serializable> implements UIHa /** the decorator of data */ private MultiJXPathDecorator<O> decorator; - private final BeanUIUtil.PopupHandler popupHandler = new BeanUIUtil.PopupHandler() { + private final DecoratorPopupHandler popupHandler = new DecoratorPopupHandler() { @Override public JPopupMenu getPopup() { @@ -287,7 +287,7 @@ public class FilterableDoubleListHandler<O extends Serializable> implements UIHa throw new NullPointerException("decorator can not be null (for type " + ui.getBeanType() + ")"); } - this.decorator = BeanUIUtil.createDecorator(decorator); + this.decorator = DecoratorUtil.cloneDecorator(decorator); FilterableDoubleListModel<O> model = ui.getModel(); @@ -365,7 +365,7 @@ public class FilterableDoubleListHandler<O extends Serializable> implements UIHa // Init selected list JList selectedList = ui.getSelectedList(); if (decorator2 != null) { - decorator2 = BeanUIUtil.createDecorator(decorator2); + decorator2 = DecoratorUtil.cloneDecorator(decorator2); } else { decorator2 = this.decorator; } diff --git a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListModel.java b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListModel.java similarity index 99% rename from jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListModel.java rename to jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListModel.java index 7451d18..f336c51 100644 --- a/jaxx-widgets/src/main/java/org/nuiton/jaxx/widgets/editor/bean/FilterableDoubleListModel.java +++ b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/FilterableDoubleListModel.java @@ -1,4 +1,4 @@ -package org.nuiton.jaxx.widgets.editor.bean; +package org.nuiton.jaxx.widgets.select; import jaxx.runtime.swing.model.JaxxDefaultListModel; import jaxx.runtime.swing.model.JaxxFilterableListModel; diff --git a/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/session/FilterableDoubleListState.java b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/session/FilterableDoubleListState.java new file mode 100644 index 0000000..4ff6bc1 --- /dev/null +++ b/jaxx-widgets-select/src/main/java/org/nuiton/jaxx/widgets/select/session/FilterableDoubleListState.java @@ -0,0 +1,66 @@ +package org.nuiton.jaxx.widgets.select.session; + +import jaxx.runtime.swing.session.State; +import org.nuiton.jaxx.widgets.select.FilterableDoubleList; + +/** + * Created on 11/30/14. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 2.18 + */ +public class FilterableDoubleListState implements State { + + protected int index = 0; + + protected Boolean reverseSort = false; + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public boolean isReverseSort() { + return reverseSort; + } + + public void setReverseSort(boolean reverseSort) { + this.reverseSort = reverseSort; + } + + @Override + public State getState(Object o) { + FilterableDoubleList list = checkComponent(o); + FilterableDoubleListState state = new FilterableDoubleListState(); + state.setIndex(list.getIndex()); + state.setReverseSort(list.isReverseSort()); + return state; + } + + @Override + public void setState(Object o, State state) { + if (!(state instanceof FilterableDoubleListState)) { + throw new IllegalArgumentException("invalid state"); + } + + FilterableDoubleList list = checkComponent(o); + FilterableDoubleListState beanDoubleListState = (FilterableDoubleListState) state; + list.setIndex(beanDoubleListState.getIndex()); + list.setReverseSort(beanDoubleListState.isReverseSort()); + + } + + protected FilterableDoubleList checkComponent(Object o) { + if (o == null) { + throw new IllegalArgumentException("null component"); + } + if (!(o instanceof FilterableDoubleList)) { + throw new IllegalArgumentException("invalid component"); + } + return (FilterableDoubleList) o; + } + +} diff --git a/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_en_GB.properties b/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_en_GB.properties new file mode 100644 index 0000000..3caaa9d --- /dev/null +++ b/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_en_GB.properties @@ -0,0 +1,14 @@ +bean.action.selected.move.down=Move down +bean.action.selected.move.down.tip=Move down the selected item +bean.action.selected.move.up=Move up +bean.action.selected.move.up.tip=Move up the selected item +bean.action.selected.remove=Unselect +bean.action.selected.remove.tip=Unselect the selected item +bean.sort.down=Descending sort +bean.sort.label=Sort order +bean.sort.up=Ascending sort +beandoublelist.action.reset.tip=Reset the value of the filter +beandoublelist.action.sort.tip=Change the sorted property +beandoublelist.button.add=Add +beandoublelist.button.remove=Remove +beandoublelist.popup.title=Change the sorted property diff --git a/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_es_ES.properties b/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_es_ES.properties new file mode 100644 index 0000000..848cb36 --- /dev/null +++ b/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_es_ES.properties @@ -0,0 +1,14 @@ +bean.action.selected.move.down=Descendre +bean.action.selected.move.down.tip=Descendre l'élément sélectionné +bean.action.selected.move.up=Monter +bean.action.selected.move.up.tip=Monter l'élément sélectionné +bean.action.selected.remove=Supprimer +bean.action.selected.remove.tip=Supprimer l'élément sélectionné +bean.sort.down=Calsificación decreciente +bean.sort.label=Orden de clasificación +bean.sort.up=Clasificación creciente +beandoublelist.action.reset.tip=Reiniciar el valor de la lista desplegable +beandoublelist.action.sort.tip=Modificar la clasificación de la lista +beandoublelist.button.add=Add +beandoublelist.button.remove=Remove +beandoublelist.popup.title=Modificar la clasificación diff --git a/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_fr_FR.properties b/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_fr_FR.properties new file mode 100644 index 0000000..0c8b63f --- /dev/null +++ b/jaxx-widgets-select/src/main/resources/i18n/jaxx-widgets-select_fr_FR.properties @@ -0,0 +1,14 @@ +bean.action.selected.move.down=Descendre +bean.action.selected.move.down.tip=Descendre l'élément sélectionné +bean.action.selected.move.up=Monter +bean.action.selected.move.up.tip=Monter l'élément sélectionné +bean.action.selected.remove=Supprimer +bean.action.selected.remove.tip=Supprimer l'élément sélectionné +bean.sort.down=Tri décroissant +bean.sort.label=Ordre de tri +bean.sort.up=Tri croissant +beandoublelist.action.reset.tip=Réinitialiser la valeur du filtre +beandoublelist.action.sort.tip=Modifier le tri de la liste +beandoublelist.button.add=Ajouter +beandoublelist.button.remove=Enlever +beandoublelist.popup.title=Modifier le tri -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm