use of de.fhg.igd.mapviewer.MapTool in project hale by halestudio.
the class ExtendedMapKit method setMapTool.
/**
* @see BasicMapKit#setMapTool(MapTool)
*/
@Override
public void setMapTool(MapTool tool) {
ISelectionService service = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
MapTool oldTool = getMapTool();
if (oldTool != null && oldTool instanceof ISelectionListener) {
service.removeSelectionListener((ISelectionListener) oldTool);
}
super.setMapTool(tool);
if (tool instanceof ISelectionListener) {
service.addSelectionListener((ISelectionListener) tool);
}
// set the tool as selection provider
if (tool instanceof ISelectionProvider) {
view.setSelectionProvider((ISelectionProvider) tool);
} else {
view.setSelectionProvider(null);
}
}
Aggregations