createResources(resources, monitor);
IProject activeProject = ApplicationGIS.getActiveProject();
CreateMapCommand command = new CreateMapCommand("NewMap",resources , activeProject);
activeProject.sendSync(command);
Map createdMap = (Map) command.getCreatedMap();
viewer.setMap(createdMap);
viewer.init(this);
// ---------------
this.selectionProvider = new MapEditorSelectionProvider();
selectionProvider.setActiveMap(createdMap, this);
getSite().setSelectionProvider(selectionProvider);
selectionProvider.setSelection(new StructuredSelection(new Object[]{createdMap}));
createContextMenu();
if(acquireToolbar()) {
toolManager = ApplicationGIS.getToolManager();
IActionBars bars = getViewSite().getActionBars();
IToolBarManager toolbarManager = bars.getToolBarManager();
toolManager.contributeModalTools(toolbarManager, bars);
toolbarManager.add(new Separator());
toolManager.contributeActionTools(toolbarManager, bars);
toolManager.setCurrentEditor(this);
}
if(createdMap.getLayersInternal().size() > 0) {
createdMap.getEditManagerInternal().setSelectedLayer(createdMap.getLayersInternal().get(createdMap.getMapLayers().size()-1));
}
enableDropSupport();
initMap(createdMap);