Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 875 → Rev 876

/sun/xmleditor/trunk/src/gui/PopUpJTree.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.25 $
* @version $Revision: 1.26 $
*
* Last modification: $Date: 2003/07/26 15:02:42 $
* $Id: PopUpJTree.java,v 1.25 2003/07/26 15:02:42 smcsporr Exp $
* Last modification: $Date: 2003/07/28 11:14:28 $
* $Id: PopUpJTree.java,v 1.26 2003/07/28 11:14:28 smcsporr Exp $
*/
 
package src.gui;
25,16 → 25,16
 
import javax.swing.event.TreeSelectionListener;
 
/**
/**
* This class extends a <code>JTree</code>, which is used to display an XML file's
* data hierarchy, with a <code>JPopUpMenu</code>.
* The popup menu will appear, if the right mouse button will be clicked while
* holding the mouse cursor over the tree display area. Currently, functions are provided
* to insert and delete a tree element and to cut, copy and paste selected elements.
*
*
* @author Group 5
*
* @version $Revision: 1.25 $ Last modification: $Date: 2003/07/26 15:02:42 $
*
* @version $Revision: 1.26 $ Last modification: $Date: 2003/07/28 11:14:28 $
*/
class PopUpJTree extends JTree implements ActionListener {
69,7 → 69,7
* author Matthias Donner
*/
public PopUpJTree (src.parser.AdapterDomToTreeModel model) {
super(model);
super(model);
m=model;
// define the popup
/sun/xmleditor/trunk/src/gui/UpdateView.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.57 $
* @version $Revision: 1.56 $
*
* Last modification: $Date: 2003/07/28 13:20:45 $
* $Id: UpdateView.java,v 1.57 2003/07/28 13:20:45 smcsporr Exp $
* Last modification: $Date: 2003/07/26 13:05:25 $
* $Id: UpdateView.java,v 1.56 2003/07/26 13:05:25 smcsporr Exp $
*/
 
package src.gui;
47,7 → 47,7
*
* @author Christian Stollenwerk
*
* @version $Revision: 1.57 $ Last modification: $Date: 2003/07/28 13:20:45 $
* @version $Revision: 1.56 $ Last modification: $Date: 2003/07/26 13:05:25 $
*/
public class UpdateView implements ActionListener, UpdateViewInterface,
OurEventListener, TreeModelListener, TreeExpansionListener, TreeSelectionListener {
397,9 → 397,6
*/
private void validate() {
/* Update the document with the content of the plugin */
pluginManagerInterface.forcePluginReport();
/* Check, if a grammar has been specified. */
if ((documentManagerInterface.getActualDocument().getDocumentElement().hasAttribute("xsi:schemaLocation")) ||
(documentManagerInterface.getActualDocument().getDoctype() != null)) {
/sun/xmleditor/trunk/src/document/OurDocument.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.69 $
* @version $Revision: 1.70 $
*
* Last modification: $Date: 2003/07/26 13:23:58 $
* $Id: OurDocument.java,v 1.69 2003/07/26 13:23:58 smcsporr Exp $
* Last modification: $Date: 2003/07/26 15:35:53 $
* $Id: OurDocument.java,v 1.70 2003/07/26 15:35:53 smcsporr Exp $
*/
package src.document;
42,9 → 42,11
* is working on. Instances of this class are handled by the
* <code>DocumentManager</code>.
*
* @see src.control.DocumentManager
*
* @author S. McSporran
*
* @version $Revision: 1.69 $ Last modification: $Date: 2003/07/26 13:23:58 $
* @version $Revision: 1.70 $ Last modification: $Date: 2003/07/26 15:35:53 $
*/
public class OurDocument {
72,7 → 74,9
/** Indicates, if the current document has been changed. */
private boolean isChanged;
/** Used to save expanded tree nodes. */
private LinkedList visibleTree = new LinkedList();
private String xpathExpression = "";
/**
106,7 → 110,7
* The method <code>setVisibleTree</code> saves the currently expanded
* nodes.
*
* @param en: A <code>LinkedList</code> of visible <code>TreePath</code>s.
* @param en A <code>LinkedList</code> of visible <code>TreePath</code>s.
*
* @see java.util.LinkedList
* @see javax.swing.tree.TreePath
134,7 → 138,7
* The methode <code> setExpression </code> saves the Xpath
* expression in this instance of OurDocument
*
* @param expression: The XPath expression.
* @param expression The XPath expression.
*/
public void setExpression(String expression) {
if(expression != null) {
156,7 → 160,7
* This method sets an internal reference to the log panel that is used to
* output logging messages to inform the user about program events.
*
* @param log: A log panel implementation compliant to src.gui.LogInterface.
* @param log A log panel implementation compliant to src.gui.LogInterface.
*
* author S. McSporran
*
193,7 → 197,7
/**
* <code>setTitle</code> sets the title of a document.
*
* @param name: The new name of the document as <code>String</code>.
* @param name The new name of the document as <code>String</code>.
*
* Last revision: 24-Jun-2003
*/
205,7 → 209,7
* Sets a new DOM document object to be the new document in this <code>OurDocument</code>
* instance.
*
* @param document: The new document of this instance.
* @param document The new document of this instance.
*
* Last revision: 17-Jul-2003
*/
220,7 → 224,7
/**
* Sets the file name related to the current document.
*
* @param fName: The new file name.
* @param fName The new file name.
*
* @see java.io.File
*
254,15 → 258,14
* @param dtdFile The new schema's path and filename as <code>File</code>-object.
*
* @see java.io.File
* @see org.w3c.dom.Document
*
* author S. McSporran
*
* Last revision: 25-Jul-2003 by S. McSporran
* Last revision: 28-Jul-2003 by S. McSporran
*/
public void changeSchemaGrammar(DocumentImpl changeDoc, File schemaFile) {
 
final String defaultNS = "http://www.w3.org/2001/XMLSchema-instance";
 
/* Create an empty DOM document used as data container. */
DocumentImpl tempDocument = new DocumentImpl();
295,8 → 298,7
} else {
/* Set a default schemaLocation attribute when no targetNamespace was available. */
XMLRootElement.setAttribute("xsi:schemaLocation", defaultNS + " " +
schemaFile.getPath());
XMLRootElement.setAttribute("xsi:noNamespaceSchemaLocation", schemaFile.getPath());
}
}
/sun/xmleditor/trunk/src/control/DocumentManager.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.132 $
* @version $Revision: 1.133 $
*
* Last modification: $Date: 2003/07/26 15:56:11 $
* $Id: DocumentManager.java,v 1.132 2003/07/26 15:56:11 smcsporr Exp $
* Last modification: $Date: 2003/07/28 11:54:17 $
* $Id: DocumentManager.java,v 1.133 2003/07/28 11:54:17 swalkenh Exp $
*/
 
package src.control;
14,6 → 14,7
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
 
import java.io.File;
 
50,14 → 51,15
*
* @author Group 5
*
* @version $Revision: 1.132 $ Last modification: $Date: 2003/07/26 15:56:11 $
* @version $Revision: 1.133 $ Last modification: $Date: 2003/07/28 11:54:17 $
*/
public class DocumentManager implements ActionListener,DocumentManagerInterface,ChangeListener {
public class DocumentManager implements ActionListener, DocumentManagerInterface,
ChangeListener {
 
/** A Vector used to store a list of open documents. */
private Vector openDocumentList;
 
/** The global open dialog. Is made global to save last directory. */
/** The global open dialog. Is made global to save last directory. */
private JFileChooser fileChooserOpen;
 
/** A reference variable to the log panel. */
97,10 → 99,10
/** A parser, in this case used to parse a grammar (DTD or XML schema). */
private Parser grammarParser = new Parser();
 
/** Needed to check, whether auto validation is used. */
private boolean autoValidationFeature = true;
/** Indicates, if the auto validation feature is activated. */
private boolean autoValidationOn = true;
private int unNamedCounter = 0;
/** Instance variables for used file filters. */
321,6 → 323,18
}
}
/**/
if (event.getID() == ActionEvent.ITEM_EVENT_MASK) {
if (event == ItemEvent.SELECTED) {
autoValidationOn = true;
log(LogInterface.TYPE_INFO, "Auto-validation on.");
} else {
autoValidationOn = false;
log(LogInterface.TYPE_INFO, "Auto-validation off.");
}
}
/* Actions to perform if the user choosed to change the curent document's DTD. */
if (event.getActionCommand() == "Set DTD") {
setNewDTD();
477,20 → 491,6
return actualDocument.getFileName();
}
/**
* Returns the auto validation feature status.
*
* The program will validate after loading a file and after selecting another
* element in the tree structure, if auto validation is enabled. In disabled
* state, validation can be used by choosing the 'Validate' function manually.
*
* @return The current status of the auto validation feature. <code>true</code> if
* it is enabled, <code>false</code> otherwise.
*/
public boolean getAutoValidationStatus() {
return autoValidationFeature;
}
/**
* Returns the <code>PluginManagerInterface</code> saved in this instance.
* Needed to get access for plugins to pluin manager
821,8 → 821,6
updateView.update();
}
}
 
}
/**
840,7 → 838,6
/* Give a reference to the log panel to the parser. */
parser.setLogInterface(logInterfaceReference);
int returnValue = fileChooserOpen.showOpenDialog(rootFrame);
/* Case user has chosen a file. */
1463,6 → 1460,18
else {
return false;
}
}
 
/**
* Returns the status of the auto validation feature.
*
* The auto validation feature controls, whether the program will validate
* automatically after loading a file and when updating the treeview.
*
* @return A <code>boolean</code> value indicating if the auto validation
* feature is activated.
*/
public boolean getAutoValidation() {
return autoValidationOn;
}
}