Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving the problem to export the file #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.TableColumn;
Expand Down Expand Up @@ -278,9 +279,18 @@ public void run() {

actionExport = new Action() {
public void run() {
String outputPath = "E:/Danilo/Temp/out.txt";
new EmrFileExporter(recomendations, outputPath).export();
showMessage(String.format("Data saved at %s", outputPath));
// This option put a static output path to save the file
//String outputPath = "E:/Danilo/Temp/out.txt";
//new EmrFileExporter(recomendations, outputPath).export();
//showMessage(String.format("Data saved at %s", outputPath));

// This option allows the user to select where will save the file
FileDialog fd = new FileDialog(getSite().getWorkbenchWindow().getShell());
fd.setText("Save Results");
String[] filterExt = { "*.txt" };
fd.setFilterExtensions(filterExt);
String selected = fd.open() + ".txt";
new EmrFileExporter(recomendations, selected).export();
}
};
actionExport.setText("Save to file");
Expand Down