Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

1 changed file:

Changes:

  • client-core/src/main/java/fr/ird/observe/client/main/callback/ReloadUiCallback.java
    ... ... @@ -27,6 +27,7 @@ import fr.ird.observe.client.ClientUIContext;
    27 27
     import fr.ird.observe.client.configuration.ClientConfig;
    
    28 28
     import fr.ird.observe.client.configuration.WithClientConfig;
    
    29 29
     import fr.ird.observe.client.main.ObserveMainUI;
    
    30
    +import fr.ird.observe.client.main.body.ClientConfigUI;
    
    30 31
     import fr.ird.observe.client.main.body.NoBodyContentComponent;
    
    31 32
     import io.ultreia.java4all.application.context.ApplicationContext;
    
    32 33
     import org.nuiton.jaxx.runtime.swing.SwingUtil;
    
    ... ... @@ -71,44 +72,24 @@ public class ReloadUiCallback implements ObserveUICallback, WithClientConfig {
    71 72
     
    
    72 73
             // scan main ui
    
    73 74
     
    
    74
    -//        ObserveSwingDataSource mainStorage = getObserveDataSourcesManager().getMainDataSource();
    
    75
    -
    
    76 75
             //FIXME:BodyContent, cela doit être délégué au body content concerné
    
    77 76
             Class<? extends JComponent> bodyContent = NoBodyContentComponent.class;
    
    78 77
             if (ui != null) {
    
    78
    +            // Keep a reference on ui instance since it will be reset in close method
    
    79
    +            // FIXME Should use a closing state in application to improve this
    
    80
    +            ObserveMainUI ui = this.ui;
    
    79 81
                 bodyContent = ui.getMainUIBodyContentManager().getCurrentBodyType();
    
    82
    +            if (ClientConfigUI.class.equals(bodyContent)) {
    
    83
    +                bodyContent = NoBodyContentComponent.class;
    
    84
    +            }
    
    80 85
                 ui.dispose();
    
    81
    -            ui.setVisible(false);
    
    82 86
                 System.runFinalization();
    
    83 87
             }
    
    84 88
     
    
    85
    -//        focusBorder = null;
    
    86
    -//        noFocusBorder = null;
    
    87 89
             ui = clientUIContext.initUI(rootContext, config);
    
    88 90
     
    
    89
    -        //FIXME:BodyContent : We must improve this, but for the moment, we could just open main ui empty...
    
    90
    -//        if (bodyContent  == null) {
    
    91
    -//            if (mainStorage == null) {
    
    92
    -//                bodyContent  = NoBodyContent.NoBodyContentComponent.class;
    
    93
    -//            } else {
    
    94
    -//                throw new IllegalStateException("Can't have a loaded database, but not loaded in gui...");
    
    95
    -//            }
    
    96
    -//        }
    
    97
    -
    
    98 91
             ui.changeBodyContent(bodyContent);
    
    99 92
     
    
    100
    -        //FIXME:BodyContent this will be done in data source editor body content
    
    101
    -//        if (oldMode == ObserveUIMode.DB) {
    
    102
    -//
    
    103
    -//            // on met à jour le modèle de navigation
    
    104
    -//            NavigationTreeModel treeModel = ui.getNavigationUI().getTree().getModel();
    
    105
    -//            treeModel.load(config);
    
    106
    -//            treeModel.populate(mainStorage);
    
    107
    -//
    
    108
    -//            // selection du noeud d'ouverture
    
    109
    -//            ui.getNavigationUI().getTree().selectInitialNode();
    
    110
    -//        }
    
    111
    -
    
    112 93
             // show ui
    
    113 94
             clientUIContext.setMainUIVisible(ui, true);
    
    114 95
         }