Author: mallon Date: 2012-08-01 13:27:51 +0200 (Wed, 01 Aug 2012) New Revision: 3558 Url: http://chorem.org/repositories/revision/lima/3558 Log: Correction des deux editeurs de cellule sur lesquels portent les changements de comportement dans la configuration de Lima. Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2012-08-01 09:07:09 UTC (rev 3557) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2012-08-01 11:27:51 UTC (rev 3558) @@ -429,7 +429,7 @@ LIMA_HOST_ADDRESS("lima.host.address", n_("lima.config.host.adress"), "localhost", String.class, false, false), LIMA_STATE_FILE("lima.state.file", n_("lima.config.state.file"), "${lima.data.dir}/limaState.xml", String.class, false, false), COLOR_SELECTION_FOCUS("colorselectionfocus", _("lima.config.colorselectionfocus"), "#000000", Color.class, false, false), - COMPORTMENT_EDITING_CELL("comportmenteditingcell", n_("lima.config.comportmenteditingcell"), "ALL", comportmentEditingCellEnum.class, false, false); + COMPORTMENT_EDITING_CELL("comportmenteditingcell", _("lima.config.comportmenteditingcell"), "ALL", comportmentEditingCellEnum.class, false, false); public enum comportmentEditingCellEnum {ALL, NOTHING}; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-08-01 09:07:09 UTC (rev 3557) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-08-01 11:27:51 UTC (rev 3558) @@ -206,6 +206,8 @@ helper.addOption(LimaConfig.Option.SCALE); helper.addOption(LimaConfig.Option.THOUSAND_SEPARATOR); helper.addOption(LimaConfig.Option.CURRENCY); + /*Pas de 'callBack' sur le changement de comportement lors de l'édition d'une cellule, + * car les deux éditeurs concernés rappellent la config dans un listener ('focusGained')*/ helper.addOption(LimaConfig.Option.COMPORTMENT_EDITING_CELL); helper.addOption(colorSelectionFocus); helper.setOptionCallBack(colorSelectionFocus.key); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2012-08-01 09:07:09 UTC (rev 3557) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2012-08-01 11:27:51 UTC (rev 3558) @@ -38,7 +38,6 @@ public class BigDecimalTableCellEditor extends NumberCellEditor<BigDecimal>{ protected int row; - protected String comportmentEditingCell; public BigDecimalTableCellEditor() { super(BigDecimal.class, false); @@ -46,7 +45,7 @@ @Override public void focusGained(FocusEvent e) { - comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); + String comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); JTextField numberEditorTextField = super.getNumberEditor().getTextField(); if (comportmentEditingCell.equals("ALL")) { numberEditorTextField.selectAll(); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java 2012-08-01 09:07:09 UTC (rev 3557) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java 2012-08-01 11:27:51 UTC (rev 3558) @@ -51,7 +51,7 @@ private static final long serialVersionUID = 1L; private final JXDatePicker datePicker; - protected String comportmentEditingCell; + //protected String comportmentEditingCell; //used to tell if the user has pressed a key private Date date; @@ -61,7 +61,7 @@ datePicker = new JXDatePicker(LimaContext.getContext().getConfig().getLocale()); datePicker.getEditor().addFocusListener(this); datePicker.getEditor().addAncestorListener(this); - comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); + //comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); } @Override @@ -109,6 +109,7 @@ SwingUtilities.invokeLater(new Runnable() { public void run() { JFormattedTextField dateFormattedTextField = datePicker.getEditor(); + String comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); if (comportmentEditingCell.equals("ALL")) { dateFormattedTextField.selectAll(); } else { @@ -119,15 +120,6 @@ }); } - /** Listeners */ - /*public void focusGained(FocusEvent e) { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - datePicker.getEditor().selectAll(); - } - }); - }*/ - public void focusLost(FocusEvent e) { }