Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 67ab0c5b by Tony CHEMIT at 2018-10-02T11:50:10Z [V8-A3] Ouverture (migration) de bases locales V5 impossible - Closes #1105 - - - - - 2 changed files: - client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java - client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java Changes: ===================================== client-configuration/src/main/java/fr/ird/observe/client/configuration/ClientConfig.java ===================================== @@ -8,12 +8,12 @@ * 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>. @@ -30,6 +30,8 @@ import fr.ird.observe.client.constants.DbMode; import fr.ird.observe.dto.FloatingObjectPreset; import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration; import fr.ird.observe.dto.presets.ServerDataSourceConfiguration; +import fr.ird.observe.navigation.model.edit.ObserveEditModel; +import fr.ird.observe.navigation.model.select.ObserveSelectModel; import fr.ird.observe.services.gson.ObserveDtoGsonSupplier; import io.ultreia.java4all.config.ApplicationConfig; import io.ultreia.java4all.config.ApplicationConfigInit; @@ -104,14 +106,14 @@ public class ClientConfig extends GeneratedClientConfig implements NavigationTre //FIXME private final ImmutableSet<String> longlineVesselTypeIds = ImmutableSet.copyOf( Sets.newHashSet("fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.044156847891821505", - "fr.ird.observe.entities.referentiel.VesselType#1239832675736#0.8708229847859869", - "fr.ird.observe.entities.referentiel.VesselType#1239832686137#0.1")); + "fr.ird.observe.entities.referentiel.VesselType#1239832675736#0.8708229847859869", + "fr.ird.observe.entities.referentiel.VesselType#1239832686137#0.1")); private final ImmutableSet<String> seineVesselTypeIds = ImmutableSet.copyOf( Sets.newHashSet("fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.044156847891821505", - "fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.307197212385357", - "fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.7380146830307519", - "fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.9086075071905084", - "fr.ird.observe.entities.referentiel.VesselType#1239832675737#0.43324169605639407")); + "fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.307197212385357", + "fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.7380146830307519", + "fr.ird.observe.entities.referentiel.VesselType#1239832675735#0.9086075071905084", + "fr.ird.observe.entities.referentiel.VesselType#1239832675737#0.43324169605639407")); private final SimpleDateFormat dateFormat = new SimpleDateFormat(); /** * un drapeau pour savoir s'il faut lancer l'interface graphique. Cette @@ -148,10 +150,6 @@ public class ClientConfig extends GeneratedClientConfig implements NavigationTre private ImmutableList<RemoteDataSourceConfiguration> remoteDataSourceConfigurationList; private ObserveDtoGsonSupplier gsonSupplier; - static ClientConfig forTest() { - return new ClientConfig(ApplicationConfigInit.forAllScopesWithout(ApplicationConfigScope.HOME, ApplicationConfigScope.ENV, ApplicationConfigScope.SYSTEM),DEFAULT_OBSERVE_SWING_CONFIGURATION_FILENAME); - } - public ClientConfig() { this(DEFAULT_OBSERVE_SWING_CONFIGURATION_FILENAME); } @@ -162,13 +160,17 @@ public class ClientConfig extends GeneratedClientConfig implements NavigationTre delegate.setConfigFileName(configFileName); } - private ClientConfig(ApplicationConfigInit init,String configFileName) { + private ClientConfig(ApplicationConfigInit init, String configFileName) { super(init); ApplicationConfig delegate = get(); delegate.setEncoding(StandardCharsets.UTF_8.name()); delegate.setConfigFileName(configFileName); } + static ClientConfig forTest() { + return new ClientConfig(ApplicationConfigInit.forAllScopesWithout(ApplicationConfigScope.HOME, ApplicationConfigScope.ENV, ApplicationConfigScope.SYSTEM), DEFAULT_OBSERVE_SWING_CONFIGURATION_FILENAME); + } + @Override protected Supplier<Gson> getGsonSupplier() { return gsonSupplier == null ? gsonSupplier = new ObserveDtoGsonSupplier() : gsonSupplier; @@ -217,7 +219,7 @@ public class ClientConfig extends GeneratedClientConfig implements NavigationTre applicationConfig.setDefaultOption(APPLICATION_VERSION, version.getVersion()); } applicationConfig.parse(args); - if (version ==null) { + if (version == null) { removeSnapshotFromVersion(); } } @@ -364,6 +366,16 @@ public class ClientConfig extends GeneratedClientConfig implements NavigationTre get().saveForUser(unsavables); } + public int getNavigationEditModelCount() { + ObserveEditModel model = getNavigationEditModel(); + return model == null ? 0 : model.count(); + } + + public int getNavigationSelectModelCount() { + ObserveSelectModel model = getNavigationSelectModel(); + return model == null ? 0 : model.count(); + } + public void removeJaxxPropertyChangeListener() { // pcs.getPropertyChangeListeners(); // List<String> tmp = new ArrayList<>(); ===================================== client/src/main/java/fr/ird/observe/client/ui/storage/StorageUIHandler.java ===================================== @@ -397,11 +397,11 @@ public class StorageUIHandler implements UIHandler<StorageUI> { if (DbMode.USE_LOCAL.equals((model.getDbMode()))) { stepsCount += 2; } - int openIds = config.getNavigationEditModel().count(); + int openIds = config.getNavigationEditModelCount(); if (openIds > 0) { stepsCount += 1 + openIds; } - int selectedIds = config.getNavigationSelectModel().count(); + int selectedIds = config.getNavigationSelectModelCount(); if (selectedIds > 0) { stepsCount += 1 + selectedIds; } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/67ab0c5b4461d062ffd1c8549d82... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/67ab0c5b4461d062ffd1c8549d82... You're receiving this email because of your account on gitlab.com.