[Gvsig_desarrolladores] Proposed change to MDIManager API

Francisco Puga fpuga en cartolab.es
Vie Jul 8 16:15:46 CEST 2011


Hi,

Reviewing old gvSIG bug, i found this one.

http://forge.osor.eu/tracker/index.php?func=detail&aid=12265&group_id=89&atid=732

It's a bit annoying and it happens many times. There are many
approaches that if not solve it at least will minimize the number of
times that it happens. A resume of what it's happening is that many
times developers use the sentence below to get the view with the hope
that the active window is a view, but this not happens always, and an
exception is thrown.

View view = (View)PluginServices.getMDIManager().getActiveWindow();

Probably a good programming practice will be set the view in the
constructor or something like that, but anyway can be useful create a
new method like getViewWindows() in MDIManager, that returns the View
if it's active or a selection dialog with all the View Windows if none
of then is active. As it implies an API change i think that some
discussion is needed.

Feel free to comment the bug or send your opinions to this thread.

bests


-- 
Francisco Puga
Grupo de Desarrollo
Cartolab - Laboratorio de Ingeniería Cartográfica.
http://www.cartolab.es

ETS Ingeniería de Caminos, Canales y Puertos
Universidade da Coruña
Campus de Elviña - 15071 A Coruña (España)
(34)981167000 ext. 5493


Más información sobre la lista de distribución gvSIG_desarrolladores