FilterRanks.java
Go to the documentation of this file.00001 package edu.rice.cs.hpc.traceviewer.actions;
00002
00003 import org.eclipse.core.commands.AbstractHandler;
00004 import org.eclipse.core.commands.ExecutionEvent;
00005 import org.eclipse.core.commands.ExecutionException;
00006 import org.eclipse.jface.dialogs.Dialog;
00007 import org.eclipse.swt.widgets.Shell;
00008 import org.eclipse.ui.IWorkbenchWindow;
00009 import org.eclipse.ui.handlers.HandlerUtil;
00010 import org.eclipse.ui.services.ISourceProviderService;
00011
00012 import edu.rice.cs.hpc.data.experiment.extdata.IFilteredData;
00013 import edu.rice.cs.hpc.traceviewer.filter.FilterDialog;
00014 import edu.rice.cs.hpc.traceviewer.services.DataService;
00015 import edu.rice.cs.hpc.traceviewer.spaceTimeData.SpaceTimeDataController;
00016
00017
00018
00019
00020
00021
00022 public class FilterRanks extends AbstractHandler {
00023
00024
00025
00026 public Object execute(ExecutionEvent event) throws ExecutionException {
00027
00028 final Shell shell = HandlerUtil.getActiveShell(event);
00029 IWorkbenchWindow winObj = HandlerUtil.getActiveWorkbenchWindow(event);
00030 ISourceProviderService sourceProviderService = (ISourceProviderService) winObj.getService(
00031 ISourceProviderService.class);
00032
00033 DataService dataService = (DataService) sourceProviderService.getSourceProvider(DataService.DATA_PROVIDER);
00034 SpaceTimeDataController absData = dataService.getData();
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 IFilteredData filteredBaseData = absData.getFilteredBaseData();
00045 if (filteredBaseData == null){
00046 filteredBaseData = absData.createFilteredBaseData();
00047 }
00048
00049 FilterDialog dlgFilter = new FilterDialog(shell, filteredBaseData);
00050
00051 if (dlgFilter.open() == Dialog.OK){
00052
00053 absData.setBaseData(filteredBaseData);
00054
00055 dataService.broadcastUpdate(true);
00056 }
00057
00058 return null;
00059 }
00060
00061 }