Search in sources :

Example 1 with MapTool

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);
    }
}
Also used : ISelectionProvider(org.eclipse.jface.viewers.ISelectionProvider) ISelectionService(org.eclipse.ui.ISelectionService) MapTool(de.fhg.igd.mapviewer.MapTool) ISelectionListener(org.eclipse.ui.ISelectionListener)

Aggregations

MapTool (de.fhg.igd.mapviewer.MapTool)1 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)1 ISelectionListener (org.eclipse.ui.ISelectionListener)1 ISelectionService (org.eclipse.ui.ISelectionService)1