[Jsxe-cvs] SF.net SVN: jsxe: [1110] trunk/jsxe
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-08-08 00:07:54
|
Revision: 1110 Author: ian_lewis Date: 2006-08-07 17:07:37 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1110&view=rev Log Message: ----------- Added some Undo support Modified Paths: -------------- trunk/jsxe/AUTHORS trunk/jsxe/Changelog trunk/jsxe/messages/messages trunk/jsxe/src/net/sourceforge/jsxe/BufferHistory.java trunk/jsxe/src/net/sourceforge/jsxe/DocumentBuffer.java trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java trunk/jsxe/src/net/sourceforge/jsxe/dom/XMLDocument.java trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java trunk/jsxe/src/net/sourceforge/jsxe/msg/PropertyChanged.java trunk/jsxe/src/net/sourceforge/jsxe/properties Added Paths: ----------- trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/ trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/InsertEdit.java trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/RemoveEdit.java Modified: trunk/jsxe/AUTHORS =================================================================== --- trunk/jsxe/AUTHORS 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/AUTHORS 2006-08-08 00:07:37 UTC (rev 1110) @@ -4,7 +4,7 @@ Translators: German (de) - Bianca Schoen Swedish (sv) - Patrik Johansson <pa...@it...> + Russian (ru) - Alexandr Gridnev <ale...@ya...> Past Contributers:\n\ Aaron Flatten <afl...@us...> - Bilel Remmache <rb...@us...> - SVM <svm...@us...> + Bilel Remmache <rb...@us...> \ No newline at end of file Modified: trunk/jsxe/Changelog =================================================================== --- trunk/jsxe/Changelog 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/Changelog 2006-08-08 00:07:37 UTC (rev 1110) @@ -1,3 +1,7 @@ +08/07/2006 Ian Lewis <Ian...@me...> + + * Added temporary support for undo to jsXe. + 08/05/2006 Ian Lewis <Ian...@me...> * Added core support for Undo/Redo. Undo/Redo will temporarily be view @@ -6,7 +10,7 @@ 08/03/2006 Ian Lewis <Ian...@me...> - * Added Russian translation thanks to Segrer. + * Added Russian translation thanks to Alexandr Gridnev. 07/26/2006 Ian Lewis <Ian...@me...> Modified: trunk/jsxe/messages/messages =================================================================== --- trunk/jsxe/messages/messages 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/messages/messages 2006-08-08 00:07:37 UTC (rev 1110) @@ -283,8 +283,7 @@ \ \ \ \ Swedish (sv) - Patrik Johansson <pa...@it...>\n\n\ Past Contributers:\n\ \ \ \ \ Aaron Flatten <afl...@us...>\n\ - \ \ \ \ Bilel Remmache <rb...@us...>\n\ - \ \ \ \ SVM <svm...@us...>\n\n\ + \ \ \ \ Bilel Remmache <rb...@us...>\n\n\ Homepage: http://jsxe.sourceforge.net/ #}}} Modified: trunk/jsxe/src/net/sourceforge/jsxe/BufferHistory.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/BufferHistory.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/BufferHistory.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -239,7 +239,7 @@ // Enumeration propertyItr = props.keys(); // while (propertyItr.hasMoreElements()) { // String key = propertyItr.nextElement().toString(); - // if (!m_excludeKeys.contains(key)) { + // if (m_includeKeys.contains(key)) { // String value = props.getProperty(key); // out.write("<property name=\""); // out.write(key); @@ -304,7 +304,7 @@ Enumeration propertyItr = props.keys(); while (propertyItr.hasMoreElements()) { String key = propertyItr.nextElement().toString(); - if (!m_excludeKeys.contains(key)) { + if (m_includeKeys.contains(key)) { try { String value = props.getProperty(key); Element property = (Element)entryNode.appendChild(document.createElement("property")); @@ -453,7 +453,7 @@ propValue = attributes.getValue(i); } } - if (!m_excludeKeys.contains(propName) && propName != null && propValue != null) { + if (m_includeKeys.contains(propName) && propName != null && propValue != null) { m_m_properties.setProperty(propName, propValue); } } @@ -469,11 +469,16 @@ }//}}} private ArrayList m_history = new ArrayList(); - private static ArrayList m_excludeKeys; + private static ArrayList m_includeKeys; static { - m_excludeKeys = new ArrayList(); - m_excludeKeys.add(DocumentBuffer.LINE_SEPARATOR); + m_includeKeys = new ArrayList(); + m_includeKeys.add(DocumentBuffer.ENCODING); + m_includeKeys.add(DocumentBuffer.FORMAT_XML); + m_includeKeys.add(DocumentBuffer.WS_IN_ELEMENT_CONTENT); + m_includeKeys.add(DocumentBuffer.INDENT); + m_includeKeys.add(DocumentBuffer.IS_USING_SOFT_TABS); + m_includeKeys.add(DocumentBuffer.IS_VALIDATING); } //}}} Modified: trunk/jsxe/src/net/sourceforge/jsxe/DocumentBuffer.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/DocumentBuffer.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/DocumentBuffer.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -803,5 +803,6 @@ private ArrayList m_listeners = new ArrayList(); private boolean m_dirty=false; private OptionPane m_optionPane; + //}}} } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -67,11 +67,7 @@ //{{{ invoke() public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.redo if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+ActionManager.REDO_SUFFIX, evt); + view.getDocumentBuffer().redo(); }//}}} } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -46,8 +46,7 @@ //}}} /** - * The undo action invokes a DocumentView specific action defined for undo. - * The action should be defined by the view as <i>viewname</i>.undo + * The undo action invokes a undo on the current XMLDocument. * * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ @@ -67,11 +66,7 @@ //{{{ invoke() public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.undo if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+ActionManager.UNDO_SUFFIX, evt); + view.getDocumentBuffer().undo(); }//}}} } Modified: trunk/jsxe/src/net/sourceforge/jsxe/dom/XMLDocument.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/dom/XMLDocument.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/dom/XMLDocument.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -25,17 +25,16 @@ package net.sourceforge.jsxe.dom; //{{{ imports -/* -All classes are listed explicitly so -it is easy to see which package it -belongs to. -*/ //{{{ jsXe classes import net.sourceforge.jsxe.jsXe; +import net.sourceforge.jsxe.EditBus; +import net.sourceforge.jsxe.msg.RedoEvent; +import net.sourceforge.jsxe.msg.UndoEvent; import net.sourceforge.jsxe.util.Log; import net.sourceforge.jsxe.util.MiscUtilities; import net.sourceforge.jsxe.dom.completion.*; +import net.sourceforge.jsxe.dom.undo.*; //}}} //{{{ DOM classes @@ -69,6 +68,8 @@ import java.net.URI; //}}} +import javax.swing.undo.*; + //}}} /** @@ -164,6 +165,7 @@ setURI(uri); setModel(reader); reader.close(); + m_undoManager.setLimit(jsXe.getIntegerProperty("undo.limit", 100)); }//}}} //{{{ XMLDocument constructor @@ -189,29 +191,135 @@ setModel(reader); reader.close(); + m_undoManager.setLimit(jsXe.getIntegerProperty("undo.limit", 100)); }//}}} - //{{{ checkWellFormedness() + //{{{ undo methods + + //{{{ addUndoableEdit() /** - * Checks the wellformedness of the document and throws appropriate - * exceptions based on the errors encountered during parsing. - * @return true if the document is well formed. - * @throws SAXParseException if there was a SAX error when parsing. - * @throws SAXException if there was a problem with the SAX parser. - * @throws ParserConfigurationException if the parser is not configured properly - * @throws IOException if there was a problem reading the document + * Allows views and editors to add additional undoable events. Generally + * the edits added by classes that are not this class, classes in this + * package, or a subclass will not be significant. + * + * @return true if the edit was added successfully */ - public boolean checkWellFormedness() throws SAXParseException, SAXException, ParserConfigurationException, IOException { - if (!m_parsedMode) { - parseDocument(); - m_adapterNode = new AdapterNode(this, m_document); - // m_adapterNode.addAdapterNodeListener(docAdapterListener); - // m_syncedWithContent = true; - m_parsedMode=true; + public boolean addUndoableEdit(UndoableEdit edit) { + if (insideCompoundEdit()) { + m_addedToCompoundEdits = true; + return ((CompoundEdit)m_compoundEdits.peek()).addEdit(edit); + } else { + return m_undoManager.addEdit(edit); } - return m_parsedMode; }//}}} + //{{{ beginCompoundEdit() + /** + * Begins a compound edit. A compound edit is an edit that will be + * undone/redone all at once. + */ + public void beginCompoundEdit() { + Log.log(Log.DEBUG, this, "begin compound edit"); + m_addedToCompoundEdits = false; + m_compoundEdits.push(new CompoundEdit()); + }//}}} + + //{{{ endCompoundEdit() + /** + * Ends a compound edit. A compound edit is an edit that will be + * undone/redone all at once. + */ + public void endCompoundEdit() { + if (!insideCompoundEdit()) { + Log.log(Log.WARNING, this, new Exception("Unbalanced begin/endCompoundEdit()")); + return; + } + Log.log(Log.DEBUG, this, "end compound edit"); + if (m_addedToCompoundEdits) { + CompoundEdit edit = (CompoundEdit)m_compoundEdits.pop(); + edit.end(); + m_undoManager.addEdit(edit); + } + }//}}} + + //{{{ insideCompoundEdit() + /** + * Gets whether the document is in a compound edit. A compound edit is an + * edit that will be undone/redone all at once. + */ + public boolean insideCompoundEdit() { + return m_compoundEdits.size() != 0; + }//}}} + + //{{{ undo() + + public void undo() { + if (insideCompoundEdit()) { + throw new InternalError("Unbalanced begin/endCompoundEdit()"); + } + try { + setFlag(UNDO_IN_PROGRESS, true); + m_undoManager.undo(); + EditBus.send(new UndoEvent(this)); + } catch (CannotUndoException e) { + Log.log(Log.WARNING, this, e); + } finally { + setFlag(UNDO_IN_PROGRESS, false); + } + }//}}} + + //{{{ redo() + + public void redo() { + if (insideCompoundEdit()) { + throw new InternalError("Unbalanced begin/endCompoundEdit()"); + } + try { + setFlag(UNDO_IN_PROGRESS, true); + m_undoManager.redo(); + EditBus.send(new RedoEvent(this)); + } catch (CannotRedoException e) { + Log.log(Log.WARNING, this, e); + } finally { + setFlag(UNDO_IN_PROGRESS, false); + } + }//}}} + + //}}} + + //{{{ Property methods + + //{{{ getProperties() + /** + * Gets all properties associated with this document. + * @return the document's properties + */ + public Properties getProperties() { + return props; + }//}}} + + //{{{ getProperty() + /** + * Gets a property for the key given. + * @param key the key to the properties list + * @return the value of the property for the given key. + */ + public String getProperty(String key) { + return props.getProperty(key); + }//}}} + + //{{{ getProperty() + /** + * Gets a property for the key given or returns the default value + * if there is no property for the given key. + * @param key the key to the properties list + * @param defaultValue the default value for the property requested + * @return the value of the property for the given key. + */ + public String getProperty(String key, String defaultValue) { + return props.getProperty(key, defaultValue); + }//}}} + //{{{ setProperty() /** * Sets a property of the XMLDocument @@ -270,6 +378,84 @@ return oldValue; }//}}} + //{{{ getBooleanProperty() method + /** + * Returns the value of a boolean property. This method is thread-safe. + * @param name The property name + */ + public boolean getBooleanProperty(String name) { + String obj = getProperty(name); + if (obj == null) { + return false; + } + + return Boolean.valueOf(obj).booleanValue(); + } //}}} + + //{{{ setBooleanProperty() method + /** + * Sets a boolean property. + * @param name The property name + * @param value The value + */ + public void setBooleanProperty(String name, boolean value) { + setProperty(name, Boolean.toString(value)); + } //}}} + + //{{{ getIntegerProperty() method + /** + * Returns the value of an integer property. This method is thread-safe. + * @param name The property name + */ + public int getIntegerProperty(String name, int defaultValue) { + + boolean defaultValueFlag; + String obj = getProperty(name); + + if (obj == null) { + return defaultValue; + } else { + try { + return Integer.parseInt(obj); + } catch (NumberFormatException e) { + return defaultValue; + } + } + } //}}} + + //{{{ setIntegerProperty() method + /** + * Sets an integer property. + * @param name The property name + * @param value The value + */ + public void setIntegerProperty(String name, int value) { + setProperty(name, Integer.toString(value)); + } //}}} + + //}}} + + //{{{ checkWellFormedness() + /** + * Checks the wellformedness of the document and throws appropriate + * exceptions based on the errors encountered during parsing. + * @return true if the document is well formed. + * @throws SAXParseException if there was a SAX error when parsing. + * @throws SAXException if there was a problem with the SAX parser. + * @throws ParserConfigurationException if the parser is not configured properly + * @throws IOException if there was a problem reading the document + */ + public boolean checkWellFormedness() throws SAXParseException, SAXException, ParserConfigurationException, IOException { + if (!m_parsedMode) { + parseDocument(); + m_adapterNode = new AdapterNode(this, m_document); + // m_adapterNode.addAdapterNodeListener(docAdapterListener); + // m_syncedWithContent = true; + m_parsedMode=true; + } + return m_parsedMode; + }//}}} + //{{{ getDocumentCopy() /** * Gets a copy of the underlying Document object. @@ -312,37 +498,6 @@ return docType; }//}}} - //{{{ getProperties() - /** - * Gets all properties associated with this document. - * @return the document's properties - */ - public Properties getProperties() { - return props; - }//}}} - - //{{{ getProperty() - /** - * Gets a property for the key given. - * @param key the key to the properties list - * @return the value of the property for the given key. - */ - public String getProperty(String key) { - return props.getProperty(key); - }//}}} - - //{{{ getProperty() - /** - * Gets a property for the key given or returns the default value - * if there is no property for the given key. - * @param key the key to the properties list - * @param defaultValue the default value for the property requested - * @return the value of the property for the given key. - */ - public String getProperty(String key, String defaultValue) { - return props.getProperty(key, defaultValue); - }//}}} - //{{{ getRootElementNode() /** * A convenience method that returns the root element node of the document. @@ -765,12 +920,14 @@ */ public void insertText(int offset, String text) throws IOException { if (text.length() > 0) { + Log.log(Log.DEBUG, this, "insertText: "+offset+": "+text); syncContentWithDOM(); m_content.insert(offset, text); m_parsedMode = false; m_adapterNode = null; - //may have some algorithm to determine the modified node(s) in the - //future + if (!getFlag(UNDO_IN_PROGRESS)) { + addUndoableEdit(new InsertEdit(this, offset, text)); + } fireStructureChanged(null); } }//}}} @@ -784,12 +941,14 @@ */ public void removeText(int offset, int length) throws IOException { if (length > 0) { - syncContentWithDOM(); + String text = getText(offset,length); + Log.log(Log.DEBUG, this, "removeText: "+offset+": "+text); m_content.remove(offset, length); m_parsedMode = false; m_adapterNode = null; - //may have some algorithm to determine the modified node(s) in the - //future + if (!getFlag(UNDO_IN_PROGRESS)) { + addUndoableEdit(new RemoveEdit(this, offset, text)); + } fireStructureChanged(null); } }//}}} @@ -1021,6 +1180,31 @@ //{{{ Private members + //{{{ Flags + + //{{{ setFlag() method + private void setFlag(int flag, boolean value) { + if(value) { + flags |= (1 << flag); + } else { + flags &= ~(1 << flag); + } + } //}}} + + //{{{ getFlag() method + private boolean getFlag(int flag) { + int mask = (1 << flag); + return (flags & mask) == mask; + } //}}} + + //{{{ Flag values + private static final int UNDO_IN_PROGRESS = 9; + //}}} + + private int flags; + + //}}} + //{{{ setDefaultProperties() private void setDefaultProperties() { @@ -2073,6 +2257,10 @@ */ private HashMap m_mappings; + private UndoManager m_undoManager = new UndoManager(); + private Stack m_compoundEdits = new Stack(); + private boolean m_addedToCompoundEdits = false; + // private XMLDocAdapterListener docAdapterListener = new XMLDocAdapterListener(); //}}} Added: trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/InsertEdit.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/InsertEdit.java (rev 0) +++ trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/InsertEdit.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -0,0 +1,84 @@ +/* +InsertEdit.java +:tabSize=4:indentSize=4:noTabs=true: +:folding=explicit:collapseFolds=1: + +Copyright (C) 2006 Ian Lewis (Ian...@me...) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Optionally, you may find a copy of the GNU General Public License +from http://www.fsf.org/copyleft/gpl.txt +*/ + +package net.sourceforge.jsxe.dom.undo; + +//{{{ imports + +//{{{ jsXe classes +import net.sourceforge.jsxe.dom.XMLDocument; +//}}} + +//{{{ Swing classes +import javax.swing.undo.*; +//}}} + +import java.io.IOException; + +//}}} + +/** + * An undoable edit sigifying an insert into an XMLDocument. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @see net.sourceforge.jsxe.dom.XMLDocument + */ +public class InsertEdit extends AbstractUndoableEdit { + + private XMLDocument m_document; + private String m_text; + private int m_offset; + + //{{{ InsertEdit constructor + + public InsertEdit(XMLDocument document, int offset, String text) { + m_document = document; + m_offset = offset; + m_text = text; + }//}}} + + //{{{ undo() + + public void undo() throws CannotUndoException { + super.undo(); + try { + m_document.removeText(m_offset, m_text.length()); + } catch (IOException ioe) { + throw new CannotUndoException(); + } + }//}}} + + //{{{ redo() + + public void redo() throws CannotRedoException { + super.redo(); + try { + m_document.insertText(m_offset, m_text); + } catch (IOException ioe) { + throw new CannotRedoException(); + } + }//}}} + +} \ No newline at end of file Property changes on: trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/InsertEdit.java ___________________________________________________________________ Name: svn:executable + * Added: trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/RemoveEdit.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/RemoveEdit.java (rev 0) +++ trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/RemoveEdit.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -0,0 +1,84 @@ +/* +RemoveEdit.java +:tabSize=4:indentSize=4:noTabs=true: +:folding=explicit:collapseFolds=1: + +Copyright (C) 2006 Ian Lewis (Ian...@me...) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Optionally, you may find a copy of the GNU General Public License +from http://www.fsf.org/copyleft/gpl.txt +*/ + +package net.sourceforge.jsxe.dom.undo; + +//{{{ imports + +//{{{ jsXe classes +import net.sourceforge.jsxe.dom.XMLDocument; +//}}} + +//{{{ Swing classes +import javax.swing.undo.*; +//}}} + +import java.io.IOException; + +//}}} + +/** + * An undoable edit sigifying a removal from an XMLDocument. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @see net.sourceforge.jsxe.dom.XMLDocument + */ +public class RemoveEdit extends AbstractUndoableEdit { + + private XMLDocument m_document; + private String m_text; + private int m_offset; + + //{{{ RemoveEdit constructor + + public RemoveEdit(XMLDocument document, int offset, String text) { + m_document = document; + m_offset = offset; + m_text = text; + }//}}} + + //{{{ undo() + + public void undo() throws CannotUndoException { + super.undo(); + try { + m_document.insertText(m_offset, m_text); + } catch (IOException ioe) { + throw new CannotUndoException(); + } + }//}}} + + //{{{ redo() + + public void redo() throws CannotRedoException { + super.redo(); + try { + m_document.removeText(m_offset, m_text.length()); + } catch (IOException ioe) { + throw new CannotUndoException(); + } + }//}}} + +} \ No newline at end of file Property changes on: trunk/jsxe/src/net/sourceforge/jsxe/dom/undo/RemoveEdit.java ___________________________________________________________________ Name: svn:executable + * Modified: trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -427,7 +427,9 @@ updateRecentFilesMenu(); menubar.add(m_fileMenu); - + + menubar.add(m_editMenu); + //Add View Specific Menus JMenu[] menus = currentDocView.getMenus(); if (menus != null) { @@ -603,6 +605,27 @@ m_fileMenu.add( menuItem ); //}}} + //{{{ Create Edit Menu + m_editMenu = new JMenu(Messages.getMessage("Edit.Menu")); + m_editMenu.setMnemonic('E'); + menuItem = new JMenuItem(ActionManager.getAction("undo")); + m_editMenu.add(menuItem); + menuItem = new JMenuItem(ActionManager.getAction("redo")); + m_editMenu.add(menuItem); + m_editMenu.addSeparator(); + menuItem = new JMenuItem(ActionManager.getAction("cut")); + m_editMenu.add(menuItem); + menuItem = new JMenuItem(ActionManager.getAction("copy")); + m_editMenu.add(menuItem); + menuItem = new JMenuItem(ActionManager.getAction("paste")); + m_editMenu.add(menuItem); + m_editMenu.addSeparator(); + menuItem = new JMenuItem(ActionManager.getAction("find")); + m_editMenu.add(menuItem); + menuItem = new JMenuItem(ActionManager.getAction("findnext")); + m_editMenu.add(menuItem); + //}}} + //{{{ Create View Menu m_viewMenu = new JMenu(Messages.getMessage("View.Menu")); m_viewMenu.setMnemonic('V'); @@ -797,6 +820,7 @@ }//}}} private JMenu m_fileMenu; + private JMenu m_editMenu; private JMenu m_viewMenu; private JMenu m_toolsMenu; private JMenu m_helpMenu; Modified: trunk/jsxe/src/net/sourceforge/jsxe/msg/PropertyChanged.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/msg/PropertyChanged.java 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/msg/PropertyChanged.java 2006-08-08 00:07:37 UTC (rev 1110) @@ -39,7 +39,6 @@ //{{{ PropertyChanged constructor /** * Creates a new PropertyChanged message. - * @param source the object that changed the properties * @param */ public PropertyChanged(String key, String oldValue) { Modified: trunk/jsxe/src/net/sourceforge/jsxe/properties =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/properties 2006-08-07 22:38:19 UTC (rev 1109) +++ trunk/jsxe/src/net/sourceforge/jsxe/properties 2006-08-08 00:07:37 UTC (rev 1110) @@ -13,6 +13,8 @@ # Resource Cache xml.cache=true +undo.limit=100 + #{{{ Plugin Manager Default Dimensions #pluginmgr.x=100 #pluginmgr.y=100 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |