This is an automated email from the git hooks/post-receive script. New commit to branch feature/1231 in repository lima. See http://git.chorem.org/lima.git commit ad47ca1811a5191b47e6e81cf4819cce4118551d Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu May 28 17:15:10 2015 +0200 fixes #1231 : déplacement débit, crédit et solde. --- .../org/chorem/lima/ui/lettering/LetteringView.css | 34 +++--------------- .../chorem/lima/ui/lettering/LetteringView.jaxx | 42 ++++++++-------------- .../lima/ui/lettering/LetteringViewHandler.java | 30 +++++++++------- .../resources/i18n/lima-swing_en_GB.properties | 2 +- .../resources/i18n/lima-swing_fr_FR.properties | 4 +-- 5 files changed, 39 insertions(+), 73 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css index 919c5b9..7add6a3 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.css @@ -86,36 +86,12 @@ actionIcon : "refresh"; } -#debitLabel { - text : "lima.lettering.selection.debit"; - labelFor : {debitTextField}; -} - -#debitTextField { - enabled : false; - focusable : false; -} - -#creditLabel { - text : "lima.lettering.selection.credit"; - labelFor : {creditTextField}; -} - -#creditTextField { - enabled : false; - focusable : false; -} - -#soldLabel { - text : "lima.lettering.selection.sold"; - labelFor : {soldTextField}; -} - -#soldTextField { - enabled : false; - focusable : false; -} #table { sortable : false; rowHeight : 22; } + +#balanceStatusLabel { + horizontalTextPosition:{JLabel.RIGHT}; + border: {BorderFactory.createEmptyBorder(0, 0, 0, 20)} +} diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx index 7b7d935..c7676b4 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx @@ -91,33 +91,19 @@ onActionPerformed="handler.updateAllEntries()"/> </JToolBar> - <JPanel constraints="BorderLayout.CENTER" - layout="{new BorderLayout()}"> - <JToolBar styleClass="toolbar" - constraints="BorderLayout.PAGE_START"> - <JLabel id="debitLabel"/> - <JFormattedTextField id="debitTextField"/> - - <JToolBar.Separator/> - - <JLabel id="creditLabel"/> - <JTextField id="creditTextField"/> - - <JToolBar.Separator/> - - <JLabel id="soldLabel"/> - <JTextField id="soldTextField"/> - - </JToolBar> - <JScrollPane constraints="BorderLayout.CENTER"> - <LetteringTableModel id="tableModel"/> - <LettringSelectionModel id='letteringSelectionModel' constructorParams='tableModel' - onValueChanged="handler.balanceAndActions()"/> - - <LetteringTable id="table" - constructorParams="handler" - model="{tableModel}" - selectionModel="{letteringSelectionModel}"/> - </JScrollPane> + <JScrollPane constraints="BorderLayout.CENTER"> + <LetteringTableModel id="tableModel"/> + <LettringSelectionModel id='letteringSelectionModel' constructorParams='tableModel' + onValueChanged="handler.balanceAndActions()"/> + + <LetteringTable id="table" + constructorParams="handler" + model="{tableModel}" + selectionModel="{letteringSelectionModel}"/> + </JScrollPane> + + <JPanel constraints="BorderLayout.SOUTH" layout="{new BorderLayout()}"> + <JLabel id='balanceStatusLabel' constraints="BorderLayout.EAST"/> </JPanel> + </JPanel> \ No newline at end of file diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java index ab032dd..93151a8 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java @@ -30,6 +30,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.beans.LetteringFilterImpl; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; @@ -42,11 +43,15 @@ import org.chorem.lima.entity.Account; import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.util.BigDecimalToString; import org.chorem.lima.util.ErrorHelper; -import javax.swing.*; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; @@ -121,37 +126,38 @@ public class LetteringViewHandler{ editModel.addPropertyChangeListener(LetteringEditModel.PROPERTY_DEBIT, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - BigDecimal debit = (BigDecimal) evt.getNewValue(); - String text = BigDecimalToString.format(debit); - view.getDebitTextField().setText(text); + updateSoldStatus(); } }); editModel.addPropertyChangeListener(LetteringEditModel.PROPERTY_CREDIT, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - BigDecimal credit = (BigDecimal) evt.getNewValue(); - String text = BigDecimalToString.format(credit); - view.getCreditTextField().setText(text); + updateSoldStatus(); } }); editModel.addPropertyChangeListener(LetteringEditModel.PROPERTY_SOLD, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - BigDecimal sold = (BigDecimal) evt.getNewValue(); - String text = BigDecimalToString.format(sold); - view.getSoldTextField().setText(text); + updateSoldStatus(); } }); initializationComplete = true; - + updateSoldStatus(); updateAllEntries(); } + public void updateSoldStatus() { + view.getBalanceStatusLabel().setText(t("lima.lettering.balanceStatus", + BigDecimalToString.format(editModel.getDebit()), + BigDecimalToString.format(editModel.getCredit()), + BigDecimalToString.format(editModel.getSold()))); + } + protected void initShortCuts() { InputMap inputMap= view.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index e714505..1f286ea 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -1,4 +1,3 @@ -blima.config.documentReport.generalEntrybook.generalEntryBookEntryModelPath.description= lima.account=Account lima.account.add=Add account (Ctrl+A) lima.account.add.error.InvalidAccountNumber=Invalid account number\:%1$s @@ -405,6 +404,7 @@ lima.lettering.account=Accounts lima.lettering.account.aAll=All lima.lettering.account.back=← lima.lettering.account.next=→ +lima.lettering.balanceStatus= lima.lettering.checkAll=All lima.lettering.checkLettredEntry=Lettered lima.lettering.checkNoLettredEntry=Not lettered diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index 1045050..5de15c6 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -424,6 +424,7 @@ lima.lettering.account=Comptes lima.lettering.account.aAll=TOUS lima.lettering.account.back=← lima.lettering.account.next=→ +lima.lettering.balanceStatus=<html>Débit\: <b>%s</b> - Crédit\: <b>%s</b> - Solde\: <b>%s</b> lima.lettering.checkAll=Toutes lima.lettering.checkLettredEntry=Lettrées lima.lettering.checkNoLettredEntry=Non-lettrées @@ -436,9 +437,6 @@ lima.lettering.period.end=A lima.lettering.refresh=Rafraîchir (F5) lima.lettering.roundAndCreateEntry.error.lockedEntryBook=Impossible de modifier le lettrage d'une entré car le jounal %2$s (%1$s) est cloturé pour la période du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY. lima.lettering.roundAndCreateEntry.error.lockedFinancialPeriod=Impossible de modifier le lettrage d'une entré car la période fiscale du %3$te %3$tB %3$tY au %4$te %4$tB %4$tY est cloturée. -lima.lettering.selection.credit=Crédit -lima.lettering.selection.debit=Débit -lima.lettering.selection.sold=Solde lima.lettering.unLettered=Délettrer (Suppr) lima.lookAndFeel.nimbus.warning=Le look and feel nymbus n'a pas été trouvé lima.message.help.usage=Options (set with --option <key> <value>\: -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.