Author: Bavencoff Date: 2013-06-27 15:37:16 +0200 (Thu, 27 Jun 2013) New Revision: 3690 Url: http://chorem.org/projects/lima/repository/revisions/3690 Log: Suppression du code mort suite ?\195?\160 la modification de la recherche de transaction Removed: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchComboBox.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,99 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.entity.Account; -import org.chorem.lima.ui.combobox.AccountComboBoxModel; -import org.chorem.lima.ui.common.AccountListRenderer; -import org.chorem.lima.util.AccountToString; -import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator; - -import javax.swing.JComboBox; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -public class AccountSearchComboBox extends JComboBox implements KeyListener { - - private static final long serialVersionUID = 1L; - - private static final Log log = - LogFactory.getLog(AccountSearchComboBox.class); - - protected FinancialTransactionSearchViewHandler handler; - - public AccountSearchComboBox(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - AccountComboBoxModel accountComboBoxModel = new AccountComboBoxModel(); - AccountListRenderer accountRenderer = new AccountListRenderer(); - setModel(accountComboBoxModel); - setRenderer(accountRenderer); - setEditable(true); - AutoCompleteDecorator.decorate(this, AccountToString.getInstance()); - getEditor().getEditorComponent().addKeyListener(this); - addActionListener(this); - } - - - @Override - public void actionPerformed(ActionEvent e) { - Object object = getSelectedItem(); - if (object instanceof Account) { - handler.setAccount((Account) getSelectedItem()); - } - } - - @Override - public void keyPressed(KeyEvent e) { - - } - - @Override - public void keyReleased(KeyEvent e) { - Object object = getSelectedItem(); - if (object instanceof Account) { - Account account = (Account) getSelectedItem(); - //to prevent useless call to service - if (!account.equals(handler.getAccount())) { - handler.setAccount(account); - } - - } - - // delegate popup list menu - if (e.getKeyChar() == KeyEvent.VK_ENTER) { - firePopupMenuCanceled(); - } - } - - @Override - public void keyTyped(KeyEvent e) { - - } - -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AccountSearchPanel.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,96 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.chorem.lima.entity.Account; -import org.chorem.lima.enums.ComboBoxAccountsEnum; - -import javax.swing.JPanel; -import javax.swing.JTextField; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -import static org.nuiton.i18n.I18n._; - -public class AccountSearchPanel extends JPanel { - - protected FinancialTransactionSearchViewHandler handler; - - public AccountSearchPanel(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - } - - public void refresh(ComboBoxAccountsEnum comboBoxAccountsEnum) { - - switch (comboBoxAccountsEnum) { - case ALL: - handler.setAccount(null); - handler.refresh(); - removeAll(); - break; - - case ACCOUNT: - AccountSearchComboBox accountComboBox = new AccountSearchComboBox(handler); - handler.setAccount((Account) accountComboBox.getSelectedItem()); - handler.refresh(); - removeAll(); - add(accountComboBox); - break; - - case ACCOUNT_LIST: - final JTextField accountsList = new JTextField(16); - accountsList.setMinimumSize(accountsList.getPreferredSize()); - accountsList.setToolTipText(_("lima.tooltip.filter")); - KeyListener accountsListKeyListener = new KeyListener() { - - @Override - public void keyTyped(KeyEvent e) { - } - - @Override - public void keyReleased(KeyEvent e) { - String accounts = accountsList.getText(); - //to prevent useless call to service - if (!accounts.equals(handler.getAccountsList())) { - handler.setAccountsList(accounts); - } - } - - @Override - public void keyPressed(KeyEvent e) { - } - }; - accountsList.addKeyListener(accountsListKeyListener); - handler.setAccountsList(accountsList.getText()); - handler.setAccount(null); - removeAll(); - add(accountsList); - break; - } - - } - -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/AmountSearchPanel.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,108 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.chorem.lima.enums.ComboBoxOperatorsEnum; - -import javax.swing.JPanel; -import javax.swing.JTextField; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -public class AmountSearchPanel extends JPanel { - - protected FinancialTransactionSearchViewHandler handler; - - public AmountSearchPanel(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - refresh(ComboBoxOperatorsEnum.EQUAL); - } - - static final long serialVersionUID = 1L; - - public void refresh(ComboBoxOperatorsEnum enums) { - - final JTextField amountTextField = new JTextField(16); - amountTextField.setMinimumSize(amountTextField.getPreferredSize()); - KeyListener amountKeyListener = new KeyListener() { - - @Override - public void keyTyped(KeyEvent e) { - } - - @Override - public void keyReleased(KeyEvent e) { - String amount = amountTextField.getText(); - //to prevent useless call to service - if (!amount.equals(handler.getAmount())) { - handler.setAmount(amount); - } - } - - @Override - public void keyPressed(KeyEvent e) { - } - }; - amountTextField.addKeyListener(amountKeyListener); - handler.setAmount2(""); - handler.setOperator(enums.getSymbol()); - handler.refresh(); - removeAll(); - add(amountTextField); - - switch (enums) { - case INTERVAL: - final JTextField amount2TextField = new JTextField(16); - amount2TextField.setMinimumSize(amount2TextField.getPreferredSize()); - KeyListener amount2KeyListener = new KeyListener() { - - @Override - public void keyTyped(KeyEvent e) { - } - - @Override - public void keyReleased(KeyEvent e) { - - String amount2 = amount2TextField.getText(); - //to prevent useless call to service - if (!amount2.equals(handler.getAmount2())) { - handler.setAmount2(amount2); - } - } - - @Override - public void keyPressed(KeyEvent e) { - } - }; - amount2TextField.addKeyListener(amount2KeyListener); - handler.setAmount(""); - add(amount2TextField); - break; - } - amountTextField.setText(handler.getAmount()); - } - -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchComboBox.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,96 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.entity.EntryBook; -import org.chorem.lima.ui.LimaRendererUtil; -import org.chorem.lima.ui.combobox.EntryBookComboBoxModel; -import org.chorem.lima.util.EntryBookToString; -import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator; - -import javax.swing.JComboBox; -import javax.swing.ListCellRenderer; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -public class EntryBookSearchComboBox extends JComboBox implements KeyListener { - - private static final long serialVersionUID = 1L; - - private static final Log log = - LogFactory.getLog(EntryBookSearchComboBox.class); - - protected FinancialTransactionSearchViewHandler handler; - - public EntryBookSearchComboBox(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - EntryBookComboBoxModel entryBookComboBoxModel = new EntryBookComboBoxModel(); - ListCellRenderer renderer = - LimaRendererUtil.newDecoratorListCellRenderer(EntryBook.class); - setModel(entryBookComboBoxModel); - setRenderer(renderer); - setEditable(true); - AutoCompleteDecorator.decorate(this, EntryBookToString.getInstance()); - getEditor().getEditorComponent().addKeyListener(this); - addActionListener(this); - } - - - @Override - public void actionPerformed(ActionEvent e) { - Object object = getSelectedItem(); - if (object instanceof EntryBook) { - handler.setEntryBook((EntryBook) getSelectedItem()); - } - } - - - @Override - public void keyPressed(KeyEvent e) { - - } - - @Override - public void keyReleased(KeyEvent e) { - Object object = getSelectedItem(); - if (object instanceof EntryBook) { - handler.setEntryBook((EntryBook) getSelectedItem()); - } - // delegate popup list menu - if (e.getKeyChar() == KeyEvent.VK_ENTER) { - firePopupMenuCanceled(); - } - } - - @Override - public void keyTyped(KeyEvent e) { - - } - -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/EntryBookSearchPanel.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,58 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.chorem.lima.enums.ComboBoxEntryBooksEnum; - -import javax.swing.JPanel; - -public class EntryBookSearchPanel extends JPanel { - - protected FinancialTransactionSearchViewHandler handler; - - public EntryBookSearchPanel(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - } - - public void refresh(ComboBoxEntryBooksEnum enums) { - - switch (enums) { - case SELECT_ONE: - EntryBookSearchComboBox entryBookSearchComboBox = new EntryBookSearchComboBox(handler); - handler.setEntryBook(null); - removeAll(); - add(entryBookSearchComboBox); - break; - - case ALL: - handler.setEntryBook(null); - removeAll(); - break; - } - - } - -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionPeriodSearchPanel.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,190 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.apache.commons.lang3.time.DateUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.entity.FinancialPeriod; -import org.chorem.lima.entity.FiscalPeriod; -import org.chorem.lima.enums.ComboBoxPeriodEnum; -import org.chorem.lima.ui.LimaRendererUtil; -import org.chorem.lima.ui.combobox.FinancialPeriodComboBoxModel; -import org.chorem.lima.ui.combobox.FiscalPeriodComboBoxModel; -import org.jdesktop.swingx.JXDatePicker; - -import javax.swing.JComboBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.ListCellRenderer; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.Calendar; -import java.util.Date; - -import static org.nuiton.i18n.I18n._; - -public class FinancialTransactionPeriodSearchPanel extends JPanel { - - private static final Log log = LogFactory.getLog(FinancialTransactionPeriodSearchPanel.class); - - protected FinancialTransactionSearchViewHandler handler; - - public FinancialTransactionPeriodSearchPanel(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - - //init date - refresh(ComboBoxPeriodEnum.PERIOD); - } - - public void refresh(ComboBoxPeriodEnum comboBoxPeriodEnum) { - - switch (comboBoxPeriodEnum) { - case DATE: - Calendar calendar = Calendar.getInstance(); - Date date = calendar.getTime(); - date = DateUtils.truncate(date, Calendar.DATE); - final JXDatePicker datePicker = new JXDatePicker(date); - PropertyChangeListener datePCListener = new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - handler.setBeginDate(datePicker.getDate()); - handler.setEndDate(datePicker.getDate()); - handler.refresh(); - } - }; - handler.setBeginDate(datePicker.getDate()); - handler.setEndDate(datePicker.getDate()); - handler.refresh(); - datePicker.addPropertyChangeListener(datePCListener); - removeAll(); - add(datePicker); - break; - - case PERIOD: - // get begin date - Calendar calendarBegin = Calendar.getInstance(); - // set begindate to JAN 1 - 0:00.000 of this years - Date beginDate = calendarBegin.getTime(); - beginDate = DateUtils.truncate(beginDate, Calendar.YEAR); - JLabel beginDateLabel = new JLabel(_("lima.common.begindate")); - final JXDatePicker beginDatePicker = new JXDatePicker(beginDate); - PropertyChangeListener beginDatePCListener = new PropertyChangeListener() { - - @Override - public void propertyChange(PropertyChangeEvent evt) { - handler.setBeginDate(beginDatePicker.getDate()); - handler.refresh(); - } - }; - handler.setBeginDate(beginDatePicker.getDate()); - beginDatePicker.addPropertyChangeListener(beginDatePCListener); - - // get end date - Calendar calendarEnd = Calendar.getInstance(); - Date endDate = calendarEnd.getTime(); - JLabel endDateLabel = new JLabel(_("lima.common.enddate")); - final JXDatePicker endDatePicker = new JXDatePicker(endDate); - PropertyChangeListener endDatePCListener = new PropertyChangeListener() { - - @Override - public void propertyChange(PropertyChangeEvent evt) { - handler.setEndDate(endDatePicker.getDate()); - handler.refresh(); - } - }; - handler.setEndDate(endDatePicker.getDate()); - endDatePicker.addPropertyChangeListener(endDatePCListener); - - if (log.isDebugEnabled()) { - log.debug("Begin date : " + beginDate); - log.debug("End date : " + endDate); - } - - handler.refresh(); - - removeAll(); - add(beginDateLabel); - add(beginDatePicker); - add(endDateLabel); - add(endDatePicker); - break; - - case FISCAL_PERIOD: - FiscalPeriodComboBoxModel fiscalModel = new FiscalPeriodComboBoxModel(); - ListCellRenderer renderer = - LimaRendererUtil.newDecoratorListCellRenderer(FiscalPeriod.class); - final JComboBox fiscalPeriod = new JComboBox(fiscalModel); - fiscalPeriod.setRenderer(renderer); - - fiscalPeriod.setEditable(false); - - ActionListener fiscalPeriodActionListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - FiscalPeriod fPeriod = (FiscalPeriod) fiscalPeriod.getSelectedItem(); - handler.setBeginDate(fPeriod.getBeginDate()); - handler.setEndDate(fPeriod.getEndDate()); - handler.refresh(); - if (log.isDebugEnabled()) { - log.debug("Refreshing with this Fiscal period : " + fPeriod.getBeginDate() + " - " + fPeriod.getEndDate()); - } - } - }; - fiscalPeriod.addActionListener(fiscalPeriodActionListener); - removeAll(); - add(fiscalPeriod); - - break; - - case FINANCIAL_PERIOD: - FinancialPeriodComboBoxModel financialModel = new FinancialPeriodComboBoxModel(); - ListCellRenderer rendererFinancialPeriod = - LimaRendererUtil.newDecoratorListCellRenderer(FinancialPeriod.class); - final JComboBox financialPeriod = new JComboBox(financialModel); - financialPeriod.setRenderer(rendererFinancialPeriod); - financialPeriod.setEditable(false); - - ActionListener financialPeriodActionListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - FinancialPeriod fPeriod = (FinancialPeriod) financialPeriod.getSelectedItem(); - handler.setBeginDate(fPeriod.getBeginDate()); - handler.setEndDate(fPeriod.getEndDate()); - handler.refresh(); - } - }; - financialPeriod.addActionListener(financialPeriodActionListener); - removeAll(); - add(financialPeriod); - break; - } - - } - -} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchView.jaxx 2013-06-27 13:37:16 UTC (rev 3690) @@ -45,23 +45,6 @@ javaBean="new FinancialTransactionSearchViewHandler(this)"/> <Boolean id="selectedRow" javaBean="false"/> <Dimension id="fieldSize" javaBean="new java.awt.Dimension()"/> - <!--script> - <![CDATA[ - AccountSearchPanel accountSearchPanel = new AccountSearchPanel(handler); - AmountSearchPanel amountSearchPanel = new AmountSearchPanel(handler); - EntryBookSearchPanel entryBookSearchPanel = new EntryBookSearchPanel(handler); - LetterSearchPanel letterSearchPanel = new LetterSearchPanel(handler); - FinancialTransactionPeriodSearchPanel periodSearchPanel = new FinancialTransactionPeriodSearchPanel(handler); - - void $afterCompleteSetup() { - handler.setAmountWayEnum(FinancialStatementWayEnum.valueOfDescription( - (String) getAmountComboBox().getSelectedItem())); - handler.setOperator(ComboBoxOperatorsEnum.valueOfDescription( - (String) getOperatorComboBox().getSelectedItem()).getSymbol()); - } - - ]]> - </script--> <row> <cell fill="both"> <JToolBar floatable="false"> Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchComboBox.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,104 +0,0 @@ -package org.chorem.lima.ui.financialtransactionsearch; -/* - * #%L - * Lima :: Swing - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.ui.combobox.LetterComboBoxModel; -import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator; -import org.jdesktop.swingx.autocomplete.ObjectToStringConverter; - -import javax.swing.JComboBox; -import java.awt.event.ActionEvent; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -/** - * Date: 13/08/12 - * - * @author mallon <mallon@codelutin.com> - * @since 0.6-alpha-2 - */ -public class LetterSearchComboBox extends JComboBox implements KeyListener { - - private static final long serialVersionUID = 1L; - - protected FinancialTransactionSearchViewHandler handler; - - public LetterSearchComboBox(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - LetterComboBoxModel letterComboBoxModel = new LetterComboBoxModel(); - setModel(letterComboBoxModel); - setEditable(true); - ObjectToStringConverter objectToStringConverter = new ObjectToStringConverter() { - @Override - public String getPreferredStringForItem(Object item) { - String result = null; - if (item != null) { - if (item instanceof String) { - result = item.toString(); - } - } - return result; - } - }; - AutoCompleteDecorator.decorate(this, objectToStringConverter); - getEditor().getEditorComponent().addKeyListener(this); - addActionListener(this); - } - - @Override - public void actionPerformed(ActionEvent e) { - Object object = getSelectedItem(); - if (object instanceof String) { - handler.setLetter((String) getSelectedItem()); - } - } - - @Override - public void keyPressed(KeyEvent e) { - - } - - @Override - public void keyReleased(KeyEvent e) { - Object object = getSelectedItem(); - if (object instanceof String) { - String letter = (String) getSelectedItem(); - //to prevent useless call to service - if (!letter.equals(handler.getLetter())) { - handler.setLetter(letter); - } - - } - - // delegate popup list menu - if (e.getKeyChar() == KeyEvent.VK_ENTER) { - firePopupMenuCanceled(); - } - } - - @Override - public void keyTyped(KeyEvent e) { - - } -} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java 2013-06-27 13:25:12 UTC (rev 3689) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/LetterSearchPanel.java 2013-06-27 13:37:16 UTC (rev 3690) @@ -1,62 +0,0 @@ -/* - * #%L - * Lima Swing - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2012 CodeLutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -package org.chorem.lima.ui.financialtransactionsearch; - -import org.chorem.lima.enums.ComboBoxLetterEnum; - -import javax.swing.JPanel; - -public class LetterSearchPanel extends JPanel { - - /** serialVersionUID. */ - private static final long serialVersionUID = 7682668138031148237L; - - protected FinancialTransactionSearchViewHandler handler; - - public LetterSearchPanel(FinancialTransactionSearchViewHandler handler) { - this.handler = handler; - } - - public void refresh(ComboBoxLetterEnum comboBoxEnum) { - - switch (comboBoxEnum) { - case ALL: - handler.setLetter(null); - handler.refresh(); - removeAll(); - break; - - case SELECT_ONE: - LetterSearchComboBox comboBox = new LetterSearchComboBox(handler); - removeAll(); - add(comboBox); - break; - - } - - } - -}