@SuppressWarnings("unchecked")
void setActiveTool( MapPart editor ) {
// ensure we are listening to this MapPart's Map
Map map = editor.getMap();
Adapter listener = getCommandListener(editor);
if (!map.eAdapters().contains(listener)){
map.eAdapters().add(listener);
}
// Define the tool context allowing tools to interact with this map
ToolContext tools = new ToolContextImpl();