Search in sources :

Example 1 with SaveData

use of alma.acs.alarmsystemprofiler.save.SaveData in project ACS by ACS-Community.

the class SaveHandler method execute.

@Execute
public void execute(Shell shell) {
    System.out.println("Saving...");
    FileDialog fileChooser = new FileDialog(shell, SWT.SAVE);
    String fileName = fileChooser.open();
    if (fileName == null) {
        System.out.println("No file to save");
    } else {
        System.out.println("File to save: " + fileName);
        File fileToSave = new File(fileName);
        try {
            SaveData saveHelper = new SaveData(SaveData.FileContentType.WIKI, fileToSave);
        } catch (Throwable t) {
            System.err.println(t.getMessage());
            t.printStackTrace(System.err);
        }
    }
}
Also used : FileDialog(org.eclipse.swt.widgets.FileDialog) File(java.io.File) SaveData(alma.acs.alarmsystemprofiler.save.SaveData) Execute(org.eclipse.e4.core.di.annotations.Execute)

Aggregations

SaveData (alma.acs.alarmsystemprofiler.save.SaveData)1 File (java.io.File)1 Execute (org.eclipse.e4.core.di.annotations.Execute)1 FileDialog (org.eclipse.swt.widgets.FileDialog)1