Author: vsalaun Date: 2011-05-12 10:15:34 +0200 (Thu, 12 May 2011) New Revision: 3104 Url: http://chorem.org/repositories/revision/lima/3104 Log: #267 ajout des options pour l'affichage des objets type BigDecimal Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2011-05-06 16:08:00 UTC (rev 3103) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2011-05-12 08:15:34 UTC (rev 3104) @@ -69,7 +69,7 @@ * @return copyright text */ public String getCopyrightText() { - return "Version " + getVersion() + " Codelutin @ 2008-2010"; + return "Version " + getVersion() + " Codelutin @ 2008-2011"; } /** @@ -180,6 +180,90 @@ } /** + * Get application decimal separator + * + * @return configuration application decimal separator + */ + public char getDecimalSeparator() { + char decimalSeparator = getOption(Option.DECIMAL_SEPARATOR.key).charAt(0); + return decimalSeparator; + } + + /** + * Change decimal separator + * Save user file. + * + * @param decimalSeparator new DecimalSeparator + */ + public void setDecimalSeparator(String decimalSeparator) { + setOption(Option.DECIMAL_SEPARATOR.key, decimalSeparator); + saveForUser(); + firePropertyChange("decimalSeparator", null, decimalSeparator); + } + + /** + * Get application scale + * + * @return configuration application scale + */ + public int getScale() { + return getOptionAsInt(Option.SCALE.key); + } + + /** + * Change scale + * Save user file. + * + * @param scale new Scale + */ + public void setScale(String scale) { + setOption(Option.SCALE.key, scale); + saveForUser(); + firePropertyChange("scale", null, scale); + } + + /** + * Get application thousand separator + * + * @return configuration application thousand separator + */ + public char getThousandSeparator() { + return getOption(Option.THOUSAND_SEPARATOR.key).charAt(0); + } + + /** + * Change the thousand separator + * Save user file. + * + * @param thousandSeparator new thousandSeparator + */ + public void setThousandSeparator(String thousandSeparator) { + setOption(Option.THOUSAND_SEPARATOR.key, thousandSeparator); + saveForUser(); + firePropertyChange("thousandSeparator", null, thousandSeparator); + } + + /** + * currency configuration boolean + * + * @return {@code true} if the currency must be displayed + */ + public boolean getCurrency() { + return getOptionAsBoolean(Option.CURRENCY.key); + } + + /** + * Change the currency displaying + * + * @param currency + */ + public void setCurrency(String currency) { + setOption(Option.CURRENCY.key, currency); + saveForUser(); + firePropertyChange("currency", null, currency); + } + + /** * Launch ui configuration value. * * @return {@code true} if ui must be displayed @@ -242,7 +326,7 @@ /** * Used in ???? */ - public static final String[] DEFAULT_JAXX_PCS = { "fullScreen", "locale" }; + public static final String[] DEFAULT_JAXX_PCS = { "fullScreen", "locale", "decimalSeparator", "scale", "thousandSeparator", "currency" }; /** * Used in ???? @@ -276,6 +360,10 @@ CONFIG_FILE(CONFIG_FILE_NAME, _("lima.config.configFileName.description"), "lima-config.properties", String.class, true, true), LOCALE("locale", _("lima.config.locale.description"), "fr_FR", Locale.class, false, false), + DECIMAL_SEPARATOR("lima.config.decimalseparator", _("lima.config.decimalseparator.description"), ",", String.class, false, false), + SCALE("scale", _("lima.config.scale.description"), "2", Integer.class, false, false), + THOUSAND_SEPARATOR("thousandSeparator", _("limma.config.thousandseparator.description"), " ", String.class, false, false), + CURRENCY("currency", _("lima.config.currency.description"), "none", Boolean.class, false, false), FULL_SCREEN("lima.ui.fullscreen", _("lima.config.ui.fullscreen.description"), "false", Boolean.class, false, false), LAUNCH_UI("lima.ui.launchui", _("lima.config.ui.flaunchui.description"), "true", Boolean.class, true, true), SUPPORT_EMAIL("lima.misc.supportemail", _("lima.misc.supportemail.description"), "", String.class, false, false), 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 2011-05-06 16:08:00 UTC (rev 3103) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2011-05-12 08:15:34 UTC (rev 3104) @@ -167,6 +167,10 @@ helper.addCategory(_("lima.config.category.other"), _("lima.config.category.other.description")); helper.addOption(LimaConfig.Option.FULL_SCREEN); helper.addOption(LimaConfig.Option.LOCALE); + helper.addOption(LimaConfig.Option.DECIMAL_SEPARATOR); + helper.addOption(LimaConfig.Option.SCALE); + helper.addOption(LimaConfig.Option.THOUSAND_SEPARATOR); + helper.addOption(LimaConfig.Option.CURRENCY); helper.buildUI(context, _("lima.config.category.directories")); helper.displayUI(ui, false); @@ -238,6 +242,7 @@ // show ui ui.setVisible(true); + showHomeView(rootContext); } /**
participants (1)
-
vsalaun@users.chorem.org