Author: tchemit Date: 2009-11-05 03:25:48 +0100 (Thu, 05 Nov 2009) New Revision: 1631 Added: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx branches/jaxx-2.X/jaxx-widgets/src/main/resources/icons/action-collapse.png branches/jaxx-2.X/jaxx-widgets/src/main/resources/icons/action-expand.png Removed: branches/jaxx-2.X/jaxx-demo/src/main/resources/icons/action-collapse.png branches/jaxx-2.X/jaxx-demo/src/main/resources/icons/action-expand.png Modified: branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties Log: add HidorButton widget, prefer of JXCollapsePanel since it does not works very well out of the JX framework... This widget does not modify any layout Deleted: branches/jaxx-2.X/jaxx-demo/src/main/resources/icons/action-collapse.png =================================================================== (Binary files differ) Deleted: branches/jaxx-2.X/jaxx-demo/src/main/resources/icons/action-expand.png =================================================================== (Binary files differ) Added: branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx (rev 0) +++ branches/jaxx-2.X/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx 2009-11-05 02:25:48 UTC (rev 1631) @@ -0,0 +1,77 @@ +<!-- + +/** + * *##% jaxx-runtime-swing-widget + * Copyright (C) 2008 - 2009 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>. ##%* + */ + +--> +<JToggleButton id='hidor' + icon='{updateIcon(isTargetVisible())}' + toolTipText='{updateToolTipText(isTargetVisible())}' + _collapseIcon='{SwingUtil.createActionIcon("collapse")}' + _expandIcon='{SwingUtil.createActionIcon("expand")}' + _collapseTip='{_("hidor.collapseTip")}' + _expandTip='{_("hidor.expandTip")}' + onActionPerformed='setTargetVisible(!targetVisible)'> + + <!--selected='{updateCollapseIcon(isTargetVisible())}'--> + <Boolean id='targetVisible' javaBean='true'/> + + <script><![CDATA[ +import jaxx.runtime.SwingUtil; + +addPropertyChangeListener("targetVisible", new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (log.isDebugEnabled()) { + log.debug("target visible changed <" + evt.getOldValue() + ":" + evt.getNewValue() + ">"); + } + boolean newValue = (Boolean) evt.getNewValue(); + if (target != null) { + target.setVisible(newValue); + }; + } +}); + +protected JComponent target; + +public JComponent getTarget() { + return target; +} + +public void setTarget(JComponent target) { + JComponent oldValue = this.target; + this.target = target; + firePropertyChange("target", oldValue, target); +} + +protected Icon updateIcon(boolean c) { + String key = c ? "collapseIcon" : "expandIcon"; + Icon i = (Icon) getClientProperty(key); + return i; +} + +protected String updateToolTipText(boolean c) { + String key = c ? "collapseTip" : "expandTip"; + String i = (String) getClientProperty(key); + return i; +} +]]> + </script> +</JToggleButton> Modified: branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties 2009-11-05 02:22:45 UTC (rev 1630) +++ branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties 2009-11-05 02:25:48 UTC (rev 1631) @@ -46,6 +46,8 @@ errorUI.action.close=Close errorUI.message=An error wad detected... errorUI.title=Error... +hidor.collapseTip=Hide +hidor.expandTip=Show i18neditor.empty.locales=< No locale to select > i18neditor.popup.title=Change language i18neditor.selected=Selected language \: %1$s Modified: branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties =================================================================== --- branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties 2009-11-05 02:22:45 UTC (rev 1630) +++ branches/jaxx-2.X/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties 2009-11-05 02:25:48 UTC (rev 1631) @@ -47,6 +47,9 @@ errorUI.action.close=Fermer errorUI.message=Une erreur est survenue \! errorUI.title=Erreur... +hidor.collapseTip=Voir +hidor.expandTip= +hidor.showTip=Cacher i18neditor.empty.locales=< Aucune locale \u00E0 s\u00E9lectionner > i18neditor.popup.title=Changer de langue i18neditor.selected=Langue actuellement utilis\u00E9e \: %1$s Copied: branches/jaxx-2.X/jaxx-widgets/src/main/resources/icons/action-collapse.png (from rev 1626, branches/jaxx-2.X/jaxx-demo/src/main/resources/icons/action-collapse.png) =================================================================== (Binary files differ) Property changes on: branches/jaxx-2.X/jaxx-widgets/src/main/resources/icons/action-collapse.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Copied: branches/jaxx-2.X/jaxx-widgets/src/main/resources/icons/action-expand.png (from rev 1626, branches/jaxx-2.X/jaxx-demo/src/main/resources/icons/action-expand.png) =================================================================== (Binary files differ) Property changes on: branches/jaxx-2.X/jaxx-widgets/src/main/resources/icons/action-expand.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream
participants (1)
-
tchemit@users.nuiton.org