Changeset 529
- Timestamp:
- 01/21/10 00:03:11 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/jlatexeditor/JLatexEditorJFrame.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/jlatexeditor/JLatexEditorJFrame.java
r505 r529 22 22 import util.updater.ProgramUpdater; 23 23 24 import javax.annotation.Resource; 24 25 import javax.swing.*; 25 26 import javax.swing.event.ChangeEvent; 26 27 import javax.swing.event.ChangeListener; 28 import javax.swing.plaf.basic.BasicTabbedPaneUI; 27 29 import java.awt.*; 28 30 import java.awt.event.*; … … 477 479 if (resource instanceof UntitledDoc) { 478 480 UntitledDoc untitledDoc = (UntitledDoc) resource; 479 // TODO call save file dialog to assign a file to this new document 480 JOptionPane.showMessageDialog(this, "Saving new files not implemented yet."); 481 return false; 481 482 openDialog.showDialog(this, "Save"); 483 file = openDialog.getSelectedFile(); 484 if(file == null) return false; 485 486 if(file.exists()) { 487 int choice = JOptionPane.showOptionDialog( 488 this, 489 "The file exists! Do you want to overwrite the file?", 490 "File Exists", 491 JOptionPane.WARNING_MESSAGE, 492 JOptionPane.YES_NO_OPTION, 493 null, 494 new Object[] {"Overwrite", "Cancel"}, 495 2 496 ); 497 if(choice == 1) return false; 498 } 499 500 TabLabel tabLabel = (TabLabel) tabbedPane.getTabComponentAt(getTab(resource)); 501 resource = new FileDoc(file); 502 tabLabel.setResource(resource); 503 editor.setResource(resource); 482 504 } else 483 505 if (resource instanceof FileDoc) { … … 884 906 } 885 907 908 public AbstractResource getResource() { 909 return resource; 910 } 911 912 public void setResource(AbstractResource resource) { 913 this.resource = resource; 914 label.setText(resource.getName()); 915 } 916 886 917 public boolean contains(int x, int y) { 887 918 return x >= -4 && x <= getWidth() + 4 && y >= -2 && y <= getHeight() + 2;
![(please configure the [header_logo] section in trac.ini)](http://jlatexeditor.endrullis.de/chrome/site/logo.png)