]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - gis/plugins/org.argeo.gis.ui/src/main/java/org/argeo/gis/ui/commands/NewMap.java
1 package org
.argeo
.gis
.ui
.commands
;
3 import org
.argeo
.eclipse
.ui
.dialogs
.Error
;
4 import org
.argeo
.gis
.ui
.editors
.DefaultMapEditor
;
5 import org
.argeo
.gis
.ui
.editors
.MapEditorInput
;
6 import org
.eclipse
.core
.commands
.AbstractHandler
;
7 import org
.eclipse
.core
.commands
.ExecutionEvent
;
8 import org
.eclipse
.core
.commands
.ExecutionException
;
9 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
10 import org
.geotools
.map
.DefaultMapContext
;
12 /** Opens a new map editor */
13 public class NewMap
extends AbstractHandler
{
14 private String editorId
= DefaultMapEditor
.ID
;
16 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
19 .getActiveWorkbenchWindow(event
)
21 .openEditor(new MapEditorInput(new DefaultMapContext()),
23 } catch (Exception e
) {
24 Error
.show("Cannot open editor", e
);
29 public void setEditorId(String editorId
) {
30 this.editorId
= editorId
;