This is an automated email from the git hooks/post-receive script. New commit to annotated tag v2.0.0-beta-1 in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit db92c1700d5fa2005818e18aa16a5c858947cf66 Author: Tony Chemit <chemit@codelutin.com> Date: Thu Nov 5 02:25:48 2009 +0000 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 --- .../main/java/jaxx/runtime/swing/HidorButton.jaxx | 77 +++++++++++++++++++++ .../resources/i18n/jaxx-widgets-en_GB.properties | 2 + .../resources/i18n/jaxx-widgets-fr_FR.properties | 3 + .../src/main/resources/icons/action-collapse.png | Bin .../src/main/resources/icons/action-expand.png | Bin 5 files changed, 82 insertions(+) diff --git a/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx b/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx new file mode 100644 index 0000000..98d2e64 --- /dev/null +++ b/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx @@ -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> diff --git a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties index 5430ac8..3560d78 100644 --- a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties +++ b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties @@ -46,6 +46,8 @@ entitycombobox.unknown.type=Object of unkown type 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 diff --git a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties index 4cc23a4..2a1ce17 100644 --- a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties +++ b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties @@ -47,6 +47,9 @@ entitycombobox.unknown.type=Objet de type inconnu 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 diff --git a/jaxx-demo/src/main/resources/icons/action-collapse.png b/jaxx-widgets/src/main/resources/icons/action-collapse.png similarity index 100% rename from jaxx-demo/src/main/resources/icons/action-collapse.png rename to jaxx-widgets/src/main/resources/icons/action-collapse.png diff --git a/jaxx-demo/src/main/resources/icons/action-expand.png b/jaxx-widgets/src/main/resources/icons/action-expand.png similarity index 100% rename from jaxx-demo/src/main/resources/icons/action-expand.png rename to jaxx-widgets/src/main/resources/icons/action-expand.png -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.