Panagiotis,

Thank you so much for the reply!

I am testing out what your suggestions to the solution.

Could you give me more guidance on what was involved in subclassing MapEditor.  
It seems so integral to uDig that I was worried that subclassing it would 
entail many messy changes.  Did you find that to be the case?

Thanks again for your time and help!

Kory

____________________________________________________________________________


  1. Re: Modifying MapEditor Class - Remove Asterisk and       AutoSave
     (Panagiotis Skintzos)
  2. Re: Map viewer and jai (Juho Kokkonen)


----------------------------------------------------------------------

Message: 1
Date: Wed, 25 Jul 2012 14:12:50 +0200
From: Panagiotis Skintzos <[email protected]<mailto:[email protected]>>
Subject: Re: [udig-devel] Modifying MapEditor Class - Remove Asterisk
        and     AutoSave
To: User-friendly Desktop Internet GIS
        
<[email protected]<mailto:[email protected]>>
Message-ID:
        
<CAHLYV9hPmEWvR127RV8P3=cjqbynwv8r4muhr0zbnebhwk+...@mail.gmail.com<mailto:CAHLYV9hPmEWvR127RV8P3=cjqbynwv8r4muhr0zbnebhwk%[email protected]>>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I had the same problem and for various reasons I didn't want to use a view
for the map window.
I found a solution (the Asterisk remains but doesn't bother me):
- First of all to prevent Eclipse reopening the editors add this preference
line to plugin_customization.ini file (in the root of the main plugin):
org.eclipse.ui/CLOSE_EDITORS_ON_EXIT = true

- I create one Project per logged-in user and one Map per project.
They are loaded or created when the user logs in.

- You might want to disable the "Project explorer" view, so that users
can't create a new Map window.
Filtering Eclipse plugin elements is another topic and there are two ways
to achieve it
a) Activities extension point
b) Equinox transforms (http://wiki.eclipse.org/Equinox_Transforms)
I use the second option to filter out some uDig/Eclipse views/extensions
which I don't want them present in the UI.

- I subclass the MapEditor class and implement the ISaveablePart2 interface.
I override the
"doSave","isSaveAsAllowed","isSaveOnCloseNeeded","promptToSaveOnClose" and
create a custom "SaveMapRunnable" class.
I basically make the editor not closable (and "save as" able) in normal
conditions.
When the workbench goes for shutdown, I save the custom layers that I want
and then I enable the closing of the MapEditor.

- To prevent the "New Editor" menu option in the editors context menu, I
declare an empty handler for "org.eclipse.ui.window.newEditor" command and
set it to always active and always disabled:

<handler class="***.ui.internal.handlers.DisabledHandler"
commandId="org.eclipse.ui.window.newEditor">
      <enabledWhen><count value="-1"/></enabledWhen>
      <activeWhen><not><count value="-1"/></not></activeWhen>
   </handler>

- Depending on the layers you have on the MapEditor the asterisk will show
if the map is dirty.
I use some temporary layers so the asterisk is always present. But in the
end it doesn't bother me or the customer.

Hope this helps,
Panagiotis Skintzos

On Tue, Jul 24, 2012 at 3:26 AM, Kory Kraft 
<[email protected]<mailto:[email protected]>> wrote:

>  I am currently working on a research project at Furman University
> utilizing uDig.
>
>  I am trying using the MapEditor class to display an interactive map that
> displays real-time scheduling.
>
>  The current problem I am experiencing relates to the open-save-close
> life-cycle of the MapEditor class.  Every time the user starts the program,
> I want there to only be one MapEditor in the workbench, however, when the
> application opens, the program brings up the old MapEditor as well.  Added
> to this are a few other features that I would like to be able to disable.
>  I would like the user to be able to close the entire application without
> the program asking if the user would like to save the map.  I would also
> like to disable the asterisk that displays when the editor "isDirty".
>
>  After a little bit of searching, I found a thread on the refractions
> forum that related to the same problem I am experiencing, however the
> poster never revealed his/her final solution (if any).
>
>  Thus, I figured I would try an email you for your expertise and see if
> you could point me in the right direction as to how to solve this problem.
>
>  Thank you so much for taking the time to read this email!
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to