This is an automated email from the git hooks/post-receive script. New commit to branch feature/1187 in repository lima. See http://git.chorem.org/lima.git commit 47dacdc28e704cc6ad3722a197adf1a14360e22f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Fri Mar 20 17:15:42 2015 +0100 refs #1187 : account popups --- .../org/chorem/lima/enums/AccountsChartEnum.java | 24 ++++++-- .../org/chorem/lima/ui/account/AccountForm.css | 2 + .../org/chorem/lima/ui/account/AccountForm.jaxx | 20 +++---- .../chorem/lima/ui/account/AccountImportForm.css | 39 ++++--------- .../chorem/lima/ui/account/AccountImportForm.jaxx | 61 +++++++-------------- .../chorem/lima/ui/account/AccountViewHandler.java | 2 +- .../chorem/lima/ui/account/UpdateAccountForm.css | 2 + .../chorem/lima/ui/account/UpdateAccountForm.jaxx | 17 +++--- .../resources/i18n/lima-swing_fr_FR.properties | 10 ++-- .../src/main/resources/icons/action-cancel.png | Bin 0 -> 587 bytes lima-swing/src/main/resources/icons/action-ok.png | Bin 0 -> 537 bytes 11 files changed, 78 insertions(+), 99 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java b/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java index 4ec0a32..cab2b65 100644 --- a/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java +++ b/lima-swing/src/main/java/org/chorem/lima/enums/AccountsChartEnum.java @@ -22,16 +22,27 @@ package org.chorem.lima.enums; +import org.chorem.lima.beans.Labeled; + import java.net.URL; -public enum AccountsChartEnum { +import static org.nuiton.i18n.I18n.t; + +public enum AccountsChartEnum implements Labeled { + + BASE("pcg_base.csv", t("lima.chart.accounts.base")), + SHORTENED("pcg_shortened.csv", t("lima.chart.accounts.shortened")), + DEVELOPED("pcg_developed.csv", t("lima.chart.accounts.developed")), + IMPORT("", t("lima.chart.accounts.import.csv")), + IMPORT_EBP("", t("lima.chart.accounts.import.ebp")); - IMPORT(""), IMPORT_EBP(""), SHORTENED("pcg_shortened.csv"), BASE("pcg_base.csv"), DEVELOPED("pcg_developed.csv"); + protected String filePath; - private final String filePath; + protected String label; - AccountsChartEnum(String filePath) { + AccountsChartEnum(String filePath, String label) { this.filePath = filePath; + this.label = label; } public URL getDefaultFileURL() { @@ -39,4 +50,9 @@ public enum AccountsChartEnum { return url; } + public String getLabel() { + return label; + } + + } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.css b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.css index dd784d5..99db39a 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.css @@ -43,8 +43,10 @@ #cancel { text : "lima.cancel"; + actionIcon : cancel; } #ok { text : "lima.ok"; + actionIcon : ok; } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx index cc0b830..f6a2871 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountForm.jaxx @@ -23,6 +23,7 @@ <JDialog id="accountFormDailog" modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" + layout="{new BorderLayout()}" onWindowClosing="dispose()"> <import> @@ -40,7 +41,7 @@ ]]> </script> - <Table> + <Table constraints="BorderLayout.CENTER"> <row> <cell fill="horizontal"> @@ -64,15 +65,12 @@ onRemoveUpdate='account.setLabel(descriptionTextField.getText())'/> </cell> </row> - <row> - <cell columns="2"> - <JPanel layout='{new GridLayout(1,0)}'> - <JButton id="cancel" - onActionPerformed="dispose()"/> - <JButton id="ok" - onActionPerformed="handler.addAccount(this)"/> - </JPanel> - </cell> - </row> </Table> + <JPanel constraints="BorderLayout.SOUTH" + layout='{new GridLayout(1,0)}'> + <JButton id="cancel" + onActionPerformed="dispose()"/> + <JButton id="ok" + onActionPerformed="handler.addAccount(this)"/> + </JPanel> </JDialog> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.css b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.css index ddaf141..b49f4c6 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.css @@ -20,48 +20,29 @@ * #L% */ #accountImportDialog { - title : "lima.account.import" + title : "lima.account.import"; } #description { - text : "lima.account.import.description" + text : "lima.account.import.description"; + border : {BorderFactory.createEmptyBorder(6, 6, 6, 6)}; } -#shortened { - text : "lima.chart.accounts.shortened"; - value : "{AccountsChartEnum.SHORTENED}"; - buttonGroup : buttonGroup; - selected : true; +#chartAccountLabel { + text : "lima.chart.accounts"; } -#accountsBase { - text : "lima.chart.accounts.base"; - value : "{AccountsChartEnum.BASE}"; - buttonGroup : buttonGroup; -} - -#developed { - text : "lima.chart.accounts.developed"; - value : "{AccountsChartEnum.DEVELOPED}"; - buttonGroup : buttonGroup; -} - -#importcsv { - text : "lima.chart.accounts.import.csv"; - value : "{AccountsChartEnum.IMPORT}"; - buttonGroup : buttonGroup; -} - -#importebp { - text : "lima.chart.accounts.import.ebp"; - value : "{AccountsChartEnum.IMPORT_EBP}"; - buttonGroup : buttonGroup; +#chartAccountCombo { + model : {new DefaultComboBoxModel(AccountsChartEnum.values())}; + renderer : {new LabelListCellRenderer()}; } #cancel { text : "lima.cancel"; + actionIcon : cancel; } #ok { text : "lima.ok"; + actionIcon : ok; } \ No newline at end of file diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx index 8df4aa2..df08eec 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountImportForm.jaxx @@ -22,10 +22,13 @@ <JDialog id="accountImportDialog" modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" + layout="{new BorderLayout()}" onWindowClosing="performCancel();"> <import> org.chorem.lima.enums.AccountsChartEnum + javax.swing.DefaultComboBoxModel + org.chorem.lima.ui.common.LabelListCellRenderer </import> <javax.swing.ButtonGroup id="buttonGroup" /> @@ -35,58 +38,32 @@ <![CDATA[ getRootPane().setDefaultButton(ok); protected void performCancel() { - buttonGroup.setSelectedValue(null); + chartAccountCombo.setSelectedItem(null); dispose(); } ]]> </script> - <Table> + <JLabel constraints="BorderLayout.NORTH" + id="description"/> + + <Table constraints="BorderLayout.CENTER"> <row> <cell> - <JLabel id="description"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JRadioButton id="shortened"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JRadioButton id="accountsBase"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JRadioButton id="developed"/> + <JLabel id="chartAccountLabel"/> </cell> - </row> - <row> - <cell anchor="west"> - <JRadioButton id="importcsv"/> - </cell> - </row> - <row> - <cell anchor="west"> - <JRadioButton id="importebp"/> - </cell> - </row> - <row> <cell> - <Table> - <row> - <cell fill="none"> - <JButton id="cancel" - onActionPerformed="performCancel()"/> - </cell> - <cell fill="none"> - <JButton id="ok" - onActionPerformed="dispose()"/> - </cell> - </row> - </Table> + <JComboBox id="chartAccountCombo"/> </cell> </row> </Table> + + <JPanel constraints="BorderLayout.SOUTH" + layout='{new GridLayout(1,0)}'> + <JButton id="cancel" + onActionPerformed="performCancel()"/> + <JButton id="ok" + onActionPerformed="dispose()"/> + </JPanel> + </JDialog> diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java index 2ccad1a..9dc3d91 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java @@ -461,7 +461,7 @@ public class AccountViewHandler implements ServiceListener { form.setLocationRelativeTo(view); form.setVisible(true); - Object value = form.getButtonGroup().getSelectedValue(); + Object value = form.getChartAccountCombo().getSelectedItem(); // if action confirmed if (value != null) { ImportExport importExport = new ImportExport(view); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.css b/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.css index 0e0a832..fe0797f 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.css +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.css @@ -44,8 +44,10 @@ #cancel { text : "lima.cancel"; + actionIcon : cancel; } #ok { text : "lima.ok"; + actionIcon : ok; } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx b/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx index a98282b..a782014 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx +++ b/lima-swing/src/main/java/org/chorem/lima/ui/account/UpdateAccountForm.jaxx @@ -22,6 +22,7 @@ <JDialog id="updateAccountFormDialog" modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" + layout="{new BorderLayout()}" onWindowClosing="dispose()"> <import> @@ -40,7 +41,7 @@ ]]> </script> - <Table> + <Table constraints="BorderLayout.CENTER"> <row> <cell fill="horizontal"> @@ -63,13 +64,15 @@ </row> <row> <cell columns="2"> - <JPanel layout='{new GridLayout(1,0)}'> - <JButton id="cancel" - onActionPerformed="dispose()"/> - <JButton id="ok" - onActionPerformed="handler.updateAccount(this)"/> - </JPanel> + </cell> </row> </Table> + <JPanel constraints="BorderLayout.SOUTH" + layout='{new GridLayout(1,0)}'> + <JButton id="cancel" + onActionPerformed="dispose()"/> + <JButton id="ok" + onActionPerformed="handler.updateAccount(this)"/> + </JPanel> </JDialog> 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 73550e7..0052262 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 @@ -20,11 +20,11 @@ lima.action.commandline.help=Afficher l'aide en console lima.balance=Équilibrer lima.cancel=Annuler lima.chart.accounts=Plan comptable -lima.chart.accounts.base=Plan comptable de base -lima.chart.accounts.developed=Plan comptable développé -lima.chart.accounts.import.csv=Plan comptable personnalisé au format CSV -lima.chart.accounts.import.ebp=Plan comptable personnalisé au format EBP -lima.chart.accounts.shortened=Plan comptable abrégé +lima.chart.accounts.base=Standard +lima.chart.accounts.developed=Développé +lima.chart.accounts.import.csv=Personnalisé au format CSV +lima.chart.accounts.import.ebp=Personnalisé au format EBP +lima.chart.accounts.shortened=Abrégé lima.config.category.directories=Répertoires lima.config.category.directories.description=Répertoires utilisés par Lima lima.config.category.other=Autre diff --git a/lima-swing/src/main/resources/icons/action-cancel.png b/lima-swing/src/main/resources/icons/action-cancel.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/lima-swing/src/main/resources/icons/action-cancel.png differ diff --git a/lima-swing/src/main/resources/icons/action-ok.png b/lima-swing/src/main/resources/icons/action-ok.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/lima-swing/src/main/resources/icons/action-ok.png differ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.