Author: echatellier Date: 2012-08-17 11:00:05 +0200 (Fri, 17 Aug 2012) New Revision: 1051 Url: http://forge.codelutin.com/repositories/revision/coser/1051 Log: Correction sur la notification de chargement d'une selection Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2012-08-17 08:11:45 UTC (rev 1050) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2012-08-17 09:00:05 UTC (rev 1051) @@ -42,6 +42,7 @@ import javax.swing.filechooser.FileFilter; import jaxx.runtime.JAXXContext; +import jaxx.runtime.JAXXUtil; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; @@ -301,8 +302,7 @@ * Ferme le projet. */ public void closeProject() { - view.setProject(null); - view.removeContextValue(Project.class); + projectLoaded(null); view.setTitle(_("coser.ui.mainview.titleempty")); showHomeView(); } @@ -310,16 +310,34 @@ /** * Do some operation when a new project is loaded into application. * - * @param project loaded project + * @param project loaded project (can be null) */ public void projectLoaded(Project project) { view.setProject(project); - view.setSelection(null); // to update freize - view.setContextValue(project); - view.setTitle(_("coser.ui.mainview.titleproject", project.getName())); + if (project != null) { + view.setContextValue(project); + view.setTitle(_("coser.ui.mainview.titleproject", project.getName())); + } else { + view.removeContextValue(Project.class); + } + selectionLoaded(null); // to update freize } /** + * Do some operation when a new selection is loaded into application. + * + * @param selection loaded selection (can be null) + */ + public void selectionLoaded(Selection selection) { + view.setSelection(selection); // to update freize + if (selection != null) { + view.setContextValue(selection); + } else { + view.removeContextValue(Selection.class); + } + } + + /** * Affiche la fenêtre de résumé d'un projet. */ public void showSummaryView() { @@ -406,7 +424,7 @@ setWaitCursor(view); try { Selection selection = projectService.initProjectSelection(project); - view.setContextValue(selection); + selectionLoaded(selection); SelectionView selectionView = new SelectionView(view); selectionView.setSelection(selection); @@ -476,8 +494,7 @@ setWaitCursor(view); try { - view.setSelection(selection); // for freize - view.setContextValue(selection); + selectionLoaded(selection); SelectionView selectionView = new SelectionView(view); selectionView.setSelection(selection);
participants (1)
-
echatellier@users.forge.codelutin.com