Search in sources :

Example 1 with IOCommand

use of org.malai.javafx.command.IOCommand in project latexdraw by arnobl.

the class FileLoaderSaver method onCmdDone.

@Override
public void onCmdDone(final Command cmd) {
    super.onCmdDone(cmd);
    fileMenu.hide();
    // Updating the recent files on I/O commands.
    if (cmd instanceof IOCommand && cmd.hadEffect()) {
        final IOCommand<?> ioCmd = (IOCommand<?>) cmd;
        currentFile = ioCmd.getFile();
        currentFolder = currentFile.getParentFile();
        if (!currentFile.getPath().endsWith(".svg")) {
            // $NON-NLS-1$
            // $NON-NLS-1$
            currentFile = new File(currentFile.getPath() + ".svg");
        }
        prefSetter.addRecentFile(((IOCommand<?>) cmd).getFile().getPath());
        updateRecentMenuItems(prefSetter.getRecentFileNames());
    }
}
Also used : IOCommand(org.malai.javafx.command.IOCommand) File(java.io.File)

Aggregations

File (java.io.File)1 IOCommand (org.malai.javafx.command.IOCommand)1