4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.120 $ |
* @version $Revision: 1.121 $ |
* |
* Last modification: $Date: 2003/07/25 12:39:49 $ |
* $Id: DocumentManager.java,v 1.120 2003/07/25 12:39:49 hjokusch Exp $ |
* Last modification: $Date: 2003/07/25 12:59:59 $ |
* $Id: DocumentManager.java,v 1.121 2003/07/25 12:59:59 hjokusch Exp $ |
*/ |
|
package src.control; |
50,7 → 50,7 |
* |
* @author Group 5 |
* |
* @version $Revision: 1.120 $ Last modification: $Date: 2003/07/25 12:39:49 $ |
* @version $Revision: 1.121 $ Last modification: $Date: 2003/07/25 12:59:59 $ |
*/ |
public class DocumentManager implements ActionListener,DocumentManagerInterface,ChangeListener { |
|
95,6 → 95,8 |
/** A parser, in this case used to parse a grammar (DTD or XML schema). */ |
private Parser grammarParser = new Parser(); |
|
private int unNamedCounter = 0; |
|
/** Instance variables for used file filters. */ |
private XMLExtensionFilter xmlFilter; |
private DTDExtensionFilter DTDFilter; |
289,6 → 291,17 |
if (event.getActionCommand() == "Set XML schema") { |
setNewSchema(); |
} |
|
/* Actions to perform if the user choosed to change the curent document's 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") { |
setNoSchema(); |
} |
|
} |
|
/** |
881,6 → 894,15 |
} |
} |
} |
|
public void setNoDTD(){ |
actualDocument.changeDTDGrammar(actualDocument.getDomDoc(),null); |
} |
|
public void setNoSchema(){ |
File x = null; |
actualDocument.changeSchemaGrammar(actualDocument.getDomDoc(),x); |
} |
|
/** |
* <code>setNewSchema</code> lets the user choose an XML schema file and launches a method in |
1020,7 → 1042,7 |
* Last revision: 10-Jul-2003 |
*/ |
public void makeNewDocument() { |
|
|
aDocumentFactory.makeDocument(); |
|
/* Set the new document as active document. */ |
1027,13 → 1049,13 |
openDocumentList.add(aDocumentFactory.getDocument()); |
actualDocument = (OurDocument)openDocumentList.lastElement(); |
actualDocument.setLogInterface(logInterfaceReference); |
|
unNamedCounter = unNamedCounter +1; |
/* Set title of the new document to 'Unnamed'. */ |
actualDocument.setTitle("Unnamed"); |
actualDocument.setTitle("Unnamed"+ unNamedCounter); |
|
/* Create a new Panel and add it as a new tab. */ |
JPanel panel = new JPanel(); |
pluginTabbedPane.addTab("Unnamed",panel); |
pluginTabbedPane.addTab("Unnamed"+ unNamedCounter,panel); |
pluginTabbedPane.setSelectedIndex(pluginTabbedPane.getTabCount()-1); |
|
updateView.update(); |