private void saveAsDialog(){
        JFileChooser fileSave = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter(
                "Algorythm workspace files .wks", "wks");
        fileSave.setFileFilter(filter);
        fileSave.setDialogTitle("Save file...");
        if (fileSave.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
            openingFile = fileSave.getSelectedFile();
            if(saveWorkspace(openingFile))
                JOptionPane.showMessageDialog(this, "File saved!", "Save file",JOptionPane.INFORMATION_MESSAGE);
            else
                JOptionPane.showMessageDialog(this, "Save filed!", "Save file",JOptionPane.ERROR_MESSAGE);

        }
    }