package org.argeo.gis.ui.commands;
+import javax.jcr.Session;
+
import org.argeo.eclipse.ui.dialogs.Error;
import org.argeo.gis.ui.editors.DefaultMapEditor;
import org.argeo.gis.ui.editors.MapEditorInput;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.geotools.map.DefaultMapContext;
/** Opens a new map editor */
public class NewMap extends AbstractHandler {
+ private Session session;
private String editorId = DefaultMapEditor.ID;
public Object execute(ExecutionEvent event) throws ExecutionException {
HandlerUtil
.getActiveWorkbenchWindow(event)
.getActivePage()
- .openEditor(new MapEditorInput(new DefaultMapContext()),
+ .openEditor(new MapEditorInput(session.getRootNode()),
editorId);
} catch (Exception e) {
Error.show("Cannot open editor", e);
this.editorId = editorId;
}
+ public void setSession(Session session) {
+ this.session = session;
+ }
+
}