Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/ImportDataSetHandler.java')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/ImportDataSetHandler.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/ImportDataSetHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/ImportDataSetHandler.java
index 5540e71f3c..4f8b2e1b7a 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/ImportDataSetHandler.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/ImportDataSetHandler.java
@@ -38,7 +38,7 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
/**
- * This <code>Action</code> imports data from an external file to populate
+ * This handler imports data from an external file to populate
* a {@link GraphSelectorEditor}.
* into an external file, which can be imported back in later.
*/
@@ -50,10 +50,17 @@ public class ImportDataSetHandler extends AbstractHandler {
dialog.setFilterExtensions(new String[]{Messages.DataSetFileExtension});
dialog.setText(Messages.ImportDataSetAction_DialogTitle);
String path = dialog.open();
- if (path == null) {
- return null;
+ if (path != null) {
+ execute(path);
}
+ return null;
+ }
+ /**
+ * 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());
@@ -83,8 +90,6 @@ public class ImportDataSetHandler extends AbstractHandler {
} catch (WorkbenchException we) {
ExceptionErrorDialog.openError(Messages.RunScriptChartHandler_couldNotSwitchToGraphicPerspective, we);
}
-
- return null;
}
}

Back to the top