# HG changeset patch # User Ingo Weinzierl # Date 1308749955 0 # Node ID 347cf4a5a4868a64b77df9ef5ec36e0738fb795c # Parent 1dbffe4c6d1204c056206df2764e97172488954e Open projects are removed from screen if the user deletes them (via project list). flys-client/trunk@2205 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1dbffe4c6d12 -r 347cf4a5a486 flys-client/ChangeLog --- a/flys-client/ChangeLog Wed Jun 22 12:50:20 2011 +0000 +++ b/flys-client/ChangeLog Wed Jun 22 13:39:15 2011 +0000 @@ -1,3 +1,15 @@ +2011-06-22 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/client/ui/ProjectList.java: + If an open project is removed (via context menu) the related + CollectionView is removed from screen. + + * src/main/java/de/intevation/flys/client/client/FLYS.java: Added a method + that returns the current FLYSWorkspace. + + * src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java: + Added a method that destroys a CollectionView if it is open. + 2011-06-22 Ingo Weinzierl * src/main/java/de/intevation/flys/client/server/DoCollectionAction.java: diff -r 1dbffe4c6d12 -r 347cf4a5a486 flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Wed Jun 22 12:50:20 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Wed Jun 22 13:39:15 2011 +0000 @@ -190,6 +190,16 @@ /** + * Returns the projects workspace that contains all project windows. + * + * @return the FLYSWorkspace. + */ + public FLYSWorkspace getWorkspace() { + return workspace; + } + + + /** * Returns a list of rivers supported by the artifact server. * * @return a list of rivers supported by the artifact server. diff -r 1dbffe4c6d12 -r 347cf4a5a486 flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java Wed Jun 22 12:50:20 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java Wed Jun 22 13:39:15 2011 +0000 @@ -60,5 +60,21 @@ view.show(); view.restore(); } + + + /** + * Removes a project from workspace (view) and clears its reference from + * hash map. + * + * @param uuid The project's uuid. + */ + public void destroyProject(String uuid) { + CollectionView project = views.get(uuid); + + if (project != null) { + removeProject(uuid); + project.destroy(); + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 1dbffe4c6d12 -r 347cf4a5a486 flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java Wed Jun 22 12:50:20 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java Wed Jun 22 13:39:15 2011 +0000 @@ -381,7 +381,7 @@ * * @param c The Collection that should be deleted. */ - protected void deleteCollection(Collection c) { + protected void deleteCollection(final Collection c) { if (c == null) { return; } @@ -402,6 +402,7 @@ } public void onSuccess(Void v) { + flys.getWorkspace().destroyProject(c.identifier()); updateUserCollections(); } });