4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.124 $ |
* @version $Revision: 1.125 $ |
* |
* Last modification: $Date: 2003/07/26 09:07:49 $ |
* $Id: DocumentManager.java,v 1.124 2003/07/26 09:07:49 smcsporr Exp $ |
* Last modification: $Date: 2003/07/26 10:00:43 $ |
* $Id: DocumentManager.java,v 1.125 2003/07/26 10:00:43 smcsporr Exp $ |
*/ |
|
package src.control; |
50,7 → 50,7 |
* |
* @author Group 5 |
* |
* @version $Revision: 1.124 $ Last modification: $Date: 2003/07/26 09:07:49 $ |
* @version $Revision: 1.125 $ Last modification: $Date: 2003/07/26 10:00:43 $ |
*/ |
public class DocumentManager implements ActionListener,DocumentManagerInterface,ChangeListener { |
|
247,11 → 247,11 |
|
/* If no filename has been specified, ask the user where to save. */ |
if (actualDocument.getFileName() == null) { |
saveActualDocumentAs(); |
saveActiveDocumentAs(); |
} |
else { |
/* If the filename of the active document is known, save. */ |
saveActualDocument(); |
saveActiveDocument(); |
} |
} |
} |
262,7 → 262,7 |
/* Check, if a document is available. */ |
if (! openDocumentList.isEmpty()) { |
/* Ask the user where to save the document. */ |
saveActualDocumentAs(); |
saveActiveDocumentAs(); |
} |
} |
|
293,12 → 293,12 |
} |
|
/* Actions to perform if the user choosed to change the curent document's DTD. */ |
if (event.getActionCommand() == "remove DTD") { |
if (event.getActionCommand() == "Remove DTD") { |
setNoDTD(); |
} |
|
/* Actions to perform if the user choosed to change the curent document's DTD. */ |
if (event.getActionCommand() == "remove XML Schema") { |
if (event.getActionCommand() == "Remove XML schema") { |
setNoSchema(); |
} |
|
514,7 → 514,9 |
} |
|
/** |
* The method <code>changeToDocument</code> changes the currently shown |
* <code>changeToDocument</code> changes the active document. |
* |
* The active document is the document currently shown |
* document to the document with the name in the parameter. |
* |
* @param name: The title of a document in the <code>openDocumentList</code> |
689,7 → 691,7 |
// User confirms: Save the document and then close it |
if (x == JOptionPane.YES_OPTION) { |
|
saveActualDocument(); |
saveActiveDocument(); |
closeActualDocument(); |
updateView.update(); |
} |
971,7 → 973,7 |
} |
|
/** |
* <code>saveActualDocument</code> launches a method that saves the active document. |
* <code>saveActiveDocument</code> launches a method that saves the active document. |
* This is a kind of a quicksave function and can only be used if the corresponding |
* file name of the current document is available. |
* |
979,7 → 981,7 |
* |
* Last revision: 23-Jul-2003 |
*/ |
public void saveActualDocument() { |
public void saveActiveDocument() { |
|
if (! openDocumentList.isEmpty()) { |
|
1002,7 → 1004,7 |
} |
|
/** |
* <code>saveActualDocumentAs</code> saves the active document in a specified file |
* <code>saveActiveDocumentAs</code> saves the active document in a specified file |
* chosen by the user. |
* |
* author S. McSporran |
1009,7 → 1011,7 |
* |
* Last revision: 23-Jul-2003 |
*/ |
public void saveActualDocumentAs() { |
public void saveActiveDocumentAs() { |
|
boolean confirmed = false; |
|
1319,11 → 1321,11 |
|
/** |
* This method saves all opened documents using the methods |
* <code>saveActualDocument</code> and, if the actual document doesn't |
* exist as saved document, <code>saveActualDocumentAs</code>. |
* <code>saveActiveDocument</code> and, if the actual document doesn't |
* exist as saved document, <code>saveActiveDocumentAs</code>. |
* |
* @see src.control.DocumentManager#saveActualDocument |
* @see src.control.DocumentManager#saveActualDocumentAs |
* @see src.control.DocumentManager#saveActiveDocument |
* @see src.control.DocumentManager#saveActiveDocumentAs |
* |
* author H. Jakusch |
* |
1340,10 → 1342,10 |
for(int i=0; i < openDocumentList.size()-1; ++i) { |
changeToDocument(((OurDocument)(openDocumentList.get(i))).getTitle()); |
if (actualDocument.getFileName() == null) { |
saveActualDocumentAs(); |
saveActiveDocumentAs(); |
} else { |
/* If the filename of the active document is known, save. */ |
saveActualDocument(); |
saveActiveDocument(); |
} |
} |
// Return to the formerly selected document. |