Author: dcosse Date: 2014-09-26 11:10:52 +0200 (Fri, 26 Sep 2014) New Revision: 3923 Url: http://forge.chorem.org/projects/lima/repository/revisions/3923 Log: refs #1115 refactoring recommendation sonar Added: trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java Removed: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java trunk/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.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/BigDecimalTableCellRenderer.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DefaultLimaTableCellRenderer.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/StringTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractColumn.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaInterceptor.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -26,13 +26,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaXAResource; -import org.chorem.lima.entity.AccountImpl; import org.chorem.lima.entity.LimaCallaoTopiaApplicationContext; import org.chorem.lima.entity.LimaCallaoTopiaDaoSupplier; import org.chorem.lima.entity.LimaCallaoTopiaPersistenceContext; import org.nuiton.topia.persistence.TopiaApplicationContextCache; -import org.nuiton.topia.persistence.TopiaException; -import org.nuiton.topia.persistence.util.TopiaUtil; import javax.annotation.Resource; import javax.ejb.Stateless; @@ -91,9 +88,6 @@ LimaCallaoTopiaPersistenceContext tx = rootContext.newPersistenceContext(); - // TODO DCossé 24/07/14 remove it as soon as migration service is done. - //createShemaIfNeeded(rootContext, tx); - DAO_HELPER.set(tx); Transaction tr = transactionManager.getTransaction(); @@ -118,24 +112,4 @@ return result; } - /** - * Test if schema do not already exists and create it if not found. - * - * @param applicationContext transaction - * @throws TopiaException - */ - protected void createShemaIfNeeded(LimaCallaoTopiaApplicationContext applicationContext, LimaCallaoTopiaPersistenceContext tx) throws TopiaException { - //LimaCallaoTopiaPersistenceContext - if (!applicationContext.isSchemaEmpty()) { - boolean exist = TopiaUtil.isSchemaExist(tx, AccountImpl.class.getName()); - if (!exist) { - - if (log.isInfoEnabled()) { - log.info("Creating to schema in database"); - } - applicationContext.createSchema(); - } - } - } - } Modified: trunk/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java =================================================================== --- trunk/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-business/src/main/java/org/chorem/lima/business/LimaServiceConfig.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -55,8 +55,6 @@ protected static final Log log = LogFactory.getLog(LimaServiceConfig.class); -// protected static volatile LimaServiceConfig instance; - protected static AccountingRules accountingRules; protected static final String LIMA_DEFAULT_CONF_FILENAME = "lima.properties"; @@ -187,22 +185,6 @@ config.saveForUser(); } -// /** -// * Load configuration with custom file name. -// */ -// protected void loadConfiguration() { -// try { -// config.parse(); -// } catch (ArgumentsParserException ex) { -// if (log.isErrorEnabled()) { -// log.error("Can't read configuration", ex); -// } -// } -// -// config.setOption(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, -// LimaCallaoEntityEnum.getImplementationClassesAsString()); -// } - /** * Lima option definition. * <p/> Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -1,765 +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; - -import com.google.common.collect.ImmutableSet; -import jaxx.runtime.JAXXUtil; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.lima.actions.MiscAction; -import org.chorem.lima.business.api.OptionsService; -import org.chorem.lima.entity.LimaCallaoEntityEnum; -import org.chorem.lima.service.LimaServiceFactory; -import org.nuiton.config.ApplicationConfig; -import org.nuiton.config.ArgumentsParserException; -import org.nuiton.config.ConfigOptionDef; -import org.nuiton.topia.persistence.TopiaConfigurationConstants; -import org.nuiton.util.Version; -import org.nuiton.util.VersionUtil; -import org.nuiton.util.converter.ConverterUtil; - -import java.awt.*; -import java.beans.PropertyChangeListener; -import java.io.File; -import java.io.IOException; -import java.util.Locale; -import java.util.Set; - -import static org.nuiton.i18n.I18n.t; -import static org.nuiton.i18n.I18n.n; - -/** - * La configuration de l'application. - * - * @author chemit - * @version $Revision$ - * <p/> - * Last update : $Date$ - * By : $Author$ - */ -public class LimaConfig extends ApplicationConfig { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(LimaConfig.class); - - static public final Set<Character> NUMBER_SEPARATOR = ImmutableSet.of(' ', ',', '.', ';'); - static public final Set<Integer> NUMBER_DECIMALS = ImmutableSet.of(0, 1, 2, 3, 4, 5, 6); - - protected static LimaConfig instance; - - private static final String configFile = "lima-config.properties"; - - protected OptionsService optionsService; - - /** La version du logiciel. */ - protected Version version; - - /** - * Get the configuration file - * @return name of the config. file - * */ - /*public String getConfigFile() { - return configFile; - }*/ - - /** - * Get copyright text (include version). - * - * @return copyright text - */ - public String getCopyrightText() { - return "Version " + getVersion() + " Codelutin @ 2008-2012"; - } - - /** - * Version as string. - * - * @return le nombre global ex: 3.2.0.0 - */ - public String getVersion() { - return version.toString(); - } - - /** - * Lima config constructor. - * <p/> - * Define all default options and action alias. - */ - public LimaConfig() { - - // set defaut option (included configuration file name : important) - loadDefaultOptions(Option.values()); - - // set action alias - for (Action a : Action.values()) { - for (String alias : a.aliases) { - addActionAlias(alias, a.action); - } - } - - // ajout des alias (can be set in option enum ?) - addAlias("--disableui", "--launchui false"); - - // initialisation des répertoires - // TODO what is it for ? - //FileUtil.setCurrentDirectory(getLimaUserDirectory()); - //getLimaUserDirectory().mkdirs(); - - } - - public static LimaConfig getInstance() { - if (instance == null) { - instance = new LimaConfig(); - instance.loadConfiguration(configFile); - } - - return instance; - } - - protected void loadConfiguration(String configFileName) { - - instance.setConfigFileName(configFileName); - try { - instance.parse(); - } catch (ArgumentsParserException ex) { - if (log.isErrorEnabled()) { - log.error("Can't read configuration", ex); - } - } - instance.setOption(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, - LimaCallaoEntityEnum.getImplementationClassesAsString()); - } - - @Override - public ApplicationConfig parse(String... args) throws ArgumentsParserException { - - // super parse, read config file etc... - super.parse(args); - - // on ne peut pas connaitre la version avant la lecture du fichier - // on supprime tout ce qui est apres - (-SNAPSHOT, -rc-1 ,...) - String sVersion = VersionUtil.removeSnapshot(getOption("application.version")); - version = VersionUtil.valueOf(sVersion); - - return this; - - } - - /** - * Get application locale. - * - * @return configuration application locale - */ - public Locale getLocale() { - String local = getOption(Option.LOCALE.key); - Locale result = ConverterUtil.convert(Locale.class, local); - return result; - } - - /** - * Locale setter for command line parameters. - * - * @param locale new locale - */ - public void setLocale(String locale) { - setOption(Option.LOCALE.key, locale); - } - - /** - * Change locale (not command line version). - * Save user file. - * - * @param newLocale new locale - */ - public void setLocale(Locale newLocale) { - setOption(Option.LOCALE.key, newLocale.toString()); - saveForUser(); - firePropertyChange("locale", null, newLocale); - } - - /** - * 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); - if (log.isInfoEnabled()) { - log.info("new scale" + scale); - } - optionsService.setScale(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 the new currency to set in configuration - */ - public void setCurrency(boolean currency) { - setOption(Option.CURRENCY.key, Boolean.toString(currency)); - saveForUser(); - firePropertyChange("currency", null, currency); - } - - /** - * Launch ui configuration value. - * - * @return {@code true} if ui must be displayed - */ - public boolean isLaunchui() { - boolean launchUI = getOptionAsBoolean(Option.LAUNCH_UI.key); - return launchUI; - } - - /** - * Launch ui setter for command line parameters. - * - * @param launchui new lauch ui value - */ - public void setLaunchui(String launchui) { - setOption(Option.LAUNCH_UI.key, launchui); - } - - /** - * Get support email address. - * - * @return support email - */ - public String getSupportEmail() { - return getOption(Option.SUPPORT_EMAIL.key); - } - - /** - * Return true if ejb mode is configured as remote. - * - * @return {@code true} if remote mode should be used - */ - public boolean isEJBRemoteMode() { - boolean result = getOptionAsBoolean(Option.OPENEJB_REMOTEMODE.key); - return result; - } - - public File getDataDirectory() { - File result = getOptionAsFile(Option.DATA_DIR.key); - return result; - } - - public File getLimaStateFile() { - File result = getOptionAsFile(Option.LIMA_STATE_FILE.key); - return result; - } - - public File getResourcesDirectory() { - File result = getOptionAsFile(Option.RESOURCES_DIRECTORY.key); - return result; - } - - public File getI18nDirectory() { - File result = getOptionAsFile(Option.I18N_DIRECTORY.key); - return result; - } - - public String getHostAdress() { - return getOption(Option.LIMA_HOST_ADDRESS.key); - } - - public void setColorSelectionFocus(String color) { - setOption(Option.COLOR_SELECTION_FOCUS.key, color); - } - - public Color getColorSelectionFocus() { - return getOptionAsColor((Option.COLOR_SELECTION_FOCUS.key)); - } - - public void setSelectAllEditingCell(boolean selectAllEditingCell) { - setOption(Option.SELECT_ALL_EDITING_CELL.key, Boolean.toString(selectAllEditingCell)); - } - - public boolean isSelectAllEditingCell() { - return getOptionAsBoolean((Option.SELECT_ALL_EDITING_CELL.key)); - } - - /** Used in ???? */ - public static final String[] DEFAULT_JAXX_PCS = {"fullScreen", "locale", "decimalSeparator", "scale", "thousandSeparator", "currency"}; - - /** Used in ???? */ - public void removeJaxxPropertyChangeListener() { - PropertyChangeListener[] toRemove = JAXXUtil.findJaxxPropertyChangeListener(DEFAULT_JAXX_PCS, getPropertyChangeListeners()); - if (toRemove == null || toRemove.length == 0) { - return; - } - if (log.isDebugEnabled()) { - log.debug("before remove : " + getPropertyChangeListeners().length); - log.debug("toRemove : " + toRemove.length); - - } - for (PropertyChangeListener listener : toRemove) { - removePropertyChangeListener(listener); - } - if (log.isDebugEnabled()) { - log.debug("after remove : " + getPropertyChangeListeners().length); - } - } - - /** - * Lima option definition. - * <p/> - * Contains all lima configuration key, with defaut value and - * information for jaxx configuration frame ({@link #type}, - * {@link #_transient}, {@link #_final}...) - */ - public enum Option implements ConfigOptionDef { - - - CONFIG_FILE(CONFIG_FILE_NAME, - t("lima.config.configFileName.label"), - n("lima.config.configFileName.description"), - "lima-config.properties", - String.class, true, true), - - DATA_DIR("lima.data.dir", - t("lima.config.data.dir.label"), - n("lima.config.data.dir.description"), - "${user.home}/.lima", - File.class, false, false), - - RESOURCES_DIRECTORY("lima.resources.dir", - t("lima.config.resources.dir.label"), - n("lima.config.resources.dir.description"), - "${lima.data.dir}/resources-${application.version}", - String.class, false, false), - - I18N_DIRECTORY("lima.i18n.dir", - t("lima.config.i18n.dir.label"), - n("lima.config.i18n.dir.description"), - "${lima.resources.dir}/i18n", - String.class, false, false), - - LOCALE("lima.ui.locale", - t("lima.config.locale.label"), - n("lima.config.locale.description"), - "fr_FR", - Locale.class, false, false), - - DECIMAL_SEPARATOR("lima.data.bigDecimal.decimalSeparator", - t("lima.config.decimalseparator.label"), - n("lima.config.decimalseparator.description"), - ",", - Character.class, false, false), - - SCALE("lima.data.bigDecimal.scale", - t("lima.config.scale.label"), - n("lima.config.scale.description"), - "2", - Integer.class, false, false), - - THOUSAND_SEPARATOR("lima.thousandSeparator", - t("limma.config.thousandseparator.label"), - n("limma.config.thousandseparator.description"), - " ", - Character.class, false, false), - - CURRENCY("lima.config.currency", - t("lima.config.currency.label"), - n("lima.config.currency.description"), - "false", - Boolean.class, false, false), - - LAUNCH_UI("lima.ui.launchui", - t("lima.config.ui.flaunchui.label"), - n("lima.config.ui.flaunchui.description"), - "true", Boolean.class, true, true), - - SUPPORT_EMAIL("lima.misc.supportemail", - t("lima.misc.supportemail.label"), - n("lima.misc.supportemail.description"), - "support@codelutin.com", - String.class, false, false), - - OPENEJB_REMOTEMODE("lima.openejb.remotemode", - t("lima.openejb.remotemode.label"), - n("lima.openejb.remotemode.description"), - "false", - String.class, false, false), - - LIMA_HOST_ADDRESS("lima.host.address", - t("lima.config.host.adress.label"), - n("lima.config.host.adress.description"), - "localhost", - String.class, false, false), - - LIMA_STATE_FILE("lima.ui.state.file", - t("lima.config.state.file.label"), - n("lima.config.state.file.description"), - "${lima.data.dir}/limaState.xml", - String.class, false, false), - - COLOR_SELECTION_FOCUS("lima.ui.table.cell.colorSelectionFocus", - t("lima.config.colorselectionfocus.label"), - n("lima.config.colorselectionfocus.description"), - "#000000", - Color.class, false, false), - - SELECT_ALL_EDITING_CELL("lima.ui.table.cell.selectAllEditingCell", - t("lima.config.selectAllEditingCell.label"), - n("lima.config.selectAllEditingCell.description"), - "true", - Boolean.class, false, false), - - TABLE_CELL_BACKGROUND("lima.ui.table.cell.background", - t("lima.config.cell.background.label"), - n("lima.config.cell.background.description"), - "#FFFFFF", - Color.class, false, false), - - TABLE_CELL_FOREGROUND("lima.ui.table.cell.foreground", - t("lima.config.cell.foreground.label"), - n("lima.config.cell.foreground.description"), - "#000000", - Color.class, false, false), - - TABLE_CELL_PAIR_BACKGROUND("lima.ui.table.cell.pair.background", - t("lima.config.cell.pair.background.label"), - n("lima.config.cell.pair.background.description"), - "#EEEEEE", - Color.class, false, false), - - TABLE_CELL_PAIR_FOREGROUND("lima.ui.table.cell.pair.foreground", - t("lima.config.cell.pair.foreground.label"), - n("lima.config.cell.pair.foreground.description"), - "#000000", - Color.class, false, false), - - TABLE_CELL_SELECTED_BACKGROUND("lima.ui.table.cell.selected.background", - t("lima.config.cell.selected.background.label"), - n("lima.config.cell.selected.background.description"), - "#0066CC", - Color.class, false, false), - - TABLE_CELL_SELECTED_FOREGROUND("lima.ui.table.cell.selected.foreground", - t("lima.config.cell.selected.foreground.label"), - n("lima.config.cell.selected.foreground.description"), - "#FFFFFF", - Color.class, false, false), - - TABLE_CELL_PAIR_SELECTED_BACKGROUND("lima.ui.table.cell.pair.selected.background", - t("lima.config.cell.pair.selected.background.label"), - n("lima.config.cell.pair.selected.background.description"), - "#006699", - Color.class, false, false), - - TABLE_CELL_PAIR_SELECTED_FOREGROUND("lima.ui.table.cell.pair.selected.foreground", - t("lima.config.cell.pair.selected.foreground.label"), - n("lima.config.cell.pair.selected.foreground.description"), - "#FFFFFF", - Color.class, false, false), - - TABLE_CELL_ERROR_BACKGROUND("lima.ui.table.cell.error.background", - t("lima.config.cell.error.background.label"), - n("lima.config.cell.error.background.description"), - "#FFFFFF", - Color.class, false, false), - - TABLE_CELL_ERROR_FOREGROUND("lima.ui.table.cell.error.foreground", - t("lima.config.cell.error.foreground.label"), - n("lima.config.cell.error.foreground.description"), - "#FF0936", - Color.class, false, false), - - TABLE_CELL_PAIR_ERROR_BACKGROUND("lima.ui.table.cell.pair.error.background", - t("lima.config.cell.pair.error.background.label"), - n("lima.config.cell.pair.error.background.description"), - "#EEEEEE", - Color.class, false, false), - - TABLE_CELL_PAIR_ERROR_FOREGROUND("lima.ui.table.cell.pair.error.foreground", - t("lima.config.cell.pair.error.foreground.label"), - n("lima.config.cell.pair.error.foreground.description"), - "#FC0625", - Color.class, false, false), - - TABLE_CELL_SELECTED_ERROR_BACKGROUND("lima.ui.table.cell.selected.error.background", - t("lima.config.cell.selected.error.background.label"), - n("lima.config.cell.selected.error.background.description"), - "#0066CC", - Color.class, false, false), - - TABLE_CELL_SELECTED_ERROR_FOREGROUND("lima.ui.table.cell.selected.error.foreground", - t("lima.config.cell.selected.error.foreground.label"), - n("lima.config.cell.selected.error.foreground.description"), - "#C998C1", - Color.class, false, false), - - TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND("lima.ui.table.cell.pair.selected.error.background", - t("lima.config.cell.pair.selected.error.background.label"), - n("lima.config.cell.pair.selected.error.background.description"), - "#006699", - Color.class, false, false), - - TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND("lima.ui.table.cell.pair.selected.error.foreground", - t("lima.config.cell.pair.selected.error.foreground.label"), - n("lima.config.cell.pair.selected.error.foreground.description"), - "#C96678", - Color.class, false, false), - - TABLE_CELL_MANDATORY_BACKGROUND("lima.ui.table.cell.mandatory.background", - t("lima.config.cell.mandatory.background.label"), - n("lima.config.cell.mandatory.background.description"), - "#FFCCCC", - Color.class, false, false), - - TABLE_CELL_MANDATORY_FOREGROUND("lima.ui.table.cell.mandatory.foreground", - t("lima.config.cell.mandatory.foreground.label"), - n("lima.config.cell.mandatory.foreground.description"), - "#000000", - Color.class, false, false), - - TABLE_CELL_PAIR_MANDATORY_BACKGROUND("lima.ui.table.cell.pair.mandatory.background", - t("lima.config.cell.pair.mandatory.background.label"), - n("lima.config.cell.pair.mandatory.background.description"), - "#FF99CC", - Color.class, false, false), - - TABLE_CELL_PAIR_MANDATORY_FOREGROUND("lima.ui.table.cell.pair.mandatory.foreground", - t("lima.config.cell.pair.mandatory.foreground.label"), - n("lima.config.cell.pair.mandatory.foreground.description"), - "#000000", - Color.class, false, false), - - TABLE_CELL_SELECTED_MANDATORY_BACKGROUND("lima.ui.table.cell.selected.mandatory.background", - t("lima.config.cell.selected.mandatory.background.label"), - n("lima.config.cell.selected.mandatory.background.description"), - "#FF0000", - Color.class, false, false), - - TABLE_CELL_SELECTED_MANDATORY_FOREGROUND("lima.ui.table.cell.selected.mandatory.foreground", - t("lima.config.cell.selected.mandatory.foreground.label"), - n("lima.config.cell.selected.mandatory.foreground.description"), - "#FFFFFF", - Color.class, false, false), - - TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND("lima.ui.table.cell.pair.selected.mandatory.background", - t("lima.config.cell.pair.selected.mandatory.background.label"), - n("lima.config.cell.pair.selected.mandatory.background.description"), - "#990000", - Color.class, false, false), - - TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND("lima.ui.table.cell.pair.selected.mandatory.foreground", - t("lima.config.cell.pair.selected.mandatory.foreground.label"), - n("lima.config.cell.pair.selected.mandatory.foreground.description"), - "#000000", - Color.class, false, false); - - public enum ComportmentEditingCellEnum {ALL, NOTHING} - - public final String key; - - public final String label; - - public final String description; - - public String defaultValue; - - public final Class<?> type; - - public boolean _transient; - - public boolean _final; - - Option(String key, String label, String description, String defaultValue, - Class<?> type, boolean _transient, boolean _final) { - this.key = key; - this.label = label; - this.description = description; - this.defaultValue = defaultValue; - this.type = type; - this._final = _final; - this._transient = _transient; - } - - @Override - public boolean isFinal() { - return _final; - } - - @Override - public void setFinal(boolean _final) { - this._final = _final; - } - - @Override - public boolean isTransient() { - return _transient; - } - - @Override - public void setTransient(boolean _transient) { - this._transient = _transient; - } - - @Override - public String getDefaultValue() { - return defaultValue; - } - - @Override - public void setDefaultValue(String defaultValue) { - this.defaultValue = defaultValue; - } - - public String getLabel () { - return label; - } - - @Override - public String getDescription() { - return t(description); - } - - @Override - public String getKey() { - return key; - } - - @Override - public Class<?> getType() { - return type; - } - } - - /** Lima action definition. */ - public enum Action { - - HELP(n("lima.action.commandline.help"), MiscAction.class.getName() + "#help", "-h", "--help"); - - /** Before init action step. */ - public static final int BEFORE_EXIT_STEP = 0; - - /** After init action step. */ - public static final int AFTER_INIT_STEP = 1; - - public String description; - - public String action; - - public String[] aliases; - - Action(String description, String action, String... aliases) { - this.description = description; - this.action = action; - this.aliases = aliases; - } - - public String getDescription() { - return t(description); - } - } - - /** - * Override save action to propagate some option to server. - */ - @Override - public void save(File file, - boolean forceAll, - String... excludeKeys) throws IOException { - - super.save(file, forceAll, excludeKeys); - - // propagate scale option to serveur option - optionsService = LimaServiceFactory.getService(OptionsService.class); - - // scale server option - String scaleOption = getOption("scale"); - if (StringUtils.isNotBlank(scaleOption)) { - optionsService.setScale(scaleOption); - } - } -} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaExceptionHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -59,7 +59,7 @@ log.error("Global application exception", ex); } - ErrorHelper errorHelper = new ErrorHelper(LimaConfig.getInstance()); + ErrorHelper errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); errorHelper.showErrorDialog(null, ex.getMessage(), ex); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -53,7 +53,7 @@ private static final Log log = LogFactory.getLog(LimaMain.class); /** Lima configuration. */ - public static LimaConfig config; + public static LimaSwingConfig config; /** splash */ private static LimaSplash splash; @@ -76,7 +76,7 @@ // do actions config = context.getConfig(); - config.doAction(LimaConfig.Action.AFTER_INIT_STEP); + config.doAction(LimaSwingConfig.Action.AFTER_INIT_STEP); // display main ui if (config.isLaunchui()) { @@ -112,7 +112,7 @@ // init root context LimaSwingApplicationContext context = LimaSwingApplicationContext.init(); - LimaConfig config = context.getConfig(); + LimaSwingConfig config = context.getConfig(); config.parse(args); context.initI18n(config); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingApplicationContext.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -58,7 +58,7 @@ public static JAXXContextEntryDef<DecoratorProvider> DECORATOR_PROVIDER_DEF = JAXXUtil.newContextEntryDef("decoratorProvider", DecoratorProvider.class); - public static JAXXContextEntryDef<LimaConfig> CONFIG_DEF = JAXXUtil.newContextEntryDef("limaConfig", LimaConfig.class); + public static JAXXContextEntryDef<LimaSwingConfig> CONFIG_DEF = JAXXUtil.newContextEntryDef("limaConfig", LimaSwingConfig.class); /** * @return <code>true</code> si le context a été initialisé via la méthode @@ -83,7 +83,7 @@ } instance = new LimaSwingApplicationContext(); instance.setContextValue(new MainViewHandler()); - CONFIG_DEF.setContextValue(instance, LimaConfig.getInstance()); + CONFIG_DEF.setContextValue(instance, LimaSwingConfig.getInstance()); DECORATOR_PROVIDER_DEF.setContextValue(instance, new LimaDecoratorProvider()); initApplicationContext(); return instance; @@ -108,7 +108,7 @@ return instance; } - public LimaConfig getConfig() { + public LimaSwingConfig getConfig() { return CONFIG_DEF.getContextValue(this); } @@ -116,7 +116,7 @@ return DECORATOR_PROVIDER_DEF.getContextValue(this); } - public void initI18n(LimaConfig config) { + public void initI18n(LimaSwingConfig config) { I18n.close(); Copied: trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java (from rev 3921, trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java) =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaSwingConfig.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -0,0 +1,750 @@ +/* + * #%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; + +import com.google.common.collect.ImmutableSet; +import jaxx.runtime.JAXXUtil; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.lima.actions.MiscAction; +import org.chorem.lima.business.api.OptionsService; +import org.chorem.lima.entity.LimaCallaoEntityEnum; +import org.chorem.lima.service.LimaServiceFactory; +import org.nuiton.config.ApplicationConfig; +import org.nuiton.config.ArgumentsParserException; +import org.nuiton.config.ConfigOptionDef; +import org.nuiton.converter.ConverterUtil; +import org.nuiton.topia.persistence.TopiaConfigurationConstants; +import org.nuiton.util.version.Version; +import org.nuiton.util.version.VersionBuilder; + +import java.awt.*; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.IOException; +import java.util.Locale; +import java.util.Set; + +import static org.nuiton.i18n.I18n.n; +import static org.nuiton.i18n.I18n.t; + +/** + * La configuration de l'application. + * + * @author chemit + * @version $Revision$ + * <p/> + * Last update : $Date$ + * By : $Author$ + */ +public class LimaSwingConfig extends ApplicationConfig { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + private static Log log = LogFactory.getLog(LimaSwingConfig.class); + + public static final Set<Character> NUMBER_SEPARATOR = ImmutableSet.of(' ', ',', '.', ';'); + public static final Set<Integer> NUMBER_DECIMALS = ImmutableSet.of(0, 1, 2, 3, 4, 5, 6); + + protected static LimaSwingConfig instance; + + private static final String configFile = "lima-config.properties"; + + protected OptionsService optionsService; + + /** La version du logiciel. */ + protected Version version; + + /** + * Get copyright text (include version). + * + * @return copyright text + */ + public String getCopyrightText() { + return "Version " + getVersion() + " Codelutin @ 2008-2012"; + } + + /** + * Version as string. + * + * @return le nombre global ex: 3.2.0.0 + */ + public String getVersion() { + return version.toString(); + } + + /** + * Lima config constructor. + * <p/> + * Define all default options and action alias. + */ + public LimaSwingConfig() { + + // set defaut option (included configuration file name : important) + loadDefaultOptions(Option.values()); + + // set action alias + for (Action a : Action.values()) { + for (String alias : a.aliases) { + addActionAlias(alias, a.action); + } + } + + // ajout des alias (can be set in option enum ?) + addAlias("--disableui", "--launchui false"); + } + + public static LimaSwingConfig getInstance() { + if (instance == null) { + instance = new LimaSwingConfig(); + instance.loadConfiguration(configFile); + } + + return instance; + } + + protected void loadConfiguration(String configFileName) { + + instance.setConfigFileName(configFileName); + try { + instance.parse(); + } catch (ArgumentsParserException ex) { + if (log.isErrorEnabled()) { + log.error("Can't read configuration", ex); + } + } + instance.setOption(TopiaConfigurationConstants.CONFIG_PERSISTENCE_CLASSES, + LimaCallaoEntityEnum.getImplementationClassesAsString()); + } + + @Override + public ApplicationConfig parse(String... args) throws ArgumentsParserException { + + // super parse, read config file etc... + super.parse(args); + + // on ne peut pas connaitre la version avant la lecture du fichier + VersionBuilder nb = new VersionBuilder(); + nb.setVersion(getOption("application.version")); + version = nb.build(); + return this; + + } + + /** + * Get application locale. + * + * @return configuration application locale + */ + public Locale getLocale() { + String local = getOption(Option.LOCALE.key); + Locale result = ConverterUtil.convert(Locale.class, local); + return result; + } + + /** + * Locale setter for command line parameters. + * + * @param locale new locale + */ + public void setLocale(String locale) { + setOption(Option.LOCALE.key, locale); + } + + /** + * Change locale (not command line version). + * Save user file. + * + * @param newLocale new locale + */ + public void setLocale(Locale newLocale) { + setOption(Option.LOCALE.key, newLocale.toString()); + saveForUser(); + firePropertyChange("locale", null, newLocale); + } + + /** + * 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); + if (log.isInfoEnabled()) { + log.info("new scale" + scale); + } + optionsService.setScale(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 the new currency to set in configuration + */ + public void setCurrency(boolean currency) { + setOption(Option.CURRENCY.key, Boolean.toString(currency)); + saveForUser(); + firePropertyChange("currency", null, currency); + } + + /** + * Launch ui configuration value. + * + * @return {@code true} if ui must be displayed + */ + public boolean isLaunchui() { + boolean launchUI = getOptionAsBoolean(Option.LAUNCH_UI.key); + return launchUI; + } + + /** + * Launch ui setter for command line parameters. + * + * @param launchui new lauch ui value + */ + public void setLaunchui(String launchui) { + setOption(Option.LAUNCH_UI.key, launchui); + } + + /** + * Get support email address. + * + * @return support email + */ + public String getSupportEmail() { + return getOption(Option.SUPPORT_EMAIL.key); + } + + /** + * Return true if ejb mode is configured as remote. + * + * @return {@code true} if remote mode should be used + */ + public boolean isEJBRemoteMode() { + boolean result = getOptionAsBoolean(Option.OPENEJB_REMOTEMODE.key); + return result; + } + + public File getDataDirectory() { + File result = getOptionAsFile(Option.DATA_DIR.key); + return result; + } + + public File getLimaStateFile() { + File result = getOptionAsFile(Option.LIMA_STATE_FILE.key); + return result; + } + + public File getResourcesDirectory() { + File result = getOptionAsFile(Option.RESOURCES_DIRECTORY.key); + return result; + } + + public File getI18nDirectory() { + File result = getOptionAsFile(Option.I18N_DIRECTORY.key); + return result; + } + + public String getHostAdress() { + return getOption(Option.LIMA_HOST_ADDRESS.key); + } + + public void setColorSelectionFocus(String color) { + setOption(Option.COLOR_SELECTION_FOCUS.key, color); + } + + public Color getColorSelectionFocus() { + return getOptionAsColor((Option.COLOR_SELECTION_FOCUS.key)); + } + + public void setSelectAllEditingCell(boolean selectAllEditingCell) { + setOption(Option.SELECT_ALL_EDITING_CELL.key, Boolean.toString(selectAllEditingCell)); + } + + public boolean isSelectAllEditingCell() { + return getOptionAsBoolean((Option.SELECT_ALL_EDITING_CELL.key)); + } + + /** Used in ???? */ + protected static final String[] DEFAULT_JAXX_PCS = {"fullScreen", "locale", "decimalSeparator", "scale", "thousandSeparator", "currency"}; + + /** Used in ???? */ + public void removeJaxxPropertyChangeListener() { + PropertyChangeListener[] toRemove = JAXXUtil.findJaxxPropertyChangeListener(DEFAULT_JAXX_PCS, getPropertyChangeListeners()); + if (toRemove == null || toRemove.length == 0) { + return; + } + if (log.isDebugEnabled()) { + log.debug("before remove : " + getPropertyChangeListeners().length); + log.debug("toRemove : " + toRemove.length); + + } + for (PropertyChangeListener listener : toRemove) { + removePropertyChangeListener(listener); + } + if (log.isDebugEnabled()) { + log.debug("after remove : " + getPropertyChangeListeners().length); + } + } + + /** + * Lima option definition. + * <p/> + * Contains all lima configuration key, with defaut value and + * information for jaxx configuration frame ({@link #type}, + * {@link #_transient}, {@link #_final}...) + */ + public enum Option implements ConfigOptionDef { + + + CONFIG_FILE(CONFIG_FILE_NAME, + t("lima.config.configFileName.label"), + n("lima.config.configFileName.description"), + "lima-config.properties", + String.class, true, true), + + DATA_DIR("lima.data.dir", + t("lima.config.data.dir.label"), + n("lima.config.data.dir.description"), + "${user.home}/.lima", + File.class, false, false), + + RESOURCES_DIRECTORY("lima.resources.dir", + t("lima.config.resources.dir.label"), + n("lima.config.resources.dir.description"), + "${lima.data.dir}/resources-${application.version}", + String.class, false, false), + + I18N_DIRECTORY("lima.i18n.dir", + t("lima.config.i18n.dir.label"), + n("lima.config.i18n.dir.description"), + "${lima.resources.dir}/i18n", + String.class, false, false), + + LOCALE("lima.ui.locale", + t("lima.config.locale.label"), + n("lima.config.locale.description"), + "fr_FR", + Locale.class, false, false), + + DECIMAL_SEPARATOR("lima.data.bigDecimal.decimalSeparator", + t("lima.config.decimalseparator.label"), + n("lima.config.decimalseparator.description"), + ",", + Character.class, false, false), + + SCALE("lima.data.bigDecimal.scale", + t("lima.config.scale.label"), + n("lima.config.scale.description"), + "2", + Integer.class, false, false), + + THOUSAND_SEPARATOR("lima.thousandSeparator", + t("limma.config.thousandseparator.label"), + n("limma.config.thousandseparator.description"), + " ", + Character.class, false, false), + + CURRENCY("lima.config.currency", + t("lima.config.currency.label"), + n("lima.config.currency.description"), + "false", + Boolean.class, false, false), + + LAUNCH_UI("lima.ui.launchui", + t("lima.config.ui.flaunchui.label"), + n("lima.config.ui.flaunchui.description"), + "true", Boolean.class, true, true), + + SUPPORT_EMAIL("lima.misc.supportemail", + t("lima.misc.supportemail.label"), + n("lima.misc.supportemail.description"), + "support@codelutin.com", + String.class, false, false), + + OPENEJB_REMOTEMODE("lima.openejb.remotemode", + t("lima.openejb.remotemode.label"), + n("lima.openejb.remotemode.description"), + "false", + String.class, false, false), + + LIMA_HOST_ADDRESS("lima.host.address", + t("lima.config.host.adress.label"), + n("lima.config.host.adress.description"), + "localhost", + String.class, false, false), + + LIMA_STATE_FILE("lima.ui.state.file", + t("lima.config.state.file.label"), + n("lima.config.state.file.description"), + "${lima.data.dir}/limaState.xml", + String.class, false, false), + + COLOR_SELECTION_FOCUS("lima.ui.table.cell.colorSelectionFocus", + t("lima.config.colorselectionfocus.label"), + n("lima.config.colorselectionfocus.description"), + "#000000", + Color.class, false, false), + + SELECT_ALL_EDITING_CELL("lima.ui.table.cell.selectAllEditingCell", + t("lima.config.selectAllEditingCell.label"), + n("lima.config.selectAllEditingCell.description"), + "true", + Boolean.class, false, false), + + TABLE_CELL_BACKGROUND("lima.ui.table.cell.background", + t("lima.config.cell.background.label"), + n("lima.config.cell.background.description"), + "#FFFFFF", + Color.class, false, false), + + TABLE_CELL_FOREGROUND("lima.ui.table.cell.foreground", + t("lima.config.cell.foreground.label"), + n("lima.config.cell.foreground.description"), + "#000000", + Color.class, false, false), + + TABLE_CELL_PAIR_BACKGROUND("lima.ui.table.cell.pair.background", + t("lima.config.cell.pair.background.label"), + n("lima.config.cell.pair.background.description"), + "#EEEEEE", + Color.class, false, false), + + TABLE_CELL_PAIR_FOREGROUND("lima.ui.table.cell.pair.foreground", + t("lima.config.cell.pair.foreground.label"), + n("lima.config.cell.pair.foreground.description"), + "#000000", + Color.class, false, false), + + TABLE_CELL_SELECTED_BACKGROUND("lima.ui.table.cell.selected.background", + t("lima.config.cell.selected.background.label"), + n("lima.config.cell.selected.background.description"), + "#0066CC", + Color.class, false, false), + + TABLE_CELL_SELECTED_FOREGROUND("lima.ui.table.cell.selected.foreground", + t("lima.config.cell.selected.foreground.label"), + n("lima.config.cell.selected.foreground.description"), + "#FFFFFF", + Color.class, false, false), + + TABLE_CELL_PAIR_SELECTED_BACKGROUND("lima.ui.table.cell.pair.selected.background", + t("lima.config.cell.pair.selected.background.label"), + n("lima.config.cell.pair.selected.background.description"), + "#006699", + Color.class, false, false), + + TABLE_CELL_PAIR_SELECTED_FOREGROUND("lima.ui.table.cell.pair.selected.foreground", + t("lima.config.cell.pair.selected.foreground.label"), + n("lima.config.cell.pair.selected.foreground.description"), + "#FFFFFF", + Color.class, false, false), + + TABLE_CELL_ERROR_BACKGROUND("lima.ui.table.cell.error.background", + t("lima.config.cell.error.background.label"), + n("lima.config.cell.error.background.description"), + "#FFFFFF", + Color.class, false, false), + + TABLE_CELL_ERROR_FOREGROUND("lima.ui.table.cell.error.foreground", + t("lima.config.cell.error.foreground.label"), + n("lima.config.cell.error.foreground.description"), + "#FF0936", + Color.class, false, false), + + TABLE_CELL_PAIR_ERROR_BACKGROUND("lima.ui.table.cell.pair.error.background", + t("lima.config.cell.pair.error.background.label"), + n("lima.config.cell.pair.error.background.description"), + "#EEEEEE", + Color.class, false, false), + + TABLE_CELL_PAIR_ERROR_FOREGROUND("lima.ui.table.cell.pair.error.foreground", + t("lima.config.cell.pair.error.foreground.label"), + n("lima.config.cell.pair.error.foreground.description"), + "#FC0625", + Color.class, false, false), + + TABLE_CELL_SELECTED_ERROR_BACKGROUND("lima.ui.table.cell.selected.error.background", + t("lima.config.cell.selected.error.background.label"), + n("lima.config.cell.selected.error.background.description"), + "#0066CC", + Color.class, false, false), + + TABLE_CELL_SELECTED_ERROR_FOREGROUND("lima.ui.table.cell.selected.error.foreground", + t("lima.config.cell.selected.error.foreground.label"), + n("lima.config.cell.selected.error.foreground.description"), + "#C998C1", + Color.class, false, false), + + TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND("lima.ui.table.cell.pair.selected.error.background", + t("lima.config.cell.pair.selected.error.background.label"), + n("lima.config.cell.pair.selected.error.background.description"), + "#006699", + Color.class, false, false), + + TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND("lima.ui.table.cell.pair.selected.error.foreground", + t("lima.config.cell.pair.selected.error.foreground.label"), + n("lima.config.cell.pair.selected.error.foreground.description"), + "#C96678", + Color.class, false, false), + + TABLE_CELL_MANDATORY_BACKGROUND("lima.ui.table.cell.mandatory.background", + t("lima.config.cell.mandatory.background.label"), + n("lima.config.cell.mandatory.background.description"), + "#FFCCCC", + Color.class, false, false), + + TABLE_CELL_MANDATORY_FOREGROUND("lima.ui.table.cell.mandatory.foreground", + t("lima.config.cell.mandatory.foreground.label"), + n("lima.config.cell.mandatory.foreground.description"), + "#000000", + Color.class, false, false), + + TABLE_CELL_PAIR_MANDATORY_BACKGROUND("lima.ui.table.cell.pair.mandatory.background", + t("lima.config.cell.pair.mandatory.background.label"), + n("lima.config.cell.pair.mandatory.background.description"), + "#FF99CC", + Color.class, false, false), + + TABLE_CELL_PAIR_MANDATORY_FOREGROUND("lima.ui.table.cell.pair.mandatory.foreground", + t("lima.config.cell.pair.mandatory.foreground.label"), + n("lima.config.cell.pair.mandatory.foreground.description"), + "#000000", + Color.class, false, false), + + TABLE_CELL_SELECTED_MANDATORY_BACKGROUND("lima.ui.table.cell.selected.mandatory.background", + t("lima.config.cell.selected.mandatory.background.label"), + n("lima.config.cell.selected.mandatory.background.description"), + "#FF0000", + Color.class, false, false), + + TABLE_CELL_SELECTED_MANDATORY_FOREGROUND("lima.ui.table.cell.selected.mandatory.foreground", + t("lima.config.cell.selected.mandatory.foreground.label"), + n("lima.config.cell.selected.mandatory.foreground.description"), + "#FFFFFF", + Color.class, false, false), + + TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND("lima.ui.table.cell.pair.selected.mandatory.background", + t("lima.config.cell.pair.selected.mandatory.background.label"), + n("lima.config.cell.pair.selected.mandatory.background.description"), + "#990000", + Color.class, false, false), + + TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND("lima.ui.table.cell.pair.selected.mandatory.foreground", + t("lima.config.cell.pair.selected.mandatory.foreground.label"), + n("lima.config.cell.pair.selected.mandatory.foreground.description"), + "#000000", + Color.class, false, false); + + protected enum ComportmentEditingCellEnum {ALL, NOTHING} + + protected final String key; + + protected final String label; + + protected final String description; + + protected String defaultValue; + + protected final Class<?> type; + + protected boolean _transient; + + protected boolean _final; + + Option(String key, String label, String description, String defaultValue, + Class<?> type, boolean _transient, boolean _final) { + this.key = key; + this.label = label; + this.description = description; + this.defaultValue = defaultValue; + this.type = type; + this._final = _final; + this._transient = _transient; + } + + @Override + public boolean isFinal() { + return _final; + } + + @Override + public void setFinal(boolean _final) { + this._final = _final; + } + + @Override + public boolean isTransient() { + return _transient; + } + + @Override + public void setTransient(boolean _transient) { + this._transient = _transient; + } + + @Override + public String getDefaultValue() { + return defaultValue; + } + + @Override + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + public String getLabel () { + return label; + } + + @Override + public String getDescription() { + return t(description); + } + + @Override + public String getKey() { + return key; + } + + @Override + public Class<?> getType() { + return type; + } + } + + /** Lima action definition. */ + public enum Action { + + HELP(n("lima.action.commandline.help"), MiscAction.class.getName() + "#help", "-h", "--help"); + + /** Before init action step. */ + public static final int BEFORE_EXIT_STEP = 0; + + /** After init action step. */ + public static final int AFTER_INIT_STEP = 1; + + public String description; + + public String action; + + public String[] aliases; + + Action(String description, String action, String... aliases) { + this.description = description; + this.action = action; + this.aliases = aliases; + } + + public String getDescription() { + return t(description); + } + } + + /** + * Override save action to propagate some option to server. + */ + @Override + public void save(File file, + boolean forceAll, + String... excludeKeys) throws IOException { + + super.save(file, forceAll, excludeKeys); + + // propagate scale option to serveur option + optionsService = LimaServiceFactory.getService(OptionsService.class); + + // scale server option + String scaleOption = getOption("scale"); + if (StringUtils.isNotBlank(scaleOption)) { + optionsService.setScale(scaleOption); + } + } +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/actions/MiscAction.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -25,8 +25,8 @@ package org.chorem.lima.actions; -import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaMain; +import org.chorem.lima.LimaSwingConfig; import java.util.Arrays; @@ -44,20 +44,20 @@ public class MiscAction { /** La configuration de l'application. */ - protected LimaConfig config; + protected LimaSwingConfig config; - public MiscAction(LimaConfig config) { + public MiscAction(LimaSwingConfig config) { this.config = config; } public void help() { System.out.println(t("lima.message.help.usage")); - for (LimaConfig.Option o : LimaConfig.Option.values()) { - System.out.println("\t" + o.key + "(" + o.defaultValue + "):" + o.getDescription()); + for (LimaSwingConfig.Option o : LimaSwingConfig.Option.values()) { + System.out.println("\t" + o.getKey() + "(" + o.getDefaultValue() + "):" + o.getDescription()); } System.out.println("Actions:"); - for (LimaConfig.Action a : LimaConfig.Action.values()) { + for (LimaSwingConfig.Action a : LimaSwingConfig.Action.values()) { System.out.println("\t" + Arrays.toString(a.aliases) + "(" + a.action + "):" + a.getDescription()); } } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainView.jaxx 2014-09-26 09:10:52 UTC (rev 3923) @@ -31,7 +31,7 @@ java.util.Locale javax.swing.JButton jaxx.runtime.SwingUtil - org.chorem.lima.LimaConfig + org.chorem.lima.LimaSwingConfig org.chorem.lima.LimaSwingApplicationContext org.chorem.lima.enums.ImportExportEnum </import> @@ -42,7 +42,7 @@ SwingUtil.getLayer(mainPanel).setUI(betaLayer); } - public LimaConfig getConfig() { + public LimaSwingConfig getConfig() { return LimaSwingApplicationContext.CONFIG_DEF.getContextValue(getDelegateContext()); } 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 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -30,8 +30,8 @@ import jaxx.runtime.swing.config.ConfigUIHelper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaSwingApplicationContext; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.api.HttpServerService; import org.chorem.lima.enums.ImportExportEnum; import org.chorem.lima.service.LimaServiceFactory; @@ -105,15 +105,15 @@ //Get xml lima state file protected File getLimaStateFile() { - LimaConfig limaConfig = LimaConfig.getInstance(); + LimaSwingConfig limaSwingConfig = LimaSwingConfig.getInstance(); - File limaStateFile = limaConfig.getLimaStateFile(); + File limaStateFile = limaSwingConfig.getLimaStateFile(); return limaStateFile; } public void changeLanguage(MainView mainUI, Locale newLocale) { - LimaConfig config = mainUI.getConfig(); + LimaSwingConfig config = mainUI.getConfig(); // sauvegarde de la nouvelle locale config.setLocale(newLocale); @@ -155,11 +155,11 @@ public void showConfig(JAXXContext context) { MainView ui = getUI(context); - final LimaConfig config = ui.getConfig(); + final LimaSwingConfig config = ui.getConfig(); ConfigUIHelper helper = new ConfigUIHelper(config); - helper.registerCallBack(LimaConfig.Option.COLOR_SELECTION_FOCUS.key, t("lima.config.colorselectionfocus"), new ImageIcon(), new Runnable() { + helper.registerCallBack(LimaSwingConfig.Option.COLOR_SELECTION_FOCUS.getKey(), t("lima.config.colorselectionfocus"), new ImageIcon(), new Runnable() { @Override public void run() { UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(config.getColorSelectionFocus(), 2))); @@ -167,92 +167,92 @@ }); helper.addCategory(t("lima.config.category.directories"), t("lima.config.category.directories.description")); - helper.addOption(LimaConfig.Option.CONFIG_FILE); - helper.setOptionShortLabel(LimaConfig.Option.CONFIG_FILE.getLabel()); + helper.addOption(LimaSwingConfig.Option.CONFIG_FILE); + helper.setOptionShortLabel(LimaSwingConfig.Option.CONFIG_FILE.getLabel()); helper.addCategory(t("lima.config.category.table"), t("lima.config.category.table.description")); - helper.addOption(LimaConfig.Option.TABLE_CELL_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_SELECTED_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_SELECTED_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_SELECTED_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_SELECTED_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_ERROR_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_ERROR_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_ERROR_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_ERROR_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_ERROR_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_ERROR_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_ERROR_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_ERROR_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_SELECTED_ERROR_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_SELECTED_ERROR_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_SELECTED_ERROR_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_SELECTED_ERROR_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_MANDATORY_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_MANDATORY_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_MANDATORY_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_MANDATORY_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_MANDATORY_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_MANDATORY_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_MANDATORY_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_MANDATORY_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_SELECTED_MANDATORY_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_SELECTED_MANDATORY_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_SELECTED_MANDATORY_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_SELECTED_MANDATORY_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND.getLabel()); - helper.addOption(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND); - helper.setOptionShortLabel(LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND.getLabel()); - helper.addOption(LimaConfig.Option.COLOR_SELECTION_FOCUS); - helper.setOptionShortLabel(LimaConfig.Option.COLOR_SELECTION_FOCUS.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_SELECTED_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_SELECTED_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_SELECTED_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_SELECTED_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_ERROR_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_ERROR_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_ERROR_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_ERROR_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_ERROR_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_ERROR_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_ERROR_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_ERROR_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_SELECTED_ERROR_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_SELECTED_ERROR_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_SELECTED_ERROR_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_SELECTED_ERROR_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_MANDATORY_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_MANDATORY_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_MANDATORY_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_MANDATORY_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_MANDATORY_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_MANDATORY_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_MANDATORY_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_MANDATORY_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_SELECTED_MANDATORY_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_SELECTED_MANDATORY_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_SELECTED_MANDATORY_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_SELECTED_MANDATORY_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND); + helper.setOptionShortLabel(LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND.getLabel()); + helper.addOption(LimaSwingConfig.Option.COLOR_SELECTION_FOCUS); + helper.setOptionShortLabel(LimaSwingConfig.Option.COLOR_SELECTION_FOCUS.getLabel()); helper.addCategory(t("lima.config.category.other"), t("lima.config.category.other.description")); - helper.addOption(LimaConfig.Option.LOCALE); - helper.setOptionShortLabel(LimaConfig.Option.LOCALE.getLabel()); + helper.addOption(LimaSwingConfig.Option.LOCALE); + helper.setOptionShortLabel(LimaSwingConfig.Option.LOCALE.getLabel()); - JComboBox<Character> comboBoxSeparator = new JComboBox<Character>(LimaConfig.NUMBER_SEPARATOR.toArray(new Character[LimaConfig.NUMBER_SEPARATOR.size()])); + JComboBox<Character> comboBoxSeparator = new JComboBox<Character>(LimaSwingConfig.NUMBER_SEPARATOR.toArray(new Character[LimaSwingConfig.NUMBER_SEPARATOR.size()])); DefaultCellEditor separatorEditor = new DefaultCellEditor(comboBoxSeparator); comboBoxSeparator.setRenderer(new NumberSeparatorCellRenderer()); NumberSeparatorTableCellRenderer separatorRenderer = new NumberSeparatorTableCellRenderer(); - helper.addOption(LimaConfig.Option.DECIMAL_SEPARATOR); - helper.setOptionShortLabel(LimaConfig.Option.DECIMAL_SEPARATOR.getLabel()); + helper.addOption(LimaSwingConfig.Option.DECIMAL_SEPARATOR); + helper.setOptionShortLabel(LimaSwingConfig.Option.DECIMAL_SEPARATOR.getLabel()); helper.setOptionRenderer(separatorRenderer); helper.setOptionEditor(separatorEditor); - JComboBox<Integer> comboBoxDecimal = new JComboBox<Integer>(LimaConfig.NUMBER_DECIMALS.toArray(new Integer[LimaConfig.NUMBER_DECIMALS.size()])); + JComboBox<Integer> comboBoxDecimal = new JComboBox<Integer>(LimaSwingConfig.NUMBER_DECIMALS.toArray(new Integer[LimaSwingConfig.NUMBER_DECIMALS.size()])); DefaultCellEditor decimalEditor = new DefaultCellEditor(comboBoxDecimal); - helper.addOption(LimaConfig.Option.SCALE); - helper.setOptionShortLabel(LimaConfig.Option.SCALE.getLabel()); + helper.addOption(LimaSwingConfig.Option.SCALE); + helper.setOptionShortLabel(LimaSwingConfig.Option.SCALE.getLabel()); helper.setOptionEditor(decimalEditor); - helper.addOption(LimaConfig.Option.THOUSAND_SEPARATOR); - helper.setOptionShortLabel(LimaConfig.Option.THOUSAND_SEPARATOR.getLabel()); + helper.addOption(LimaSwingConfig.Option.THOUSAND_SEPARATOR); + helper.setOptionShortLabel(LimaSwingConfig.Option.THOUSAND_SEPARATOR.getLabel()); helper.setOptionRenderer(separatorRenderer); helper.setOptionEditor(separatorEditor); - helper.addOption(LimaConfig.Option.CURRENCY); - helper.setOptionShortLabel(LimaConfig.Option.CURRENCY.getLabel()); + helper.addOption(LimaSwingConfig.Option.CURRENCY); + helper.setOptionShortLabel(LimaSwingConfig.Option.CURRENCY.getLabel()); /*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.SELECT_ALL_EDITING_CELL); - helper.setOptionShortLabel(LimaConfig.Option.SELECT_ALL_EDITING_CELL.getLabel()); + helper.addOption(LimaSwingConfig.Option.SELECT_ALL_EDITING_CELL); + helper.setOptionShortLabel(LimaSwingConfig.Option.SELECT_ALL_EDITING_CELL.getLabel()); helper.buildUI(context, t("lima.config.category.directories")); helper.displayUI(ui, false); @@ -260,7 +260,7 @@ public void gotoSite(JAXXContext context) { - LimaConfig config = getUI(context).getConfig(); + LimaSwingConfig config = getUI(context).getConfig(); URL siteURL = config.getOptionAsURL("application.site.url"); try { @@ -487,7 +487,7 @@ public void loadURI(MainView ui) { int port = LimaServiceFactory.getService( HttpServerService.class).getHttpPort(); - String address = LimaConfig.getInstance().getHostAdress(); + String address = LimaSwingConfig.getInstance().getHostAdress(); String url = "http://" + address + ":" + port + "/"; if (log.isDebugEnabled()) { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/account/AccountViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -27,7 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.ImportService; @@ -121,7 +121,7 @@ // Gets factory service LimaServiceFactory.addServiceListener(ImportService.class, this); accountService = LimaServiceFactory.getService(AccountService.class); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } /** 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 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -26,8 +26,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaSwingApplicationContext; +import org.chorem.lima.LimaSwingConfig; import javax.swing.*; import java.awt.event.KeyEvent; @@ -81,7 +81,7 @@ BigDecimal cellEditorValue; int pointIndex = stringValue.indexOf("."); if (pointIndex != -1) { - LimaConfig config = LimaSwingApplicationContext.getContext().getConfig(); + LimaSwingConfig config = LimaSwingApplicationContext.getContext().getConfig(); String actualDecimals = stringValue.substring(pointIndex, stringValue.length()-1); if (config.getScale() > actualDecimals.length()) { cellEditorValue = new BigDecimal(stringValue); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellRenderer.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellRenderer.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellRenderer.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -24,8 +24,8 @@ */ package org.chorem.lima.ui.celleditor; -import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaSwingApplicationContext; +import org.chorem.lima.LimaSwingConfig; import javax.swing.*; import java.awt.*; @@ -39,7 +39,7 @@ public static String format(BigDecimal value) { - LimaConfig config = LimaSwingApplicationContext.getContext().getConfig(); + LimaSwingConfig config = LimaSwingApplicationContext.getContext().getConfig(); StringBuilder scale = new StringBuilder(); for (int i = 0; i < config.getScale(); i++) { scale.append("0"); 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 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -28,8 +28,8 @@ import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaSwingApplicationContext; +import org.chorem.lima.LimaSwingConfig; import org.jdesktop.swingx.JXDatePicker; import javax.swing.*; @@ -118,7 +118,7 @@ SwingUtilities.invokeLater(new Runnable() { public void run() { JFormattedTextField dateFormattedTextField = datePicker.getEditor(); - LimaConfig config = LimaConfig.getInstance(); + LimaSwingConfig config = LimaSwingConfig.getInstance(); if (config.isSelectAllEditingCell()) { dateFormattedTextField.selectAll(); } else { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DefaultLimaTableCellRenderer.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DefaultLimaTableCellRenderer.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DefaultLimaTableCellRenderer.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -24,7 +24,7 @@ * #L% */ -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.ui.common.TableModelWithGroup; import javax.swing.*; @@ -64,12 +64,12 @@ line = model.indexInGroup(row); } - LimaConfig limaConfig = LimaConfig.getInstance(); + LimaSwingConfig limaSwingConfig = LimaSwingConfig.getInstance(); // border Border border = BorderFactory.createEmptyBorder(1, 1, 1, 1); if (hasFocus) { - Color color = limaConfig.getOptionAsColor(LimaConfig.Option.COLOR_SELECTION_FOCUS.key); + Color color = limaSwingConfig.getOptionAsColor(LimaSwingConfig.Option.COLOR_SELECTION_FOCUS.getKey()); border = BorderFactory.createLineBorder(color, 2); } else if (line == 0 && table.getModel() instanceof TableModelWithGroup) { border = BorderFactory.createMatteBorder(1, 0, 0, 0, Color.BLACK); @@ -79,61 +79,61 @@ // color - LimaConfig.Option backgroundOption; - LimaConfig.Option foreGroundOption; + LimaSwingConfig.Option backgroundOption; + LimaSwingConfig.Option foreGroundOption; if ((line & 1) == 1 || line % 2 == 1) { if (isSelected) { if (errorDetector.isError(table, value, row, column)) { - backgroundOption = LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_ERROR_FOREGROUND; } else if (isMandatory(table, value, row, column)){ - backgroundOption = LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_MANDATORY_FOREGROUND; } else { - backgroundOption = LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_PAIR_SELECTED_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_SELECTED_FOREGROUND; } } else { if (errorDetector.isError(table, value, row, column)) { - backgroundOption = LimaConfig.Option.TABLE_CELL_PAIR_ERROR_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_PAIR_ERROR_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_ERROR_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_ERROR_FOREGROUND; } else if (isMandatory(table, value, row, column)){ - backgroundOption = LimaConfig.Option.TABLE_CELL_PAIR_MANDATORY_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_PAIR_MANDATORY_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_MANDATORY_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_MANDATORY_FOREGROUND; } else { - backgroundOption = LimaConfig.Option.TABLE_CELL_PAIR_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_PAIR_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_PAIR_FOREGROUND; } } } else { if (isSelected) { if (errorDetector.isError(table, value, row, column)) { - backgroundOption = LimaConfig.Option.TABLE_CELL_SELECTED_ERROR_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_SELECTED_ERROR_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_SELECTED_ERROR_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_SELECTED_ERROR_FOREGROUND; } else if (isMandatory(table, value, row, column)){ - backgroundOption = LimaConfig.Option.TABLE_CELL_SELECTED_MANDATORY_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_SELECTED_MANDATORY_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_SELECTED_MANDATORY_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_SELECTED_MANDATORY_FOREGROUND; } else { - backgroundOption = LimaConfig.Option.TABLE_CELL_SELECTED_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_SELECTED_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_SELECTED_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_SELECTED_FOREGROUND; } } else { if (errorDetector.isError(table, value, row, column)) { - backgroundOption = LimaConfig.Option.TABLE_CELL_ERROR_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_ERROR_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_ERROR_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_ERROR_FOREGROUND; } else if (isMandatory(table, value, row, column)){ - backgroundOption = LimaConfig.Option.TABLE_CELL_MANDATORY_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_MANDATORY_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_MANDATORY_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_MANDATORY_FOREGROUND; } else { - backgroundOption = LimaConfig.Option.TABLE_CELL_BACKGROUND; - foreGroundOption = LimaConfig.Option.TABLE_CELL_FOREGROUND; + backgroundOption = LimaSwingConfig.Option.TABLE_CELL_BACKGROUND; + foreGroundOption = LimaSwingConfig.Option.TABLE_CELL_FOREGROUND; } } } - myCell.setBackground(limaConfig.getOptionAsColor(backgroundOption.key)); - myCell.setForeground(limaConfig.getOptionAsColor(foreGroundOption.key)); + myCell.setBackground(limaSwingConfig.getOptionAsColor(backgroundOption.getKey())); + myCell.setForeground(limaSwingConfig.getOptionAsColor(foreGroundOption.getKey())); setValue(value); myCell.setText(text); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/StringTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/StringTableCellEditor.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/StringTableCellEditor.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -26,7 +26,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import javax.swing.*; import javax.swing.border.Border; @@ -106,7 +106,7 @@ * Two kinds of edition, with LimaConfig value * */ public void runEdition() { - LimaConfig config = LimaConfig.getInstance(); + LimaSwingConfig config = LimaSwingConfig.getInstance(); if (config.isSelectAllEditingCell()) { getComponent().selectAll(); } else { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractColumn.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractColumn.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractColumn.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -24,7 +24,7 @@ * #L% */ -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.util.ErrorHelper; import javax.swing.table.TableCellEditor; @@ -50,7 +50,7 @@ this.columnClass = columnClass; this.columnName = columnName; this.editable = editable; - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } public Class<?> getColumnClass() { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTableModel.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/AbstractLimaTableModel.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -25,7 +25,7 @@ */ import com.google.common.collect.Lists; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.util.ErrorHelper; import javax.swing.table.AbstractTableModel; @@ -56,7 +56,7 @@ columns = Lists.newArrayList(); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); initColumn(); 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-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -27,7 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.ImportService; @@ -74,7 +74,7 @@ this.view = view; entryBookService = LimaServiceFactory.getService(EntryBookService.class); LimaServiceFactory.addServiceListener(ImportService.class, this); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } public void init() { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -28,7 +28,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.FinancialPeriodService; import org.chorem.lima.business.api.FiscalPeriodService; @@ -79,7 +79,7 @@ financialPeriodService = LimaServiceFactory.getService(FinancialPeriodService.class); LimaServiceFactory.addServiceListener(ImportService.class, this); LimaServiceFactory.addServiceListener(FiscalPeriodService.class, this); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } /** Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTableModel.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -28,7 +28,7 @@ import com.google.common.collect.Lists; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.exceptions.AlreadyExistFinancialStatement; import org.chorem.lima.business.exceptions.NotAllowedLabelException; @@ -70,7 +70,7 @@ // Gets factory service financialStatementService = LimaServiceFactory.getService(FinancialStatementService.class); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -29,7 +29,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.FinancialPeriodService; @@ -106,7 +106,7 @@ LimaServiceFactory.addServiceListener(FinancialPeriodService.class, this); LimaServiceFactory.addServiceListener(FiscalPeriodService.class, this); LimaServiceFactory.addServiceListener(ImportService.class, this); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); initShortCuts(); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -27,7 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.exceptions.AfterLastFiscalPeriodException; import org.chorem.lima.business.exceptions.BeforeFirstFiscalPeriodException; import org.chorem.lima.business.exceptions.LockedEntryBookException; @@ -68,7 +68,7 @@ protected FinancialTransactionUnbalancedViewHandler(FinancialTransactionUnbalancedView view) { this.view = view; - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); initShortCuts(); } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -29,7 +29,7 @@ import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.FinancialTransactionService; import org.chorem.lima.business.api.FiscalPeriodService; @@ -92,7 +92,7 @@ financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class); LimaServiceFactory.addServiceListener(FiscalPeriodService.class, this); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } public void init() { Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/importexport/ImportExport.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -32,7 +32,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.LimaTechnicalException; import org.chorem.lima.business.ExportResult; import org.chorem.lima.business.ImportExportResults; @@ -120,7 +120,7 @@ //services importService = LimaServiceFactory.getService(ImportService.class); exportService = LimaServiceFactory.getService(ExportService.class); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); //create the wait dialog panel waitView = new ImportExportWaitView(); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -31,7 +31,7 @@ import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.chorem.lima.beans.LetteringFilterImpl; import org.chorem.lima.business.api.AccountService; import org.chorem.lima.business.api.EntryBookService; @@ -102,7 +102,7 @@ accountService = LimaServiceFactory.getService(AccountService.class); financialTransactionService = LimaServiceFactory.getService(FinancialTransactionService.class); entryBookService = LimaServiceFactory.getService(EntryBookService.class); - errorHelper = new ErrorHelper(LimaConfig.getInstance()); + errorHelper = new ErrorHelper(LimaSwingConfig.getInstance()); } /** Modified: trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2014-09-25 15:25:32 UTC (rev 3922) +++ trunk/lima-swing/src/main/java/org/chorem/lima/util/ErrorHelper.java 2014-09-26 09:10:52 UTC (rev 3923) @@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.commons.mail.EmailException; import org.apache.commons.mail.MultiPartEmail; -import org.chorem.lima.LimaConfig; +import org.chorem.lima.LimaSwingConfig; import org.jdesktop.swingx.JXErrorPane; import org.jdesktop.swingx.error.ErrorInfo; import org.jdesktop.swingx.error.ErrorReporter; @@ -62,9 +62,9 @@ /** Log. */ private static final Log log = LogFactory.getLog(ErrorHelper.class); - protected LimaConfig config; + protected LimaSwingConfig config; - public ErrorHelper(LimaConfig config) { + public ErrorHelper(LimaSwingConfig config) { this.config = config; }