示例#1
0
文件: CakeGUI.java 项目: rm5248/cake
 /** Save a file as something else. Called when the user goes to File -> Save As */
 public void saveFileAs() {
   JFileChooser chooser = new JFileChooser();
   chooser.addChoosableFileFilter(new CakeFileChooser());
   chooser.setDialogType(JFileChooser.SAVE_DIALOG);
   chooser.showSaveDialog(window);
   File f = chooser.getSelectedFile();
   if (f == null) return;
   try {
     if (calendar.getSettings().getName() == CakeCal.UNTITLED) {
       calendar.getSettings().setName(f.getName());
       parent.updateGUI(CakeCal.UNTITLED);
     }
     calendar.saveCal(f.getPath());
   } catch (IOException e) {
     System.out.println(e.getMessage());
   }
   calendar.getSettings().setFilename(f.getPath());
   // save.setEnabled(calendar.modified);
 }
示例#2
0
文件: CakeGUI.java 项目: rm5248/cake
 /** Called by the settings dialog when it is done getting the new settings. */
 public void finished() {
   parent.updateGUI();
 }