Author: sbavencoff Date: 2014-09-12 12:09:47 +0200 (Fri, 12 Sep 2014) New Revision: 3915 Url: http://forge.chorem.org/projects/lima/repository/revisions/3915 Log: refs #875 #1043 : EntryBook Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.css trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.css Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.css trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.css =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.css 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.css 2014-09-12 10:09:47 UTC (rev 3915) @@ -10,11 +10,13 @@ #updateButton { toolTipText : "lima.update.shortcut"; actionIcon : "account-edit"; + enabled : "{isSelectedRow()}"; } #removeButton { toolTipText : "lima.remove.shortcut"; actionIcon : "account-remove"; + enabled : "{isSelectedRow()}"; } #importButton { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountView.jaxx 2014-09-12 10:09:47 UTC (rev 3915) @@ -48,12 +48,10 @@ onActionPerformed="handler.addAccount()"/> <JButton id="updateButton" - onActionPerformed="handler.updateAccount()" - enabled="{isSelectedRow()}"/> + onActionPerformed="handler.updateAccount()"/> <JButton id="removeButton" - onActionPerformed="handler.removeAccount()" - enabled="{isSelectedRow()}"/> + onActionPerformed="handler.removeAccount()"/> <JButton id="importButton" onActionPerformed="handler.importAccountsChart()"/> Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.css =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.css (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.css 2014-09-12 10:09:47 UTC (rev 3915) @@ -0,0 +1,30 @@ +#entryBookFormDialog { + title : "lima.entryBook.form"; +} + +#codeLabel { + text : "lima.entryBook.code"; + labelFor : "{codeTextField}"; +} + +#codeTextField { + text : "{getEntryBook().getCode()}"; + enabled : "{isAddState()}"; +} + +#labelLabel { + text : "lima.entryBook.label"; + labelFor : "{labelTextField}"; +} + +#labelTextField{ + text : "{getEntryBook().getLabel()}"; +} + +#cancel { + text : "lima.cancel"; +} + +#ok { + text : "lima.ok"; +} \ No newline at end of file Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookForm.jaxx 2014-09-12 10:09:47 UTC (rev 3915) @@ -22,7 +22,8 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> -<JDialog title="lima.entrybook.entrybooktile" modal="true" +<JDialog id="entryBookFormDialog" + modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" onWindowClosing="performCancel();"> @@ -35,7 +36,7 @@ <script> <![CDATA[ - getRootPane().setDefaultButton(okButton); + getRootPane().setDefaultButton(ok); protected void performCancel() { setEntryBook(null); dispose(); @@ -46,34 +47,33 @@ <Table> <row> <cell> - <JLabel text="lima.entrybook.code"/> + <JLabel id="codeLabel"/> </cell> <cell> - <JTextField id="entryBookCodeField" text="{getEntryBook().getCode()}" enabled='{isAddState()}' /> - <Document javaBean="getEntryBookCodeField().getDocument()" - onInsertUpdate='getEntryBook().setCode(getEntryBookCodeField().getText())' - onRemoveUpdate='getEntryBook().setCode(getEntryBookCodeField().getText())'/> + <JTextField id="codeTextField" /> + <Document javaBean="getCodeTextField().getDocument()" + onInsertUpdate='getEntryBook().setCode(getCodeTextField().getText())' + onRemoveUpdate='getEntryBook().setCode(getCodeTextField().getText())'/> </cell> </row> <row> <cell> - <JLabel text="lima.entrybook.label"/> + <JLabel id="labelLabel"/> </cell> <cell> - <JTextField id="entryBookLabelField" - text="{getEntryBook().getLabel()}"/> - <Document javaBean="getEntryBookLabelField().getDocument()" - onInsertUpdate='getEntryBook().setLabel(getEntryBookLabelField().getText())' - onRemoveUpdate='getEntryBook().setLabel(getEntryBookLabelField().getText())'/> + <JTextField id="labelTextField"/> + <Document javaBean="getLabelTextField().getDocument()" + onInsertUpdate='getEntryBook().setLabel(getLabelTextField().getText())' + onRemoveUpdate='getEntryBook().setLabel(getLabelTextField().getText())'/> </cell> </row> <row> <cell> - <JButton id="cancelButton" text="lima.cancel" + <JButton id="cancel" onActionPerformed="performCancel()"/> </cell> <cell> - <JButton id="okButton" text="lima.ok" + <JButton id="ok" onActionPerformed="dispose()"/> </cell> </row> Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.css 2014-09-12 10:09:47 UTC (rev 3915) @@ -0,0 +1,24 @@ +#entryBookImportForm { + title : "lima.entryBook.import.form"; +} + +#entryBooksDefault { + text : "lima.entryBook.default"; + value : "{EntryBooksChartEnum.DEFAULT}"; + buttonGroup : "{buttonGroup}"; + selected : true; +} + +#entryBooksImport { + text : "lima.entryBook.import"; + value : "{EntryBooksChartEnum.IMPORT}"; + buttonGroup : "{buttonGroup}"; +} + +#cancel { + text : "lima.cancel"; +} + +#ok { + text : "lima.ok"; +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookImportForm.jaxx 2014-09-12 10:09:47 UTC (rev 3915) @@ -22,7 +22,8 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> -<JDialog title="lima.entrybook.importtitle" modal="true" +<JDialog id="entryBookImportForm" + modal="true" defaultCloseOperation="{JDialog.DO_NOTHING_ON_CLOSE}" onWindowClosing="performCancel();"> @@ -35,7 +36,7 @@ <script> <![CDATA[ - getRootPane().setDefaultButton(okButton); + getRootPane().setDefaultButton(ok); protected void performCancel() { buttonGroup.setSelectedValue(null); dispose(); @@ -46,15 +47,10 @@ <Table> <row> <cell> - <JRadioButton text='lima.entrybook.default' - value='{EntryBooksChartEnum.DEFAULT}' - buttonGroup="{buttonGroup}" - selected='true'/> + <JRadioButton id="entryBooksDefault"/> </cell> <cell> - <JRadioButton text='lima.entrybook.import' - value='{EntryBooksChartEnum.IMPORT}' - buttonGroup="{buttonGroup}"/> + <JRadioButton id="entryBooksImport"/> </cell> </row> <row> @@ -62,11 +58,11 @@ <Table> <row> <cell fill="none"> - <JButton text="lima.cancel" + <JButton id="cancel" onActionPerformed="performCancel()"/> </cell> <cell fill="none"> - <JButton id="okButton" text="lima.ok" + <JButton id="ok" onActionPerformed="dispose()"/> </cell> </row> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookTableModel.java 2014-09-12 10:09:47 UTC (rev 3915) @@ -48,13 +48,13 @@ @Override protected void initColumn() { - addColumn(new AbstractColumn<EntryBookTableModel>(String.class, t("lima.entrybook.code"), false) { + addColumn(new AbstractColumn<EntryBookTableModel>(String.class, t("lima.entryBook.code"), false) { @Override public Object getValueAt(int row) { return tableModel.get(row).getCode(); } }); - addColumn(new AbstractColumn<EntryBookTableModel>(String.class, t("lima.entrybook.label"), false) { + addColumn(new AbstractColumn<EntryBookTableModel>(String.class, t("lima.entryBook.label"), false) { @Override public Object getValueAt(int row) { return tableModel.get(row).getLabel(); Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.css =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.css (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.css 2014-09-12 10:09:47 UTC (rev 3915) @@ -0,0 +1,32 @@ +#toolBar { + floatable : false; +} + +#addButton { + toolTipText : "lima.entryBook.add"; + actionIcon : "entryBook-new"; +} + +#updateButton { + toolTipText : "lima.entryBook.update"; + actionIcon : "entryBook-edit"; + enabled : "{isSelectedRow()}"; +} + +#removeButton { + toolTipText : "lima.entryBook.remove"; + actionIcon : "entryBook-remove"; + enabled : "{isSelectedRow()}"; +} + +#importButton { + toolTipText : "lima.importExport.import"; + actionIcon : "entryBook-import"; +} + +#entryBooksTable { + rowHeight : 24; + selectionMode : "{ListSelectionModel.SINGLE_SELECTION}"; + highlighters : "{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(233,233,233))}"; + columnControlVisible : true; +} \ No newline at end of file Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookView.jaxx 2014-09-12 10:09:47 UTC (rev 3915) @@ -23,7 +23,7 @@ #L% --> -<Table> +<JPanel layout="{new BorderLayout()}"> <import> java.awt.Dimension @@ -40,49 +40,29 @@ } ]]></script> - <row> - <cell fill="horizontal"> - <JToolBar floatable="false"> + <JToolBar id="toolBar" + constraints="BorderLayout.PAGE_START"> - <JButton id="addButton" - toolTipText="{ t("lima.entrybook.add") + " (Ctrl+N)"}" - actionIcon='entryBook-new' - onActionPerformed="handler.addEntryBook()"/> + <JButton id="addButton" + onActionPerformed="handler.addEntryBook()"/> - <JButton id="updateButton" - toolTipText="{ t("lima.entrybook.update") + " (Ctrl+M)"}" - actionIcon='entryBook-edit' - onActionPerformed="handler.updateEntryBook()" - enabled="{isSelectedRow()}"/> + <JButton id="updateButton" + onActionPerformed="handler.updateEntryBook()"/> - <JButton id="removeButton" - toolTipText="{ t("lima.entrybook.remove") + " (Del)"}" - actionIcon='entryBook-remove' - onActionPerformed="handler.deleteEntryBook()" - enabled="{isSelectedRow()}"/> + <JButton id="removeButton" + onActionPerformed="handler.deleteEntryBook()"/> - <JButton id="importButton" - actionIcon='entryBook-import' - toolTipText="lima.importExport.import" - onActionPerformed="handler.importEntryBooks()"/> + <JButton id="importButton" + onActionPerformed="handler.importEntryBooks()"/> - </JToolBar> - </cell> - </row> + </JToolBar> - <row> - <cell fill="both" weightx="1" weighty="1"> - <JScrollPane> - <EntryBookTableModel id="entryBookTableModel" /> - <EntryBookTable id="entryBooksTable" rowHeight="24" - constructorParams="getHandler()" - highlighters="{org.jdesktop.swingx.decorator.HighlighterFactory.createSimpleStriping(new java.awt.Color(233,233,233))}" - selectionMode="{ListSelectionModel.SINGLE_SELECTION}" - columnControlVisible="true" - model="{entryBookTableModel}"/> - <ListSelectionModel javaBean="getEntryBooksTable().getSelectionModel()" - onValueChanged="setSelectedRow(entryBooksTable.getSelectedRow() != -1)"/> - </JScrollPane> - </cell> - </row> -</Table> + <JScrollPane constraints="BorderLayout.CENTER"> + <EntryBookTableModel id="entryBookTableModel" /> + <EntryBookTable id="entryBooksTable" rowHeight="24" + constructorParams="getHandler()" + model="{entryBookTableModel}"/> + <ListSelectionModel javaBean="getEntryBooksTable().getSelectionModel()" + onValueChanged="setSelectedRow(entryBooksTable.getSelectedRow() != -1)"/> + </JScrollPane> +</JPanel> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-09-12 10:09:47 UTC (rev 3915) @@ -244,8 +244,8 @@ EntryBook selectedEntryBook = entryBookTableModel.get(selectedRow); int response = JOptionPane.showConfirmDialog(view, - t("lima.entrybook.deletemessage", selectedEntryBook.getLabel()), - t("lima.entrybook.deletetitle"), JOptionPane.YES_NO_OPTION, + t("lima.entryBook.deletemessage", selectedEntryBook.getLabel()), + t("lima.entryBook.deletetitle"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (response == JOptionPane.YES_OPTION) { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/RetainedEarningsEntryBookForm.jaxx 2014-09-12 10:09:47 UTC (rev 3915) @@ -81,7 +81,7 @@ <cell anchor="west"> <JRadioButton id="selectedEntryBook" - text="lima.entrybook" + text="lima.entryBook" selected="true" buttonGroup="EntryBookGroup" onActionPerformed="performNew()"/> @@ -89,7 +89,7 @@ </row> <row> <cell> - <JLabel id="entryBookSelectorLabel" text="lima.entrybook"/> + <JLabel id="entryBookSelectorLabel" text="lima.entryBook"/> </cell> <cell> <org.chorem.lima.ui.combobox.EntryBookComboBoxModel id="modelEntryBookComboBox"/> Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2014-09-12 10:09:47 UTC (rev 3915) @@ -220,26 +220,28 @@ lima.entry.paste.error.lockedEntryBook= lima.entry.paste.error.lockedFinancialPeriod= lima.entry.update.closed.entryBook.error= +lima.entryBook=EntryBook +lima.entryBook.add= lima.entryBook.alreadyExistEntryBookException=An entry book with code %s already exists. +lima.entryBook.code= +lima.entryBook.default= lima.entryBook.delete.used.error=Can't delete entry book %2$s (%1$s) because exist financcial transactions in this entry book. -lima.entryBooks= -lima.entrybook=EntryBook -lima.entrybook.add= -lima.entrybook.code= -lima.entrybook.default= -lima.entrybook.deletemessage= -lima.entrybook.deletetitle= -lima.entrybook.entrybooktile= -lima.entrybook.import= -lima.entrybook.importtitle= -lima.entrybook.label= -lima.entrybook.remove= -lima.entrybook.update= -lima.entrybooks=EntryBooks -lima.entrybooksreports.documentcreationerror=Enable to create document -lima.entrybooksreports.documentcreationfiscalerror=Can't create document on an open fiscal year -lima.entrybooksreports.documentcreationfiscaltitle= -lima.entrybooksreports.listerror=Can't get entries list +lima.entryBook.deletemessage= +lima.entryBook.deletetitle= +lima.entryBook.entrybooktile= +lima.entryBook.form= +lima.entryBook.import= +lima.entryBook.import.form= +lima.entryBook.importtitle= +lima.entryBook.label= +lima.entryBook.remove= +lima.entryBook.remove.shortcut= +lima.entryBook.update= +lima.entryBooks=EntryBooks +lima.entryBooksreports.documentcreationerror=Enable to create document +lima.entryBooksreports.documentcreationfiscalerror=Can't create document on an open fiscal year +lima.entryBooksreports.documentcreationfiscaltitle= +lima.entryBooksreports.listerror=Can't get entries list lima.enum.comboboxaccount.account=Account lima.enum.comboboxaccount.accountlist=Account list lima.enum.comboboxaccount.allaccount=All accounts Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-09-12 09:07:40 UTC (rev 3914) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2014-09-12 10:09:47 UTC (rev 3915) @@ -201,26 +201,25 @@ lima.entry.paste.error.lockedEntryBook=Impossible de copier 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.entry.paste.error.lockedFinancialPeriod=Impossible de copier 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.entry.update.closed.entryBook.error=Impossible de modifier cette 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.entryBook=Journal +lima.entryBook.add=Ajout de journal (Ctrl+A) lima.entryBook.alreadyExistEntryBookException=Un journal avec comme code % existe déjà. +lima.entryBook.code=Code +lima.entryBook.default=Journaux par défault lima.entryBook.delete.used.error=Imposible de supprimer le journal %2$s (%1$s) car Il existe des transactioins sur ce journal. +lima.entryBook.deletemessage=Êtes vous sûr de vouloir supprimer le journal %s ? +lima.entryBook.deletetitle=Suppression de journal +lima.entryBook.form=Journal +lima.entryBook.import=Importer +lima.entryBook.import.form=Import +lima.entryBook.label=Libellé +lima.entryBook.remove=Supprimer (Suppr) +lima.entryBook.update=Modifier (Ctrl+M) lima.entryBooks=Journaux -lima.entrybook=Journal -lima.entrybook.add=Ajout de journal -lima.entrybook.code=Code -lima.entrybook.default=Journaux par défault -lima.entrybook.deletemessage=Êtes vous sûr de vouloir supprimer le journal %s ? -lima.entrybook.deletetitle=Suppression de journal -lima.entrybook.entrybooktile=Journal -lima.entrybook.import=Importer -lima.entrybook.importtitle=Import -lima.entrybook.label=Libellé -lima.entrybook.remove=Supprimer -lima.entrybook.update=Modifier -lima.entrybooks=Journaux -lima.entrybooksreports.documentcreationerror=Erreur lors de la création du document -lima.entrybooksreports.documentcreationfiscalerror=Impossible de créer un document quand la période fiscale est ouverte -lima.entrybooksreports.documentcreationfiscaltitle= -lima.entrybooksreports.listerror=Erreur lors de la récupération des données de la liste +lima.entryBooksreports.documentcreationerror=Erreur lors de la création du document +lima.entryBooksreports.documentcreationfiscalerror=Impossible de créer un document quand la période fiscale est ouverte +lima.entryBooksreports.documentcreationfiscaltitle= +lima.entryBooksreports.listerror=Erreur lors de la récupération des données de la liste lima.enum.comboboxaccount.account=Compte lima.enum.comboboxaccount.accountlist=Liste de comptes lima.enum.comboboxaccount.allaccount=Tous les comptes