use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.FilteredTableDataSet in project linuxtools by eclipse.
the class FilteredTableDataSetTest method setUp.
@Before
public void setUp() {
data = new TableDataSet(new String[] { "a", "b", "c" });
dataSet = new FilteredTableDataSet(data);
}
use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.FilteredTableDataSet in project linuxtools by eclipse.
the class ImportDataSetHandler method execute.
/**
* Import a data set from the specified path.
* @param path The path of the data set to import.
*/
public void execute(String path) {
IFilteredDataSet dataset = null;
File file = new File(path);
try (InputStreamReader fr = new InputStreamReader(new FileInputStream(file), Charset.defaultCharset());
BufferedReader br = new BufferedReader(fr)) {
String id = br.readLine();
// $NON-NLS-1$
String[] titles = br.readLine().split(", ");
if (id == null && titles == null) {
throw new IOException();
} else if (id.equals(RowDataSet.ID)) {
dataset = new FilteredRowDataSet(titles);
} else if (id.equals(TableDataSet.ID)) {
dataset = new FilteredTableDataSet(titles);
} else {
throw new IOException();
}
dataset.readFromFile(file);
String title = path.substring(path.lastIndexOf('/') + 1);
IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
GraphSelectorEditor ivp = (GraphSelectorEditor) p.openEditor(new GraphSelectorEditorInput(title), GraphSelectorEditor.ID);
ivp.createScriptSets(path, Arrays.asList(title), Arrays.asList(dataset));
} catch (FileNotFoundException fnfe) {
ExceptionErrorDialog.openError(Messages.ImportDataSetAction_FileNotFound, fnfe);
} catch (IOException ioe) {
ExceptionErrorDialog.openError(Messages.ImportDataSetAction_FileInvalid, ioe);
} catch (WorkbenchException we) {
ExceptionErrorDialog.openError(Messages.RunScriptChartHandler_couldNotSwitchToGraphicPerspective, we);
}
}
use of org.eclipse.linuxtools.systemtap.graphing.core.datasets.table.FilteredTableDataSet in project linuxtools by eclipse.
the class FilteredTableDataSetTest method testFilteredDataSet.
@Test
public void testFilteredDataSet() {
FilteredTableDataSet fds = new FilteredTableDataSet(new String[] { "a", "b", "c" });
assertNotNull(fds);
assertNotNull(fds.getTitles());
}
Aggregations