Author: tchemit Date: 2012-11-21 12:43:40 +0100 (Wed, 21 Nov 2012) New Revision: 2521 Url: http://nuiton.org/repositories/revision/jaxx/2521 Log: fixes #2453: Use css for bean widgets Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.jaxx trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.jaxx Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css 2012-11-21 11:43:40 UTC (rev 2521) @@ -0,0 +1,93 @@ +/* + * #%L + * JAXX :: Widgets + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2012 CodeLutin, Tony Chemit + * %% + * 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% + */ +#indexes { + useToolTipText:true; +} + +#sortGroup { + useToolTipText:true; + selectedValue:{isReverseSort()}; +} + +#popup { + border:{new TitledBorder(_("beancombobox.popup.title"))}; +} + +#popupSortLabel { + actionIcon:"bean-sort"; + text:"bean.sort.label"; +} + +#sortUp { + buttonGroup:"sortGroup"; + value:{false}; + actionIcon:"bean-sort-up"; + text:"bean.sort.up"; + selected:{!isReverseSort()}; +} + +#sortDown { + buttonGroup:"sortGroup"; + value:{true}; + actionIcon:"bean-sort-down"; + text:"bean.sort.down"; + selected:{isReverseSort()}; +} + +#toolbarLeft { + floatable:false; + borderPainted:false; + visible:{isShowReset()}; +} + +#resetButton { + actionIcon:"combobox-reset"; + toolTipText:"beancombobox.action.reset.tip"; + focusable:false; + focusPainted:false; + enabled:{isEditable() && isEnabled()}; +} + +#combobox { + selectedItem:{getSelectedItem()}; + enabled:{isEnabled()}; + editable:{isEditable()}; + focusable:{isEnabled() && isEditable()}; +} + +#toolbarRight { + floatable:false; + borderPainted:false; + visible:{isShowDecorator()}; +} + +#changeDecorator { + actionIcon:"combobox-sort"; + toolTipText:"beancombobox.action.sort.tip"; + focusable:false; + focusPainted:false; +} + + + Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.jaxx 2012-11-20 21:16:20 UTC (rev 2520) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.jaxx 2012-11-21 11:43:40 UTC (rev 2521) @@ -63,11 +63,10 @@ <java.util.List id='data' genericType='O' javaBean='null'/> <!-- model of sorted property --> - <ButtonGroup id='indexes' useToolTipText='true' + <ButtonGroup id='indexes' onStateChanged='setIndex((Integer)indexes.getSelectedValue())'/> - <ButtonGroup id='sortGroup' useToolTipText='true' - selectedValue='{isReverseSort()}' + <ButtonGroup id='sortGroup' onStateChanged='setReverseSort((Boolean)sortGroup.getSelectedValue())'/> <!-- ui handler --> @@ -83,18 +82,13 @@ <!-- popup to change sorted property--> <JPopupMenu id='popup' - border='{new TitledBorder(_("beancombobox.popup.title"))}' onPopupMenuWillBecomeInvisible='getChangeDecorator().setSelected(false)' onPopupMenuCanceled='getChangeDecorator().setSelected(false)'> - <JLabel id='popupSortLabel' actionIcon="bean-sort" text="bean.sort.label"/> + <JLabel id='popupSortLabel'/> - <JRadioButtonMenuItem id='sortUp' buttonGroup="sortGroup" value='{false}' - actionIcon="bean-sort-up" text='bean.sort.up' - selected='{!isReverseSort()}'/> + <JRadioButtonMenuItem id='sortUp'/> - <JRadioButtonMenuItem id='sortDown' buttonGroup="sortGroup" value='{true}' - actionIcon="bean-sort-down" text='bean.sort.down' - selected='{isReverseSort()}'/> + <JRadioButtonMenuItem id='sortDown'/> <JSeparator id='popupSeparator'/> <JLabel id='popupLabel'/> @@ -116,36 +110,21 @@ <row> <cell anchor='west'> <!-- le boutton pour reinitialiser la valeur sélectionnée --> - <JToolBar floatable='false' borderPainted='false' - visible='{isShowReset()}'> - <JButton actionIcon='combobox-reset' - toolTipText='beancombobox.action.reset.tip' - focusable='false' - focusPainted='false' - enabled='{isEditable() && isEnabled()}' - onActionPerformed='setSelectedItem(null)'/> + <JToolBar id='toolbarLeft'> + <JButton id='resetButton' onActionPerformed='setSelectedItem(null)'/> </JToolBar> </cell> <cell weightx='1'> <!-- la liste déroulante --> <JComboBox id='combobox' - selectedItem='{getSelectedItem()}' - enabled='{isEnabled()}' - editable='{isEditable()}' - focusable='{isEnabled() && isEditable()}' onFocusGained='hidePopup()' onItemStateChanged='setSelectedItem(combobox.getSelectedItem())'/> </cell> <cell anchor='east' fill='both' insets='0'> <!-- le boutton pour changer le tri --> - <JToolBar floatable='false' borderPainted='false' - visible='{isShowDecorator()}'> + <JToolBar id='toolbarRight'> <JToggleButton id='changeDecorator' - actionIcon='combobox-sort' - toolTipText='beancombobox.action.sort.tip' - focusable='false' - focusPainted='false' onActionPerformed='getHandler().togglePopup()'/> </JToolBar> </cell> Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css 2012-11-21 11:43:40 UTC (rev 2521) @@ -0,0 +1,89 @@ +/* + * #%L + * JAXX :: Widgets + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2012 CodeLutin, Tony Chemit + * %% + * 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% + */ +#indexes { + useToolTipText:true; +} + +#sortGroup { + useToolTipText:true; + selectedValue:{isReverseSort()}; +} + +#popup { + border:{new TitledBorder(_("beanlist.popup.title"))}; +} + +#popupSortLabel { + actionIcon:"bean-sort"; + text:"bean.sort.label"; +} + +#sortUp { + buttonGroup:"sortGroup"; + value:{false}; + actionIcon:"bean-sort-up"; + text:"bean.sort.up"; + selected:{!isReverseSort()}; +} + +#sortDown { + buttonGroup:"sortGroup"; + value:{true}; + actionIcon:"bean-sort-down"; + text:"bean.sort.down"; + selected:{isReverseSort()}; +} + +#label { + opaque:false; + text:{SwingUtil.getStringValue(getLabelText())}; +} + +#toolbar { + floatable:false; + borderPainted:false; +} + +#resetSelection { + actionIcon:"combobox-reset"; + toolTipText:"beanlist.action.reset.tip"; + focusable:false; + focusPainted:false; + visible:{isShowReset()}; + enabled:{isEnabled() && getList().getSelectedValue() != null}; +} + +#changeDecorator { + actionIcon:"combobox-sort"; + toolTipText:"beanlist.action.sort.tip"; + focusable:false; + focusPainted:false; + visible:{isShowDecorator()}; +} + + + + + + Property changes on: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.jaxx 2012-11-20 21:16:20 UTC (rev 2520) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.jaxx 2012-11-21 11:43:40 UTC (rev 2521) @@ -55,11 +55,10 @@ <java.util.List id='data' genericType='O' javaBean='null'/> <!-- model of sorted property --> - <ButtonGroup id='indexes' useToolTipText='true' + <ButtonGroup id='indexes' onStateChanged='setIndex((Integer)indexes.getSelectedValue())'/> - <ButtonGroup id='sortGroup' useToolTipText='true' - selectedValue='{isReverseSort()}' + <ButtonGroup id='sortGroup' onStateChanged='setReverseSort((Boolean)sortGroup.getSelectedValue())'/> <!-- ui handler --> @@ -75,19 +74,14 @@ <!-- popup to change sorted property--> <JPopupMenu id='popup' - border='{new TitledBorder(_("beanlist.popup.title"))}' onPopupMenuWillBecomeInvisible='getChangeDecorator().setSelected(false)' onPopupMenuCanceled='getChangeDecorator().setSelected(false)'> - <JLabel id='popupSortLabel' actionIcon="bean-sort" text="bean.sort.label"/> + <JLabel id='popupSortLabel'/> - <JRadioButtonMenuItem id='sortUp' buttonGroup="sortGroup" value='{false}' - actionIcon="bean-sort-up" text='bean.sort.up' - selected='{!isReverseSort()}'/> + <JRadioButtonMenuItem id='sortUp'/> - <JRadioButtonMenuItem id='sortDown' buttonGroup="sortGroup" value='{true}' - actionIcon="bean-sort-down" text='bean.sort.down' - selected='{isReverseSort()}'/> + <JRadioButtonMenuItem id='sortDown'/> <JSeparator id='popupSeparator'/> <JLabel id='popupLabel'/> @@ -109,29 +103,16 @@ ]]> </script> - <JLabel id="label" constraints='BorderLayout.CENTER' opaque='false' - text='{SwingUtil.getStringValue(getLabelText())}'/> + <JLabel id="label" constraints='BorderLayout.CENTER'/> - <JToolBar floatable='false' borderPainted='false' - constraints='BorderLayout.EAST'> + <JToolBar id='toolbar' constraints='BorderLayout.EAST'> <!-- le boutton pour reinitialiser la valeur sélectionnée --> <JButton id='resetSelection' - actionIcon='combobox-reset' - toolTipText='beanlist.action.reset.tip' - focusable='false' - focusPainted='false' - visible='{isShowReset()}' - enabled='{isEnabled() && getList().getSelectedValue() != null}' onActionPerformed='getList().getSelectionModel().clearSelection()'/> <!-- le boutton pour changer le tri --> <JToggleButton id='changeDecorator' - actionIcon='combobox-sort' - toolTipText='beanlist.action.sort.tip' - focusable='false' - focusPainted='false' - visible='{isShowDecorator()}' onActionPerformed='getHandler().togglePopup()'/> </JToolBar> </JPanel>