Thread: [Jsxe-cvs] SF.net SVN: jsxe: [896] branches/treeview2
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-06-03 22:33:50
|
Revision: 896 Author: ian_lewis Date: 2006-06-03 15:32:06 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=896&view=rev Log Message: ----------- Updated the Tree View to use the new XMLDocumentListener interface Modified Paths: -------------- branches/treeview2/Changelog branches/treeview2/src/treeview/DefaultView.java Modified: branches/treeview2/Changelog =================================================================== --- branches/treeview2/Changelog 2006-06-02 03:58:41 UTC (rev 895) +++ branches/treeview2/Changelog 2006-06-03 22:32:06 UTC (rev 896) @@ -1,3 +1,7 @@ +06/03/2006 Ian Lewis <Ian...@me...> + + * Updated the Tree View to use the new XMLDocumentListener interface + 02/16/2006 Ian Lewis <Ian...@me...> * Added cut/copy/paste support for nodes in the tree view. There are still Modified: branches/treeview2/src/treeview/DefaultView.java =================================================================== --- branches/treeview2/src/treeview/DefaultView.java 2006-06-02 03:58:41 UTC (rev 895) +++ branches/treeview2/src/treeview/DefaultView.java 2006-06-03 22:32:06 UTC (rev 896) @@ -578,7 +578,6 @@ private XMLDocumentListener m_documentListener = new XMLDocumentListener() {///{{{ //{{{ propertiesChanged - public void propertyChanged(XMLDocument source, String key, String oldValue) { if (CONTINUOUS_LAYOUT.equals(key)) { boolean layout = Boolean.valueOf(source.getProperty(CONTINUOUS_LAYOUT)).booleanValue(); @@ -591,7 +590,6 @@ }//}}} //{{{ structureChanged() - public void structureChanged(XMLDocument source, AdapterNode location) { /* need to reload since saving can change the structure, @@ -603,6 +601,21 @@ attributesTable.updateUI(); }//}}} + //{{{ insertUpdate() + public void insertUpdate(XMLDocumentEvent event) { + structureChanged(event.getXMLDocument(), null); + }//}}} + + //{{{ removeUpdate() + public void removeUpdate(XMLDocumentEvent event) { + structureChanged(event.getXMLDocument(), null); + }//}}} + + //{{{ changeUpdate() + public void changeUpdate(XMLDocumentEvent event) { + structureChanged(event.getXMLDocument(), null); + }//}}} + };//}}} //}}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-07-29 04:41:54
|
Revision: 1088 Author: ian_lewis Date: 2006-07-28 21:41:34 -0700 (Fri, 28 Jul 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1088&view=rev Log Message: ----------- Merge from trunk/treeview of revision 1086 ViewCVS Links: ------------- http://svn.sourceforge.net/jsxe/?rev=1086&view=rev Modified Paths: -------------- branches/treeview2/Changelog branches/treeview2/build.xml branches/treeview2/dependency.props branches/treeview2/messages/messages.de branches/treeview2/src/treeview/DefaultView.java branches/treeview2/src/treeview/DefaultViewTreeModel.java branches/treeview2/src/treeview/NodeTransferHandler.java branches/treeview2/src/treeview/TransferableNode.java branches/treeview2/src/treeview/TreeViewPlugin.java branches/treeview2/src/treeview/action/AddAttributeAction.java branches/treeview2/src/treeview/action/AddDocTypeAction.java branches/treeview2/src/treeview/action/AddNodeAction.java branches/treeview2/src/treeview/action/CopyNodeAction.java branches/treeview2/src/treeview/action/CutNodeAction.java branches/treeview2/src/treeview/action/EditNodeAction.java branches/treeview2/src/treeview/action/PasteNodeAction.java branches/treeview2/src/treeview/action/RemoveAttributeAction.java branches/treeview2/src/treeview/action/RemoveNodeAction.java branches/treeview2/src/treeview/action/RenameNodeAction.java branches/treeview2/src/treeview/treeview.props Added Paths: ----------- branches/treeview2/messages/messages branches/treeview2/messages/messages.ja branches/treeview2/src/treeview/TreeViewOptionPane.java branches/treeview2/src/treeview/TreeViewTree.java Removed Paths: ------------- branches/treeview2/messages/messages.en branches/treeview2/src/treeview/DefaultViewOptionsPanel.java branches/treeview2/src/treeview/DefaultViewTree.java Modified: branches/treeview2/Changelog =================================================================== --- branches/treeview2/Changelog 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/Changelog 2006-07-29 04:41:34 UTC (rev 1088) @@ -1,3 +1,58 @@ +07/20/2006 Ian Lewis <Ian...@me...> + + * Updated actions and messages for options. + * Added Japanese translation. + +07/13/2006 Ian Lewis <Ian...@me...> + + * Fixed problem where the shortcut for Adding an element node wasn't + showing in the popup menu. + * Fixed problem where the shortcut for Adding and removing an attribute + wasn't showing in the popup menu. + +07/12/2006 Ian Lewis <Ian...@me...> + + * Updated TreeViewTree to use the WrappingMenu instead of EnhancedMenu + since it was renamed. + +07/06/2006 Ian Lewis <Ian...@me...> + + * Updated to support the new Messages format. + +06/25/2006 Ian Lewis <Ian...@me...> + + * Feature Request 1494444: Updated the tree view so that if no attributes + are defined in the Schema/DTD for the element then the Edit Node dialog + will not be displayed. + +06/23/2006 Ian Lewis <Ian...@me...> + + * Added back rudimentary key bindings using Swing Actions so they get + dispached by Swing and are displayed in menus. But infrastructure is + in place to allow jsXe to catch key bindings itself. + +06/21/2006 Ian Lewis <Ian...@me...> + + * Updated TreeViewTree to use the new package for EnhancedMenu so it + compiles properly. + +06/20/2006 Ian Lewis <Ian...@me...> + + * Updated the treeview's actions to extend the new LocalizedAction class. + +06/15/2006 Ian Lewis <Ian...@me...> + + * Updated how properties are loaded for the tree view + +06/13/2006 Ian Lewis <Ian...@me...> + + * Updated the options pane extend AbstractOptionPane + * Renamed the DefaultViewTree to TreeViewTree + +06/09/2006 Ian Lewis <Ian...@me...> + + * Updated version and dependency info + 06/03/2006 Ian Lewis <Ian...@me...> * Updated the Tree View to use the new XMLDocumentListener interface Modified: branches/treeview2/build.xml =================================================================== --- branches/treeview2/build.xml 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/build.xml 2006-07-29 04:41:34 UTC (rev 1088) @@ -1,7 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - This is a build.xml file for building the Tree View for jsXe. - Version: $Id$ + :tabSize=2:indentSize=2:noTabs=true: + :folding=explicit:collapseFolds=1: + + This is a build.xml file for building the Tree View for jsXe. + Version: $Id$ --> <project basedir="." default="usage" name="treeview"> @@ -26,7 +29,7 @@ <property name="build.help" value="${build.docs}/help"/> <property name="jsxe.dir" value="${root.dir}/../.."/> <property name="jsxe.jar" value="${jsxe.dir}/jsXe.jar"/> - <property name="jsxe.lib.dir" value="${jsxe.dir}/lib"/> + <property name="jsxe.lib.dir" value="${jsxe.dir}/../lib"/> <property name="javac.debug" value="on"/> <property name="javac.optimize" value="off"/> <property name="javac.deprecation" value="on"/> @@ -35,7 +38,7 @@ <property name="javadoc.link" value="http://java.sun.com/j2se/1.3/docs/api/"/> <property name="main.class" value="treeview.TreeViewPlugin"/> <property name="major.version" value="0"/> - <property name="minor.version" value="4"/> + <property name="minor.version" value="5"/> <property name="build.version" value="3"/> <property name="app.version" value="${major.version}.${minor.version}.${build.version}"/> <property name="app_version" value="${major.version}_${minor.version}_${build.version}"/> @@ -73,11 +76,14 @@ <mkdir dir="${build.dir}"/> <mkdir dir="${build.messages}"/> - <copy todir="${build.messages}"> + <!--<copy todir="${build.messages}"> <fileset dir="${messages.dir}"> <include name="**/messages.*"/> </fileset> - </copy> + </copy>--> + + <!-- run native2ascii on these files --> + <native2ascii encoding="UTF-8" src="${messages.dir}" dest="${build.messages}" includes="messages*"/> </target> <!-- }}} --> <!-- {{{ ============ Prepares the documentation ======================= --> @@ -131,6 +137,8 @@ <attribute name="jsxe-plugin-name" value="${app.name}"/> <attribute name="jsxe-plugin-human-readable-name" value="${readable.name}"/> <attribute name="jsxe-plugin-version" value="${implementation.version}"/> + <attribute name="jsxe-plugin-author" value="Ian Lewis"/> + <!--<attribute name="jsxe-plugin-release-date" value=""/>--> <attribute name="jsxe-plugin-url" value="http://jsxe.sourceforge.net/"/> <attribute name="jsxe-plugin-class" value="${main.class}"/> <attribute name="jsxe-plugin-description" value="${description}"/> @@ -139,7 +147,7 @@ <jar jarfile="${root.dir}/../${app.name}.jar" manifest="${app.name}.manifest"> <fileset dir="${build.dir}"> - <include name="messages/messages.*"/> + <include name="messages/messages*"/> </fileset> <fileset dir="${build.dest}"> <include name="**/*.class"/> Modified: branches/treeview2/dependency.props =================================================================== --- branches/treeview2/dependency.props 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/dependency.props 2006-07-29 04:41:34 UTC (rev 1088) @@ -1 +1 @@ -dependency.0=jsxe 00.04.03.00 +dependency.0=jsxe 00.05.03.00 Copied: branches/treeview2/messages/messages (from rev 1084, trunk/treeview/messages/messages) =================================================================== --- branches/treeview2/messages/messages (rev 0) +++ branches/treeview2/messages/messages 2006-07-29 04:41:34 UTC (rev 1088) @@ -0,0 +1,30 @@ +# JSXE tree view English properties file +# $Id$ +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +TreeView.Options.Title=Tree View + +TreeView.Options.Show.Comments=Show comment nodes +TreeView.Options.Continuous.Layout=Continuous layout for split-panes +TreeView.Options.Show.Attributes=Show element attributes in tree: +Show.Attributes.None=None +Show.Attributes.ID.Only=ID only +Show.Attributes.All=All + + +treeview.rename.node.label=Rename Node +treeview.remove.node.label=Remove Node +treeview.add.attribute.label=Add Attribute +treeview.remove.attribute.label=Remove Attribute +treeview.edit.node.label=Edit Node +TreeView.EditDocType.Title=Edit Document Type Definition +Edit.Node.Dialog.Title=Edit Node + +treeview.add.doctype.node.label=Add Document Type Definition +treeview.add.element.node.label=Add Element Node +treeview.add.text.node.label=Add Text Node +treeview.add.cdata.node.label=Add CDATA Node +treeview.add.pi.node.label=Add Processing Instruction +treeview.add.comment.node.label=Add Comment Modified: branches/treeview2/messages/messages.de =================================================================== --- branches/treeview2/messages/messages.de 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/messages/messages.de 2006-07-29 04:41:34 UTC (rev 1088) @@ -5,19 +5,18 @@ #:tabSize=4:indentSize=4:noTabs=true: #:folding=explicit:collapseFolds=1: +# ä Ä é ö Ö ü Ü ß -#{{{ TreeView TreeView.Options.Title=Tree View Optionen TreeView.Options.Show.Comments=Kommentar Knoten anzeigen -TreeView.Options.Show.Comments.ToolTip =Beim Deaktivieren werden s�mtliche Kommentare in der momentan ge�ffneten XML Datei ausgeblendet. -TreeView.Options.Continuous.Layout=Durchg�ngiges Layout f�r split-panes -TreeView.Options.Continuous.Layout.ToolTip =<HTML>Dies beeinflusst das Aussehen des vertikalen Balkens in der Mitte des jsXE Screens.<BR>Ist dieses Auswahlk�stchen nicht ausgew�hlt w�hrend der vertikale Balken vor und zur�ck �ber den Screen <BR>gezogen wird, bewegt er sich ohne Umst�nde.<BR>Ist dieses Auswahlk�stchen nicht aktiviert w�hrend der vertikale Balken verschoben wird, ver�ndert er sich in <BR>eine dicke schwarze Linie.</HTML> +TreeView.Options.Show.Comments.ToolTip=Beim Deaktivieren werden sämtliche Kommentare in der momentan geöffneten XML Datei ausgeblendet. +TreeView.Options.Continuous.Layout=Durchgängiges Layout für split-panes +TreeView.Options.Continuous.Layout.ToolTip=<HTML>Dies beeinflusst das Aussehen des vertikalen Balkens in der Mitte des jsXE Screens.<BR>Ist dieses Auswahlkästchen nicht ausgewählt während der vertikale Balken vor und zurück über den Screen <BR>gezogen wird, bewegt er sich ohne Umstände.<BR>Ist dieses Auswahlkästchen nicht aktiviert während der vertikale Balken verschoben wird, verändert er sich in <BR>eine dicke schwarze Linie.</HTML> TreeView.Options.Show.Attributes=Show element attributes in tree: -TreeView.Options.Show.Attributes.ToolTip =<HTML>Diese Option verlaubt es, die XML Datei auf verschiedene Arten anzuzeigen. <BR><ul><li><strong>Keine</strong> - blendet alle Attribut-Informationen der Datei aus. </li><li><strong>Nur ID</strong> - nur Attribut-Informationen, die zu einem XML Element mit ID geh�ren, werden angezeigt.</li><li><strong>Alle</strong> - alle Attribut-Informationen werden angezeigt.</li></ul><HTML> +TreeView.Options.Show.Attributes.ToolTip=<HTML>Diese Option verlaubt es, die XML Datei auf verschiedene Arten anzuzeigen. <ul><li><strong>Keine</strong> - blendet alle Attribut-Informationen der Datei aus. </li><li><strong>Nur ID</strong> - nur Attribut-Informationen, die zu einem XML Element mit ID gehören, werden angezeigt.</li><li><strong>Alle</strong> - alle Attribut-Informationen werden angezeigt.</li></ul><HTML> TreeView.RenameNode=Knoten umbenennen TreeView.RemoveNode=Knoten entfernen -TreeView.AddAttribute=Attribut hinzuf�gen +TreeView.AddAttribute=Attribut hinzufügen TreeView.RemoveAttribute=Attribut entfernen TreeView.EditNode=Knoten bearbeiten Edit.Node.Dialog.Title=Knoten bearbeitenn -#}}} Deleted: branches/treeview2/messages/messages.en =================================================================== --- branches/treeview2/messages/messages.en 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/messages/messages.en 2006-07-29 04:41:34 UTC (rev 1088) @@ -1,19 +0,0 @@ -# JSXE tree view English properties file -# $Id$ -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -#{{{ TreeView -TreeView.Options.Title=Tree View Options -TreeView.Options.Show.Comments=Show comment nodes -TreeView.Options.Continuous.Layout=Continuous layout for split-panes -TreeView.Options.Show.Attributes=Show element attributes in tree: -TreeView.RenameNode=Rename Node -TreeView.RemoveNode=Remove Node -TreeView.AddAttribute=Add Attribute -TreeView.RemoveAttribute=Remove Attribute -TreeView.EditNode=Edit Node -TreeView.EditDocType.Title=Edit Document Type Definition -Edit.Node.Dialog.Title=Edit Node -#}}} Copied: branches/treeview2/messages/messages.ja (from rev 1084, trunk/treeview/messages/messages.ja) =================================================================== --- branches/treeview2/messages/messages.ja (rev 0) +++ branches/treeview2/messages/messages.ja 2006-07-29 04:41:34 UTC (rev 1088) @@ -0,0 +1,29 @@ +# JSXE tree view Japanese properties file +# $Id$ +# Maintained by Ian Lewis +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +TreeView.Options.Title=ツリー表示 + +TreeView.Options.Show.Comments=コメントノードを表示する +TreeView.Options.Show.Attributes=要素の属性を表示する: +Show.Attributes.None=なし +Show.Attributes.ID.Only=IDだけ +Show.Attributes.All=全て + +treeview.rename.node.label=ノードをリネーム +treeview.remove.node.label=ノードを削除 +treeview.add.attribute.label=属性を追加 +treeview.remove.attribute.label=属性を削除 +treeview.add.doctype.node.label=DTDを追加 +treeview.edit.node.label=ノードを編集 +TreeView.EditDocType.Title=DTDを編集 +Edit.Node.Dialog.Title=ノードを編集 + +treeview.add.element.node.label=要素を追加 +treeview.add.text.node.label=テキストを追加 +treeview.add.cdata.node.label=CDATA セクションを追加 +treeview.add.pi.node.label=処理命令を追加 +treeview.add.comment.node.label=コメントを追加 Modified: branches/treeview2/src/treeview/DefaultView.java =================================================================== --- branches/treeview2/src/treeview/DefaultView.java 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/src/treeview/DefaultView.java 2006-07-29 04:41:34 UTC (rev 1088) @@ -31,13 +31,11 @@ //{{{ jsXe classes import net.sourceforge.jsxe.dom.*; import net.sourceforge.jsxe.dom.completion.ElementDecl; -import net.sourceforge.jsxe.jsXe; -import net.sourceforge.jsxe.DocumentBuffer; -import net.sourceforge.jsxe.ViewPlugin; -import net.sourceforge.jsxe.gui.OptionsPanel; +import net.sourceforge.jsxe.*; import net.sourceforge.jsxe.gui.DocumentView; import net.sourceforge.jsxe.gui.Messages; import net.sourceforge.jsxe.util.Log; +import net.sourceforge.jsxe.msg.PropertyChanged; //}}} //{{{ Swing components @@ -75,7 +73,7 @@ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ */ -public class DefaultView extends JPanel implements DocumentView { +public class DefaultView extends JPanel implements DocumentView, EBListener { //{{{ Private static members private static final Properties m_defaultProperties; @@ -108,6 +106,8 @@ m_plugin = plugin; + enableEvents(java.awt.AWTEvent.KEY_EVENT_MASK); + setLayout(new BorderLayout()); //{{{ init html editor pane @@ -168,11 +168,11 @@ //TODO: get cut/copy/paste to work in the right hand text window m_editMenu = new JMenu(Messages.getMessage("Edit.Menu")); m_editMenu.setMnemonic('E'); - JMenuItem menuItem = new JMenuItem(jsXe.getAction("treeview.cut.node")); + JMenuItem menuItem = new JMenuItem(ActionManager.getAction("cut")); m_editMenu.add(menuItem); - menuItem = new JMenuItem(jsXe.getAction("treeview.copy.node")); + menuItem = new JMenuItem(ActionManager.getAction("copy")); m_editMenu.add(menuItem); - menuItem = new JMenuItem(jsXe.getAction("treeview.paste.node")); + menuItem = new JMenuItem(ActionManager.getAction("paste")); m_editMenu.add(menuItem); //}}} @@ -203,8 +203,8 @@ Container parent = getParent(); if (parent != null) { Dimension size = parent.getSize(); - float vertPercent = Integer.valueOf(m_document.getProperty(VERT_SPLIT_LOCATION)).floatValue(); - float horizPercent = Integer.valueOf(m_document.getProperty(HORIZ_SPLIT_LOCATION)).floatValue(); + float vertPercent = Integer.valueOf(jsXe.getProperty(VERT_SPLIT_LOCATION)).floatValue(); + float horizPercent = Integer.valueOf(jsXe.getProperty(HORIZ_SPLIT_LOCATION)).floatValue(); int vertLoc = (int)((vertPercent/100.0)*size.getHeight()); int horizLoc = (int)((horizPercent/100.0)*size.getWidth()); @@ -219,12 +219,13 @@ });//}}} setDocumentBuffer(document); + + EditBus.addToBus(this); }//}}} //{{{ DocumentView methods //{{{ close() - public boolean close() { //m_document should only be null if setDocumentBuffer was never called. @@ -236,13 +237,15 @@ String vert = Integer.toString((int)(vertSplitPane.getDividerLocation()/size.getHeight()*100)); String horiz = Integer.toString((int)(horizSplitPane.getDividerLocation()/size.getWidth()*100)); - m_document.setProperty(VERT_SPLIT_LOCATION,vert); - m_document.setProperty(HORIZ_SPLIT_LOCATION,horiz); + jsXe.setProperty(VERT_SPLIT_LOCATION,vert); + jsXe.setProperty(HORIZ_SPLIT_LOCATION,horiz); m_document.removeXMLDocumentListener(m_documentListener); } } + EditBus.removeFromBus(this); + return true; }//}}} @@ -271,7 +274,6 @@ }//}}} //{{{ setDocumentBuffer() - public void setDocumentBuffer(DocumentBuffer document) throws IOException { try { @@ -284,8 +286,6 @@ throw new IOException(e.toString()); } - ensureDefaultProps(document); - AdapterNode adapter = document.getAdapterNode(); DefaultViewTreeModel treeModel = new DefaultViewTreeModel(this, document); @@ -304,7 +304,7 @@ styledDoc.addDocumentListener(docListener); //get the splitpane layout options - boolean layout = Boolean.valueOf(document.getProperty(CONTINUOUS_LAYOUT)).booleanValue(); + boolean layout = Boolean.valueOf(jsXe.getProperty(CONTINUOUS_LAYOUT)).booleanValue(); vertSplitPane.setContinuousLayout(layout); horizSplitPane.setContinuousLayout(layout); @@ -330,12 +330,27 @@ //}}} - //{{{ getDefaultViewTree() + //{{{ handleMessage() + public void handleMessage(EBMessage message) { + if (message instanceof PropertyChanged) { + String key = ((PropertyChanged)message).getKey(); + if (CONTINUOUS_LAYOUT.equals(key)) { + boolean layout = Boolean.valueOf(jsXe.getProperty(CONTINUOUS_LAYOUT)).booleanValue(); + vertSplitPane.setContinuousLayout(layout); + horizSplitPane.setContinuousLayout(layout); + } + if (CONTINUOUS_LAYOUT.equals(key) || SHOW_COMMENTS.equals(key) || SHOW_ATTRIBUTES.equals(key)) { + tree.updateUI(); + } + } + }//}}} + + //{{{ getTree() /** * Gets the tree component for this DefaultView. * @return the tree component */ - public DefaultViewTree getDefaultViewTree() { + public TreeViewTree getTree() { return tree; }//}}} @@ -366,18 +381,6 @@ return (node.getNodeValue() != null); }//}}} - //{{{ ensureDefaultProps() - - private void ensureDefaultProps(XMLDocument document) { - //get default properties from jsXe - document.setProperty(CONTINUOUS_LAYOUT, document.getProperty(CONTINUOUS_LAYOUT, m_defaultProperties.getProperty(CONTINUOUS_LAYOUT))); - document.setProperty(HORIZ_SPLIT_LOCATION, document.getProperty(HORIZ_SPLIT_LOCATION, m_defaultProperties.getProperty(HORIZ_SPLIT_LOCATION))); - document.setProperty(VERT_SPLIT_LOCATION, document.getProperty(VERT_SPLIT_LOCATION, m_defaultProperties.getProperty(VERT_SPLIT_LOCATION))); - document.setProperty(SHOW_COMMENTS, document.getProperty(SHOW_COMMENTS, m_defaultProperties.getProperty(SHOW_COMMENTS))); - document.setProperty(SHOW_ATTRIBUTES, document.getProperty(SHOW_ATTRIBUTES, m_defaultProperties.getProperty(SHOW_ATTRIBUTES))); - // document.setProperty(SHOW_EMPTY_NODES, document.getProperty(SHOW_EMPTY_NODES, m_defaultProperties.getProperty(SHOW_EMPTY_NODES))); - }//}}} - //{{{ TablePopupListener class private class TablePopupListener extends MouseAdapter { @@ -410,14 +413,10 @@ JPopupMenu popup = new JPopupMenu(); JMenuItem popupMenuItem; - popupMenuItem = new JMenuItem("Add Attribute"); - popupMenuItem.addActionListener(jsXe.getAction("treeview.add.attribute")); - popup.add(popupMenuItem); + popup.add(ActionManager.getAction("treeview.add.attribute")); if (row != attributesTable.getRowCount()-1) { - popupMenuItem = new JMenuItem("Remove Attribute"); - popupMenuItem.addActionListener(jsXe.getAction("treeview.remove.attribute")); - popup.add(popupMenuItem); + popup.add(ActionManager.getAction("treeview.remove.attribute")); } popup.show(e.getComponent(), e.getX(), e.getY()); } @@ -524,7 +523,7 @@ }//}}} - private DefaultViewTree tree = new DefaultViewTree(); + private TreeViewTree tree = new TreeViewTree(); private JTextArea m_valueTextArea = new JTextArea(""); private DefaultViewTable attributesTable = new DefaultViewTable(); private JSplitPane vertSplitPane; @@ -577,17 +576,8 @@ };//}}} private XMLDocumentListener m_documentListener = new XMLDocumentListener() {///{{{ - //{{{ propertiesChanged - public void propertyChanged(XMLDocument source, String key, String oldValue) { - if (CONTINUOUS_LAYOUT.equals(key)) { - boolean layout = Boolean.valueOf(source.getProperty(CONTINUOUS_LAYOUT)).booleanValue(); - vertSplitPane.setContinuousLayout(layout); - horizSplitPane.setContinuousLayout(layout); - } - if (CONTINUOUS_LAYOUT.equals(key) || SHOW_COMMENTS.equals(key) || SHOW_ATTRIBUTES.equals(key)) { - tree.updateUI(); - } - }//}}} + //{{{ propertiesChanged() + public void propertyChanged(XMLDocument source, String key, String oldValue) {}//}}} //{{{ structureChanged() public void structureChanged(XMLDocument source, AdapterNode location) { @@ -601,21 +591,6 @@ attributesTable.updateUI(); }//}}} - //{{{ insertUpdate() - public void insertUpdate(XMLDocumentEvent event) { - structureChanged(event.getXMLDocument(), null); - }//}}} - - //{{{ removeUpdate() - public void removeUpdate(XMLDocumentEvent event) { - structureChanged(event.getXMLDocument(), null); - }//}}} - - //{{{ changeUpdate() - public void changeUpdate(XMLDocumentEvent event) { - structureChanged(event.getXMLDocument(), null); - }//}}} - };//}}} //}}} Deleted: branches/treeview2/src/treeview/DefaultViewOptionsPanel.java =================================================================== --- branches/treeview2/src/treeview/DefaultViewOptionsPanel.java 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/src/treeview/DefaultViewOptionsPanel.java 2006-07-29 04:41:34 UTC (rev 1088) @@ -1,179 +0,0 @@ -/* -DefaultViewOptionsPanel.java -:tabSize=4:indentSize=4:noTabs=true: -:folding=explicit:collapseFolds=1: - -Copyright (C) 2002 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 treeview; - -//{{{ imports - -//{{{ jsXe classes -import net.sourceforge.jsxe.dom.*; -import net.sourceforge.jsxe.DocumentBuffer; -import net.sourceforge.jsxe.gui.OptionsPanel; -import net.sourceforge.jsxe.gui.DocumentView; -import net.sourceforge.jsxe.gui.Messages; -//}}} - -//{{{ Swing components -import javax.swing.*; -import javax.swing.text.PlainDocument; -import javax.swing.event.*; -import javax.swing.tree.*; -//}}} - -//{{{ AWT components -import java.awt.*; -import java.awt.event.*; -//}}} - -//{{{ Java base classes -import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.Properties; -//}}} - -//}}} - - -public class DefaultViewOptionsPanel extends OptionsPanel { - - //{{{ DefaultViewOptionsPanel constructor - - public DefaultViewOptionsPanel(DocumentBuffer buffer) { - - m_document = buffer; - - GridBagLayout layout = new GridBagLayout(); - GridBagConstraints constraints = new GridBagConstraints(); - - setLayout(layout); - - int gridY = 0; - - boolean showCommentNodes = Boolean.valueOf(m_document.getProperty(DefaultView.SHOW_COMMENTS, "false")).booleanValue(); - // boolean showEmptyNodes = Boolean.valueOf(m_document.getProperty(SHOW_EMPTY_NODES, "false")).booleanValue(); - boolean continuousLayout = Boolean.valueOf(m_document.getProperty(DefaultView.CONTINUOUS_LAYOUT, "false")).booleanValue(); - String showAttrs = m_document.getProperty(DefaultView.SHOW_ATTRIBUTES, "ID only"); - - showCommentsCheckBox = new JCheckBox(Messages.getMessage("TreeView.Options.Show.Comments"),showCommentNodes); - showCommentsCheckBox.setToolTipText(Messages.getMessage("TreeView.Options.Show.Comments.ToolTip")); - // showEmptyNodesCheckBox = new JCheckBox("Show whitespace-only nodes",showEmptyNodes); - ContinuousLayoutCheckBox = new JCheckBox(Messages.getMessage("TreeView.Options.Continuous.Layout"),continuousLayout); - ContinuousLayoutCheckBox.setToolTipText(Messages.getMessage("TreeView.Options.Continuous.Layout.ToolTip")); - - JLabel showAttrsLabel = new JLabel(Messages.getMessage("TreeView.Options.Show.Attributes")); - m_showAttrsComboBox = new JComboBox(new String [] {"None", "ID only", "All"}); - - m_showAttrsComboBox.setSelectedItem(showAttrs); - m_showAttrsComboBox.setToolTipText(Messages.getMessage("TreeView.Options.Show.Attributes.ToolTip")); - - constraints.gridy = gridY; - constraints.gridx = 1; - constraints.gridheight = 1; - constraints.gridwidth = 1; - constraints.weightx = 1.0f; - constraints.fill = GridBagConstraints.BOTH; - constraints.insets = new Insets(1,0,1,0); - - layout.setConstraints(showAttrsLabel, constraints); - add(showAttrsLabel); - - constraints.gridy = gridY++; - constraints.gridx = 2; - constraints.gridheight = 1; - constraints.gridwidth = 1; - constraints.weightx = 1.0f; - constraints.fill = GridBagConstraints.BOTH; - constraints.insets = new Insets(1,0,1,0); - - layout.setConstraints(m_showAttrsComboBox, constraints); - add(m_showAttrsComboBox); - - constraints.gridy = gridY++; - constraints.gridx = 1; - constraints.gridheight = 1; - constraints.gridwidth = 2; - constraints.weightx = 1.0f; - constraints.fill = GridBagConstraints.BOTH; - constraints.insets = new Insets(1,0,1,0); - - layout.setConstraints(showCommentsCheckBox, constraints); - add(showCommentsCheckBox); - - // constraints.gridy = gridY++; - // constraints.gridx = 1; - // constraints.gridheight = 1; - // constraints.gridwidth = 1; - // constraints.weightx = 1.0f; - // constraints.fill = GridBagConstraints.BOTH; - // constraints.insets = new Insets(1,0,1,0); - - // layout.setConstraints(showEmptyNodesCheckBox, constraints); - // add(showEmptyNodesCheckBox); - - constraints.gridy = gridY++; - constraints.gridx = 1; - constraints.gridheight = 1; - constraints.gridwidth = 2; - constraints.weightx = 1.0f; - constraints.fill = GridBagConstraints.BOTH; - constraints.insets = new Insets(1,0,1,0); - - layout.setConstraints(ContinuousLayoutCheckBox, constraints); - add(ContinuousLayoutCheckBox); - }//}}} - - //{{{ save() - - public void save() { - m_document.setProperty(DefaultView.SHOW_COMMENTS,String.valueOf(showCommentsCheckBox.isSelected())); - // m_document.setProperty(SHOW_EMPTY_NODES,(new Boolean(showEmptyNodesCheckBox.isSelected())).toString()); - m_document.setProperty(DefaultView.CONTINUOUS_LAYOUT,String.valueOf(ContinuousLayoutCheckBox.isSelected())); - m_document.setProperty(DefaultView.SHOW_ATTRIBUTES, m_showAttrsComboBox.getSelectedItem().toString()); - }//}}} - - //{{{ getName() - - public String getName() { - return "defaultview"; - }//}}} - - //{{{ getTitle() - - public String getTitle() { - return Messages.getMessage("TreeView.Options.Title"); - }//}}} - - //{{{ Private Members - - private JCheckBox showCommentsCheckBox; - // private JCheckBox showEmptyNodesCheckBox; - private JCheckBox ContinuousLayoutCheckBox; - private JComboBox m_showAttrsComboBox; - - private DocumentBuffer m_document; - - //}}} - -}//}}} Deleted: branches/treeview2/src/treeview/DefaultViewTree.java =================================================================== --- branches/treeview2/src/treeview/DefaultViewTree.java 2006-07-29 04:40:06 UTC (rev 1087) +++ branches/treeview2/src/treeview/DefaultViewTree.java 2006-07-29 04:41:34 UTC (rev 1088) @@ -1,1121 +0,0 @@ -/* -DefaultViewTree.java -:tabSize=4:indentSize=4:noTabs=true: -:folding=explicit:collapseFolds=1: - -jsXe is the Java Simple XML Editorh -jsXe is a gui application that can edit an XML document and create a tree view. -The user can then edit this tree and the content in the tree and save the -document. - -This file contains the tree class that is used in the default view. - -This file written by Ian Lewis (Ian...@me...) -Copyright (C) 2002 Ian Lewis - -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 treeview; - -//{{{ imports - -import treeview.action.AddNodeAction; - -//{{{ jsXe classes -import net.sourceforge.jsxe.jsXe; -import net.sourceforge.jsxe.gui.Messages; -import net.sourceforge.jsxe.gui.EnhancedMenu; -import net.sourceforge.jsxe.dom.*; -import net.sourceforge.jsxe.dom.completion.*; -import net.sourceforge.jsxe.util.Log; -//}}} - -//{{{ Swing components -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.tree.*; -//}}} - -//{{{ AWT components -import java.awt.*; -import java.awt.datatransfer.*; -import java.awt.dnd.*; -import java.awt.event.*; -//}}} - -//{{{ DOM classes -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; -//}}} - -//{{{ Java base classes -import java.io.IOException; -import java.util.*; -//}}} - -//}}} - -/** - * The DefaultViewTree is the tree that is displayed in the upper-left of - * the DefaultView in jsXe. This class defines methods specific to the tree - * display. - * - * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) - * @version $Id$ - * @see DefaultView - */ -public class DefaultViewTree extends JTree implements Autoscroll, ClipboardOwner { - - //{{{ Properties - private final String NODE_EXPANDED = "tree.expandedstate"; - //}}} - - //{{{ DefaultViewTree constructor - /** - * Creates a new DefaultViewTree with the default TreeModel - */ - public DefaultViewTree() { - - //{{{ intitalize Drag n Drop - m_dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, m_treeDGListener); - m_dropTarget = new DropTarget(this, m_acceptableActions, m_treeDTListener, true); - //}}} - - addMouseListener(new TreePopupListener()); - setEditable(false); - addTreeExpansionListener(new TreeExpansionListener() {//{{{ - - //{{{ treeExpanded() - - public void treeExpanded(TreeExpansionEvent event) { - try { - AdapterNode node = (AdapterNode)event.getPath().getLastPathComponent(); - node.setProperty(NODE_EXPANDED, "true"); - } catch (ClassCastException e) {} - }//}}} - - //{{{ treeCollapsed() - - public void treeCollapsed(TreeExpansionEvent event) { - try { - AdapterNode node = (AdapterNode)event.getPath().getLastPathComponent(); - node.setProperty(NODE_EXPANDED, "false"); - } catch (ClassCastException e) {} - }//}}} - - });//}}} - - getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); - - DefaultViewTreeCellRenderer renderer = new DefaultViewTreeCellRenderer(); - setCellRenderer(renderer); - - //Since elements are the only editable nodes... - renderer = new DefaultViewTreeCellRenderer(); - setCellEditor(new DefaultTreeCellEditor(this, renderer, new ElementCellEditor(this, renderer))); - - - ToolTipManager.sharedInstance().registerComponent(this); - - }//}}} - - //{{{ isEditable() - /** - * Indicates if a node is capable of being edited in - * this tree. - * @param node the node to check - * @return true if the node can be edited in this tree - */ - public boolean isEditable(AdapterNode node) { - if (node != null) { - int nodeType = node.getNodeType(); - return (nodeType == Node.ELEMENT_NODE || nodeType == Node.PROCESSING_INSTRUCTION_NODE); - } else { - return false; - } - }//}}} - - //{{{ isExpanded() - - public boolean isExpanded(AdapterNode node) { - return Boolean.valueOf(node.getProperty(NODE_EXPANDED)).booleanValue(); - }//}}} - - //{{{ startEditingAtPath() - - public void startEditingAtPath(TreePath path) { - if (path != null && isEditable((AdapterNode)path.getLastPathComponent())) { - //When editing is finished go back to uneditable - getCellEditor().addCellEditorListener(new CellEditorListener() {//{{{ - public void editingCanceled(ChangeEvent e) { - setEditable(false); - getCellEditor().removeCellEditorListener(this); - } - public void editingStopped(ChangeEvent e) { - setEditable(false); - getCellEditor().removeCellEditorListener(this); - } - });//}}} - setEditable(true); - super.startEditingAtPath(path); - } - }//}}} - - //{{{ getSelectedNode() - /** - * Gets the current node that is selected for editing. - * @return the current selected node or null if no node is selected. - */ - public AdapterNode getSelectedNode() { - TreePath selPath = getLeadSelectionPath(); - AdapterNode selectedNode = null; - if (selPath != null) { - selectedNode = (AdapterNode)selPath.getLastPathComponent(); - } - return selectedNode; - }//}}} - - //{{{ cut() - /** - * Cuts the currently selected node out of the tree and places it in the - * clipboard. - * @return true if the node was successfully cut - * @throws DOMException if the node cannot be removed from the tree. - */ - public boolean cut() throws DOMException { - AdapterNode selectedNode = getSelectedNode(); - Clipboard clipBoard = getToolkit().getSystemClipboard(); - if (selectedNode != null) { - try { - clipBoard.setContents(new TransferableNode(selectedNode), this); - selectedNode.getParentNode().remove(selectedNode); - updateUI(); - return true; - } catch (IllegalStateException e) { - Log.log(Log.ERROR, this, e); - } catch (HeadlessException e) { - Log.log(Log.ERROR, this, e); - } catch (DOMException e) { - clipBoard.setContents(null, this); - throw e; - } - } - return false; - }//}}} - - //{{{ copy() - /** - * Copies the currently selected node to the clipboard. - * @return true if the node was copied successfully - */ - public boolean copy() { - AdapterNode selectedNode = getSelectedNode(); - if (selectedNode != null) { - try { - Clipboard clipBoard = getToolkit().getSystemClipboard(); - AdapterNode newNode = selectedNode.copy(true); - clipBoard.setContents(new TransferableNode(newNode), this); - return true; - } catch (IllegalStateException e) { - Log.log(Log.ERROR, this, e); - } catch (HeadlessException e) { - Log.log(Log.ERROR, this, e); - } - } - return false; - }//}}} - - //{{{ paste() - /** - * Pastes the contents of the clipboard into the currently selected node - * in the document tree. - * @return true if the node was pasted successfully - * @throws DOMException if the node cannot be inserted in the current - * location. - */ - public boolean paste() throws DOMException { - AdapterNode selectedNode = getSelectedNode(); - if (selectedNode != null) { - try { - Clipboard clipBoard = getToolkit().getSystemClipboard(); - Transferable contents = clipBoard.getContents(this); - if (contents != null) { - if (contents.isDataFlavorSupported(TransferableNode.nodeFlavor)) { - AdapterNode node = (AdapterNode)contents.getTransferData(TransferableNode.nodeFlavor); - TreePath pastePath = getLeadSelectionPath(); - selectedNode.addAdapterNode(node); - - //reset the clipboard - StringSelection sel = new StringSelection(""); - clipBoard.setContents(sel, sel); - - refreshExpandedStates(pastePath); - addSelectionPath(pastePath.pathByAddingChild(node)); - updateUI(); - return true; - } - } - } catch (IllegalStateException e) { - Log.log(Log.ERROR, this, e); - } catch (HeadlessException e) { - Log.log(Log.ERROR, this, e); - } catch (UnsupportedFlavorException e) { - Log.log(Log.ERROR, this, e); - } catch (IOException e) { - Log.log(Log.ERROR, this, e); - } - } - return false; - }//}}} - - //{{{ Autoscroll methods - - //{{{ autoscroll() - - public void autoscroll(Point cursorLocn) { - int row = getClosestRowForLocation(cursorLocn.x, cursorLocn.y); - - if (row < 0) { - return; - } - - Rectangle bounds = getBounds(); - - if (cursorLocn.y + bounds.y <= m_AUTOSCROLL_MARGIN) { - if (row <= 0) { - row = 0; - } else { - row -=1; - } - } else { - if (row < getRowCount() - 1) { - row += 1; - } - } - scrollRowToVisible(row); - }//}}} - - //{{{ getAutoscrollInsets() - - public Insets getAutoscrollInsets() { - - Rectangle outerBounds = getBounds(); - Rectangle innerBounds = getParent().getBounds(); - int top = innerBounds.y - outerBounds.y + m_AUTOSCROLL_MARGIN; - int left = innerBounds.x - outerBounds.x + m_AUTOSCROLL_MARGIN; - int bottom = outerBounds.height - innerBounds.height - innerBounds.y + outerBounds.y + m_AUTOSCROLL_MARGIN; - int right = outerBounds.width - innerBounds.width - innerBounds.x + outerBounds.y + m_AUTOSCROLL_MARGIN; - return new Insets(top, left, bottom, right); - }//}}} - - //}}} - - //{{{ ClipboardOwner methods - - //{{{ lostOwnership() - - public void lostOwnership(Clipboard clipboard, Transferable contents) { - // Nothing right now. - }//}}} - - //}}} - - //{{{ Private static members - private static final ImageIcon m_elementIcon = new ImageIcon(DefaultView.class.getResource("/net/sourceforge/jsxe/icons/Element.png"), "Element"); - private static final ImageIcon m_textIcon = new ImageIcon(DefaultView.class.getResource("/net/sourceforge/jsxe/icons/Text.png"), "Text"); - private static final ImageIcon m_CDATAIcon = new ImageIcon(DefaultView.class.getResource("/net/sourceforge/jsxe/icons/CDATA.png"), "CDATA"); - private static final ImageIcon m_commentIcon = new ImageIcon(DefaultView.class.getResource("/net/sourceforge/jsxe/icons/Comment.png"), "Comment"); - // private static final ImageIcon m_externalEntityIcon = new ImageIcon(DefaultView.class.getResource("/net/sourceforge/jsxe/icons/ExternalEntity.png"), "External Entity"); - private static final ImageIcon m_internalEntityIcon = new ImageIcon(DefaultView.class.getResource("/net/sourceforge/jsxe/icons/InternalEntity.png"), "Internal Entity"); - - private static final int m_AUTOSCROLL_MARGIN = 12; - //}}} - - //{{{ Private members - - //{{{ refreshExpandedStates() - /** - * Refreshes the expanded states of all the node pointed to by - * the treepath and all nodes below it. Used after a drag and - * drop is done because the JTree uses TreePaths to keep track - * of expanded states. When a drag and drop is done the - * path is broken and the expanded states are lost. - */ - private void refreshExpandedStates(TreePath path) { - AdapterNode node = (AdapterNode)path.getLastPathComponent(); - boolean expandedState = isExpanded(node); - if (node.childCount() > 0) { - expandPath(path); //expand all nodes out - //still have to set expanded states - int children = node.childCount(); - for (int i=0;i < children; i++) { - TreePath newPath = path.pathByAddingChild(node.child(i)); - refreshExpandedStates(newPath); - } - if (expandedState) { //close non-expanded nodes - expandPath(path); - } else { - collapsePath(path); - } - } - }//}}} - - //{{{ toString() - /** - * Creates the string that will be displayed in the tree node - * @param showattrs "ID only", "All" or "None" - */ - private static String toString(AdapterNode node) { - StringBuffer s = new StringBuffer(); - if (node.getNodeType() == Node.DOCUMENT_NODE) - return "Document Root"; - String nodeName = node.getNodeName(); - if (! nodeName.startsWith("#")) { - s.append(nodeName); - if (node.getNodeType() == AdapterNode.ELEMENT_NODE) { - NamedNodeMap attributes = node.getAttributes(); - ElementDecl decl = node.getElementDecl(); - XMLDocument document = node.getOwnerDocument(); - String showAttrs = document.getProperty(DefaultView.SHOW_ATTRIBUTES); - for (int i=0; i<attributes.getLength(); i++) { - Node attr = attributes.item(i); - ElementDecl.AttributeDecl attrDecl = (decl != null) ? decl.getAttribute(attr.getNodeName()) : null; - if (showAttrs.equals("All") || - (showAttrs.equals("ID only") && - ((attr.getNodeName().equalsIgnoreCase("id") || - (attrDecl != null && attrDecl.type.equals("ID")))))) - { - s.append(' '+attr.getNodeName() + "=\"" + attr.getNodeValue() + '"'); - } - } - } - } - if (s.length()==0) { - if (node.getNodeValue() != null) { - String t = node.getNodeValue().trim(); - int x = t.indexOf("\n"); - if (x >= 0) { - t = t.substring(0, x); - } - if (t.length() > 50) { - t = t.substring(0, 50) + "..."; - } - s.append(t); - } - } - return s.toString(); - }//}}} - - //{{{ TreePopupListener class - //TODO: rework this class - private class TreePopupListener extends MouseAdapter { - - //{{{ mousePressed() - - public void mousePressed(MouseEvent e) { - maybeShowPopup(e); - }//}}} - - //{{{ mouseReleased() - - public void mouseReleased(MouseEvent e) { - maybeShowPopup(e); - }//}}} - - //{{{ maybeShowPopup() - - private void maybeShowPopup(MouseEvent e) { - TreePath selPath = getPathForLocation(e.getX(), e.getY()); - if (e.isPopupTrigger() && selPath != null) { - setSelectionPath(selPath); - - //Don't want to interact with AdapterNodes too much. Maybe change this. - AdapterNode selectedNode = ((AdapterNode)selPath.getLastPathComponent()); - XMLDocument ownerDocument = selectedNode.getOwnerDocument(); - - JMenuItem popupMenuItem; - JMenu addNodeItem = new JMenu(Messages.getMessage("common.add")); - JPopupMenu popup = new JPopupMenu(); - boolean showpopup = false; - boolean addNodeShown = false; - - if (selectedNode.getNodeType() == Node.ELEMENT_NODE) { - - JMenu addElement = new EnhancedMenu(Messages.getMessage("xml.element"), 20); - addNodeItem.add(addElement); - - addElement.add(jsXe.getAction("treeview.add.element.node")); - Iterator allowedElements = selectedNode.getAllowedElements().iterator(); - while (allowedElements.hasNext()) { - ElementDecl decl = (ElementDecl)allowedElements.next(); - addElement.add(new AddNodeAction(decl, decl.name)); - } - - //Add the allowed entities even if no matter what - - JMenu addEntity = new EnhancedMenu(Messages.getMessage("xml.entity.reference"), 20); - addNodeItem.add(addEntity); - - Iterator allowedEntities = ownerDocument.getAllowedEntities().iterator(); - while (allowedEntities.hasNext()) { - EntityDecl decl = (EntityDecl)allowedEntities.next(); - popupMenuItem = new JMenuItem(new AddNodeAction(decl.name, decl.name, decl.value, AdapterNode.ENTITY_REFERENCE_NODE)); - addEntity.add(popupMenuItem); - } - - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.add.text.node")); - popupMenuItem.setText(Messages.getMessage("xml.text")); - addNodeItem.add(popupMenuItem); - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.add.cdata.node")); - popupMenuItem.setText(Messages.getMessage("xml.cdata")); - addNodeItem.add(popupMenuItem); - - // popupMenuItem = new JMenuItem(new AddNodeAction("New_Entity", "", Node.ENTITY_REFERENCE_NODE)); - // addNodeItem.add(popupMenuItem); - addNodeShown = true; - showpopup = true; - } - - if (selectedNode.getNodeType() == Node.DOCUMENT_NODE) { - if (ownerDocument.getDocType() == null) { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.add.doctype.node")); - popupMenuItem.setText(Messages.getMessage("xml.doctypedef")); - addNodeItem.add(popupMenuItem); - showpopup = true; - } - } - - if (selectedNode.getNodeType() == Node.DOCUMENT_NODE || selectedNode.getNodeType() == Node.ELEMENT_NODE) { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.add.processing.instruction.node")); - popupMenuItem.setText(Messages.getMessage("xml.processing.instruction")); - addNodeItem.add(popupMenuItem); - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.add.comment.node")); - popupMenuItem.setText(Messages.getMessage("xml.comment")); - addNodeItem.add(popupMenuItem); - addNodeShown = true; - showpopup = true; - } - - if (addNodeShown) { - popup.add(addNodeItem); - } - - //Add the edit node action - if (selectedNode.getNodeType() == Node.ELEMENT_NODE && ownerDocument.getElementDecl(selectedNode.getNodeName()) != null) { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.edit.node")); - popup.add(popupMenuItem); - showpopup = true; - } - - if (selectedNode.getNodeType() == Node.ELEMENT_NODE || selectedNode.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.rename.node")); - popup.add(popupMenuItem); - showpopup = true; - } - //if the node is not the document, document type, or the document root. - if (selectedNode.getNodeType() != Node.DOCUMENT_NODE && - selectedNode.getNodeType() != Node.DOCUMENT_TYPE_NODE && - !(selectedNode.getNodeType() == Node.ELEMENT_NODE && - selectedNode.getParentNode().getNodeType() == Node.DOCUMENT_NODE)) - { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.remove.node")); - popup.add(popupMenuItem); - showpopup = true; - } - - if (selectedNode.getNodeType() != Node.DOCUMENT_NODE && - selectedNode.getNodeType() != Node.DOCUMENT_TYPE_NODE) - { - popup.addSeparator(); - if(!(selectedNode.getNodeType() == Node.ELEMENT_NODE && - selectedNode.getParentNode().getNodeType() == Node.DOCUMENT_NODE)) - { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.cut.node")); - popup.add(popupMenuItem); - } - - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.copy.node")); - popup.add(popupMenuItem); - - if (selectedNode.getNodeType() == Node.ELEMENT_NODE) { - popupMenuItem = new JMenuItem(jsXe.getAction("treeview.paste.node")); - popup.add(popupMenuItem); - } - showpopup = true; - } - - if (showpopup) { - popup.show(e.getComponent(), e.getX(), e.getY()); - } - } - }//}}} - - }//}}} - - //{{{ DefaultViewTreeCellRenderer class - - private class DefaultViewTreeCellRenderer extends DefaultTreeCellRenderer { - - //{{{ DefaultViewTreeCellRenderer constructor - - DefaultViewTreeCellRenderer() { - m_defaultLeafIcon = getLeafIcon(); - m_defaultOpenIcon = getOpenIcon(); - m_defaultClosedIcon = getClosedIcon(); - m_defaultBackgroundSelectionColor = this.backgroundSelectionColor; - }//}}} - - //{{{ getTreeCellRendererComponent() - - public Component getTreeCellRendererComponent(JTree tree, - Object value, boolean selected, boolean expanded, - boolean leaf, int row, boolean hasFocus) - { - - int type = -1; - try { - AdapterNode node = (AdapterNode)value; - type = node.getNodeType(); - setText(DefaultViewTree.toString(node)); - } catch (ClassCastException e) {} - - this.selected = selected; - if (value != null && m_dragOverTarget == value) { - this.selected = true; - backgroundSelectionColor = m_dragSelectionColor; - } else { - backgroundSelectionColor = m_defaultBackgroundSelectionColor; - } - - switch (type) { - case Node.ELEMENT_NODE: - setIcon(m_elementIcon); - setLeafIcon(m_elementIcon); - setOpenIcon(m_elementIcon); - setClosedIcon(m_elementIcon); - setToolTipText(Messages.getMessage("xml.element")); - break; - case Node.TEXT_NODE: - setIcon(m_textIcon); - setLeafIcon(m_textIcon); - setOpenIcon(m_textIcon); - setClosedIcon(m_textIcon); - setToolTipText(Messages.getMessage("xml.text")); - break; - case Node.CDATA_SECTION_NODE: - setIcon(m_CDATAIcon); - setLeafIcon(m_CDATAIcon); - setOpenIcon(m_CDATAIcon); - setClosedIcon(m_CDATAIcon); - setToolTipText(Messages.getMessage("xml.cdata")); - break; - case Node.COMMENT_NODE: - setIcon(m_commentIcon); - setLeafIcon(m_commentIcon); - setOpenIcon(m_commentIcon); - setClosedIcon(m_commentIcon); - setToolTipText(Messages.getMessage("xml.comment")); - break; - case Node.ENTITY_REFERENCE_NODE: - setIcon(m_internalEntityIcon); - setLeafIcon(m_internalEntityIcon); - setOpenIcon(m_internalEntityIcon); - setClosedIcon(m_internalEntityIcon); - setToolTipText(Messages.getMessage("xml.entity.reference")); - break; - case Node.DOCUMENT_NODE: - setIcon(m_defaultClosedIcon); - setLeafIcon(m_defaultLeafIcon); - setOpenIcon(m_defaultOpenIcon); - setClosedIcon(m_defaultClosedIcon); - setToolTipText(Messages.getMessage("xml.document")); - break; - case Node.PROCESSING_INSTRUCTION_NODE: - setIcon(m_defaultLeafIcon); - setLeafIcon(m_defaultLeafIcon); - setOpenIcon(m_defaultLeafIcon); - setClosedIcon(m_defaultLeafIcon); - setToolTipText(Messages.getMessage("xml.processing.instruction")); - break; - case Node.DOCUMENT_TYPE_NODE: - setIcon(m_defaultLeafIcon); - setLeafIcon(m_defaultLeafIcon); - setOpenIcon(m_defaultLeafIcon); - setClosedIcon(m_defaultLeafIcon); - setToolTipText(Messages.getMessage("xml.doctypedef")); - break; - default: - if (leaf) { - setIcon(m_defaultLeafIcon); - } else { - if (expanded) { - setIcon(m_defaultOpenIcon); - } else { - setIcon(m_defaultClosedIcon); - } - } - - setLeafIcon(m_defaultLeafIcon); - setOpenIcon(m_defaultOpenIcon); - setClosedIcon(m_defaultClosedIcon); - setToolTipText("Unknown node"); - break; - } - - return this; - }//}}} - - //{{{ Private members - - private Icon m_defaultLeafIcon; - private Icon m_defaultOpenIcon; - private Icon m_defaultClosedIcon; - private Color m_defaultBackgroundSelectionColor; - //}}} - - }//}}} - - //{{{ ElementTreeCellRenderer class - - private class ElementTreeCellRenderer extends DefaultTreeCellRenderer { - - //{{{ ElementTreeCellRenderer constructor - - public ElementTreeCellRenderer() { - m_defaultLe... [truncated message content] |
From: <ian...@us...> - 2006-09-05 15:47:35
|
Revision: 1234 http://svn.sourceforge.net/jsxe/?rev=1234&view=rev Author: ian_lewis Date: 2006-09-05 08:47:20 -0700 (Tue, 05 Sep 2006) Log Message: ----------- Merge from trunk/treeview of rev. 1232 Modified Paths: -------------- branches/treeview2/Changelog branches/treeview2/dependency.props branches/treeview2/src/treeview/DefaultView.java branches/treeview2/src/treeview/TreeViewPlugin.java branches/treeview2/src/treeview/TreeViewTree.java branches/treeview2/src/treeview/action/AddNodeAction.java branches/treeview2/src/treeview/action/CopyNodeAction.java branches/treeview2/src/treeview/action/CutNodeAction.java branches/treeview2/src/treeview/action/EditNodeAction.java branches/treeview2/src/treeview/action/PasteNodeAction.java branches/treeview2/src/treeview/treeview.props Added Paths: ----------- branches/treeview2/messages/messages.properties branches/treeview2/messages/messages_de.properties branches/treeview2/messages/messages_ja.properties branches/treeview2/messages/messages_ru.properties branches/treeview2/messages/messages_sv.properties Removed Paths: ------------- branches/treeview2/messages/messages branches/treeview2/messages/messages.de branches/treeview2/messages/messages.ja branches/treeview2/messages/messages.sv Modified: branches/treeview2/Changelog =================================================================== --- branches/treeview2/Changelog 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/Changelog 2006-09-05 15:47:20 UTC (rev 1234) @@ -1,3 +1,34 @@ +08/31/2006 Ian Lewis <Ian...@me...> + + * Updated the sourceview actions to use the new ContextSpecificActions in + jsXe. + +08/30/2006 Ian Lewis <Ian...@me...> + + * Fixed null pointer exception when trying to cut a node that can't be + cut. + +08/29/2006 Ian Lewis <Ian...@me...> + + * Updated japanese translation + +08/21/2006 Ian Lewis <Ian...@me...> + + * Updated russian translation. + +08/08/2006 Ian Lewis <Ian...@me...> + + * Fixed undo when adding/editing a node that is specified in a DTD/Schema. + +08/07/2006 Ian Lewis <Ian...@me...> + + * The Edit menu has been moved to jsXe core. + +08/03/2006 Ian Lewis <Ian...@me...> + + * Added some English tooltip messages to the Global Options Pane for the + tree view. + 07/20/2006 Ian Lewis <Ian...@me...> * Updated actions and messages for options. Modified: branches/treeview2/dependency.props =================================================================== --- branches/treeview2/dependency.props 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/dependency.props 2006-09-05 15:47:20 UTC (rev 1234) @@ -1 +1 @@ -dependency.0=jsxe 00.05.03.00 +dependency.0=jsxe 00.05.04.00 Deleted: branches/treeview2/messages/messages =================================================================== --- branches/treeview2/messages/messages 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/messages/messages 2006-09-05 15:47:20 UTC (rev 1234) @@ -1,30 +0,0 @@ -# JSXE tree view English properties file -# $Id$ -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -TreeView.Options.Title=Tree View - -TreeView.Options.Show.Comments=Show comment nodes -TreeView.Options.Continuous.Layout=Continuous layout for split-panes -TreeView.Options.Show.Attributes=Show element attributes in tree: -Show.Attributes.None=None -Show.Attributes.ID.Only=ID only -Show.Attributes.All=All - - -treeview.rename.node.label=Rename Node -treeview.remove.node.label=Remove Node -treeview.add.attribute.label=Add Attribute -treeview.remove.attribute.label=Remove Attribute -treeview.edit.node.label=Edit Node -TreeView.EditDocType.Title=Edit Document Type Definition -Edit.Node.Dialog.Title=Edit Node - -treeview.add.doctype.node.label=Add Document Type Definition -treeview.add.element.node.label=Add Element Node -treeview.add.text.node.label=Add Text Node -treeview.add.cdata.node.label=Add CDATA Node -treeview.add.pi.node.label=Add Processing Instruction -treeview.add.comment.node.label=Add Comment Deleted: branches/treeview2/messages/messages.de =================================================================== --- branches/treeview2/messages/messages.de 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/messages/messages.de 2006-09-05 15:47:20 UTC (rev 1234) @@ -1,22 +0,0 @@ -# JSXE tree view German properties file -# $Id$ -# Maintained by Bianca Shöen -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -# ä Ä é ö Ö ü Ü ß - -TreeView.Options.Title=Tree View Optionen -TreeView.Options.Show.Comments=Kommentar Knoten anzeigen -TreeView.Options.Show.Comments.ToolTip=Beim Deaktivieren werden sämtliche Kommentare in der momentan geöffneten XML Datei ausgeblendet. -TreeView.Options.Continuous.Layout=Durchgängiges Layout für split-panes -TreeView.Options.Continuous.Layout.ToolTip=<HTML>Dies beeinflusst das Aussehen des vertikalen Balkens in der Mitte des jsXE Screens.<BR>Ist dieses Auswahlkästchen nicht ausgewählt während der vertikale Balken vor und zurück über den Screen <BR>gezogen wird, bewegt er sich ohne Umstände.<BR>Ist dieses Auswahlkästchen nicht aktiviert während der vertikale Balken verschoben wird, verändert er sich in <BR>eine dicke schwarze Linie.</HTML> -TreeView.Options.Show.Attributes=Show element attributes in tree: -TreeView.Options.Show.Attributes.ToolTip=<HTML>Diese Option verlaubt es, die XML Datei auf verschiedene Arten anzuzeigen. <ul><li><strong>Keine</strong> - blendet alle Attribut-Informationen der Datei aus. </li><li><strong>Nur ID</strong> - nur Attribut-Informationen, die zu einem XML Element mit ID gehören, werden angezeigt.</li><li><strong>Alle</strong> - alle Attribut-Informationen werden angezeigt.</li></ul><HTML> -TreeView.RenameNode=Knoten umbenennen -TreeView.RemoveNode=Knoten entfernen -TreeView.AddAttribute=Attribut hinzufügen -TreeView.RemoveAttribute=Attribut entfernen -TreeView.EditNode=Knoten bearbeiten -Edit.Node.Dialog.Title=Knoten bearbeitenn Deleted: branches/treeview2/messages/messages.ja =================================================================== --- branches/treeview2/messages/messages.ja 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/messages/messages.ja 2006-09-05 15:47:20 UTC (rev 1234) @@ -1,29 +0,0 @@ -# JSXE tree view Japanese properties file -# $Id$ -# Maintained by Ian Lewis -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -TreeView.Options.Title=ツリー表示 - -TreeView.Options.Show.Comments=コメントノードを表示する -TreeView.Options.Show.Attributes=要素の属性を表示する: -Show.Attributes.None=なし -Show.Attributes.ID.Only=IDだけ -Show.Attributes.All=全て - -treeview.rename.node.label=ノードをリネーム -treeview.remove.node.label=ノードを削除 -treeview.add.attribute.label=属性を追加 -treeview.remove.attribute.label=属性を削除 -treeview.add.doctype.node.label=DTDを追加 -treeview.edit.node.label=ノードを編集 -TreeView.EditDocType.Title=DTDを編集 -Edit.Node.Dialog.Title=ノードを編集 - -treeview.add.element.node.label=要素を追加 -treeview.add.text.node.label=テキストを追加 -treeview.add.cdata.node.label=CDATA セクションを追加 -treeview.add.pi.node.label=処理命令を追加 -treeview.add.comment.node.label=コメントを追加 Copied: branches/treeview2/messages/messages.properties (from rev 1232, trunk/treeview/messages/messages.properties) =================================================================== --- branches/treeview2/messages/messages.properties (rev 0) +++ branches/treeview2/messages/messages.properties 2006-09-05 15:47:20 UTC (rev 1234) @@ -0,0 +1,34 @@ +# JSXE tree view English properties file +# $Id$ +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +TreeView.Options.Title=Tree View + +TreeView.Options.Show.Comments=Show comment nodes +TreeView.Options.Show.Comments.ToolTip=If this checkbox is checked then comment nodes will be shown in the tree. +TreeView.Options.Continuous.Layout=Continuous layout for split-panes +TreeView.Options.Continuous.Layout.ToolTip=<html>If this checkbox is checked then split panes will continuously repaint as you resize them.<br>Otherwise a black line is drawn to show the resize.</html> +TreeView.Options.Show.Attributes=Show element attributes in tree: +TreeView.Options.Show.Attributes.ToolTip=<html>This option specifies what attributes are shown in the tree.<ul><li><strong>None</strong> - No attrributes are shown.</li><li><strong>ID only</strong> - Only the attribute specified as the ID is shown.</li><li><strong>All</strong> - All attributes are shown.</li></ul></html> +Show.Attributes.None=None +Show.Attributes.ID.Only=ID only +Show.Attributes.All=All + +treeview.document.root=Document Root + +treeview.rename.node.label=Rename Node +treeview.remove.node.label=Remove Node +treeview.add.attribute.label=Add Attribute +treeview.remove.attribute.label=Remove Attribute +treeview.edit.node.label=Edit Node +TreeView.EditDocType.Title=Edit Document Type Definition +Edit.Node.Dialog.Title=Edit Node + +treeview.add.doctype.node.label=Add Document Type Definition +treeview.add.element.node.label=Add Element Node +treeview.add.text.node.label=Add Text Node +treeview.add.cdata.node.label=Add CDATA Node +treeview.add.pi.node.label=Add Processing Instruction +treeview.add.comment.node.label=Add Comment Deleted: branches/treeview2/messages/messages.sv =================================================================== --- branches/treeview2/messages/messages.sv 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/messages/messages.sv 2006-09-05 15:47:20 UTC (rev 1234) @@ -1,12 +0,0 @@ -# JSXE tree view Swedish properties file -# $Id$ -# Currently maintained by Patrik Johansson <pa...@it...> -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -TreeView.RenameNode=Ta bort nod -TreeView.RemoveNode=Ta bort nod -TreeView.AddAttribute=Lägg till attribut -TreeView.RemoveAttribute=Ta bort attribut -TreeView.EditNode=Redigera nod Copied: branches/treeview2/messages/messages_de.properties (from rev 1232, trunk/treeview/messages/messages_de.properties) =================================================================== --- branches/treeview2/messages/messages_de.properties (rev 0) +++ branches/treeview2/messages/messages_de.properties 2006-09-05 15:47:20 UTC (rev 1234) @@ -0,0 +1,22 @@ +# JSXE tree view German properties file +# $Id$ +# Maintained by Bianca Shöen +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +# ä Ä é ö Ö ü Ü ß + +TreeView.Options.Title=Tree View Optionen +TreeView.Options.Show.Comments=Kommentar Knoten anzeigen +TreeView.Options.Show.Comments.ToolTip=Beim Deaktivieren werden sämtliche Kommentare in der momentan geöffneten XML Datei ausgeblendet. +TreeView.Options.Continuous.Layout=Durchgängiges Layout für split-panes +TreeView.Options.Continuous.Layout.ToolTip=<HTML>Dies beeinflusst das Aussehen des vertikalen Balkens in der Mitte des jsXE Screens.<BR>Ist dieses Auswahlkästchen nicht ausgewählt während der vertikale Balken vor und zurück über den Screen <BR>gezogen wird, bewegt er sich ohne Umstände.<BR>Ist dieses Auswahlkästchen nicht aktiviert während der vertikale Balken verschoben wird, verändert er sich in <BR>eine dicke schwarze Linie.</HTML> +TreeView.Options.Show.Attributes=Show element attributes in tree: +TreeView.Options.Show.Attributes.ToolTip=<HTML>Diese Option verlaubt es, die XML Datei auf verschiedene Arten anzuzeigen. <ul><li><strong>Keine</strong> - blendet alle Attribut-Informationen der Datei aus. </li><li><strong>Nur ID</strong> - nur Attribut-Informationen, die zu einem XML Element mit ID gehören, werden angezeigt.</li><li><strong>Alle</strong> - alle Attribut-Informationen werden angezeigt.</li></ul><HTML> +TreeView.RenameNode=Knoten umbenennen +TreeView.RemoveNode=Knoten entfernen +TreeView.AddAttribute=Attribut hinzufügen +TreeView.RemoveAttribute=Attribut entfernen +TreeView.EditNode=Knoten bearbeiten +Edit.Node.Dialog.Title=Knoten bearbeitenn Copied: branches/treeview2/messages/messages_ja.properties (from rev 1232, trunk/treeview/messages/messages_ja.properties) =================================================================== --- branches/treeview2/messages/messages_ja.properties (rev 0) +++ branches/treeview2/messages/messages_ja.properties 2006-09-05 15:47:20 UTC (rev 1234) @@ -0,0 +1,31 @@ +# JSXE tree view Japanese properties file +# $Id$ +# Maintained by Ian Lewis +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +TreeView.Options.Title=ツリー表示 + +TreeView.Options.Show.Comments=コメントノードを表示する +TreeView.Options.Show.Attributes=要素の属性を表示する: +Show.Attributes.None=なし +Show.Attributes.ID.Only=IDだけ +Show.Attributes.All=全て + +treeview.document.root=ドキュメントルート + +treeview.rename.node.label=ノードをリネーム +treeview.remove.node.label=ノードを削除 +treeview.add.attribute.label=属性を追加 +treeview.remove.attribute.label=属性を削除 +treeview.add.doctype.node.label=DTDを追加 +treeview.edit.node.label=ノードを編集 +TreeView.EditDocType.Title=DTDを編集 +Edit.Node.Dialog.Title=ノードを編集 + +treeview.add.element.node.label=要素を追加 +treeview.add.text.node.label=テキストを追加 +treeview.add.cdata.node.label=CDATA セクションを追加 +treeview.add.pi.node.label=処理命令を追加 +treeview.add.comment.node.label=コメントを追加 Copied: branches/treeview2/messages/messages_ru.properties (from rev 1232, trunk/treeview/messages/messages_ru.properties) =================================================================== --- branches/treeview2/messages/messages_ru.properties (rev 0) +++ branches/treeview2/messages/messages_ru.properties 2006-09-05 15:47:20 UTC (rev 1234) @@ -0,0 +1,35 @@ +# JSXE tree view English properties file +# $Id: messages 1101 2006-08-03 15:40:34Z ian_lewis $ +# Maintained by Alexandr Gridnev (ale...@ya...) +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +TreeView.Options.Title=Отображение деревом + +TreeView.Options.Show.Comments=Показывать узлы-комментарии +TreeView.Options.Show.Comments.ToolTip=Если это выбрано - то узлы-комментарии будут отображаться в дереве +TreeView.Options.Continuous.Layout=При движении разделителей - сразу перерисовывать +TreeView.Options.Continuous.Layout.ToolTip=<html>Если выбрано - то при перемещении разделителей то что они разделяют будет сразу перерисовываться.<br>Если не выбрано - то положение линии будет отображаться черной полоской, а перерисовано все будет после того как вы отпустите мышару.</html> +TreeView.Options.Show.Attributes=Показывать элементы атрибутов в дереве: +TreeView.Options.Show.Attributes.ToolTip=<html>Эта опция определяет какие атрибуты элементов будут отображены в дереве.<ul><li><strong>Никаких</strong> - Атрибутов не покажут.</li><li><strong>только ID </strong> - Покажут только атрибут, определенный как ID.</li><li><strong>Все</strong> - Покажут все что есть.</li></ul></html> +Show.Attributes.None=Никаких +Show.Attributes.ID.Only=Только ID +Show.Attributes.All=Все + +treeview.document.root=Это корень документа + +treeview.rename.node.label=Переименовать узел +treeview.remove.node.label=Удалить узел +treeview.add.attribute.label=Добавить атрибут +treeview.remove.attribute.label=Удалить атрибут +treeview.edit.node.label=Редактировать узел +TreeView.EditDocType.Title=Редактировать определение типа документа (DTD) +Edit.Node.Dialog.Title=Редактирование узла + +treeview.add.doctype.node.label=Добавить определение типа документа (DTD) +treeview.add.element.node.label=Добавить узел-элемент +treeview.add.text.node.label=Добавить узел-текст +treeview.add.cdata.node.label=Добавиь узел-CDATA +treeview.add.pi.node.label=Добавить правило обработки +treeview.add.comment.node.label=Добавить комментарий Copied: branches/treeview2/messages/messages_sv.properties (from rev 1232, trunk/treeview/messages/messages_sv.properties) =================================================================== --- branches/treeview2/messages/messages_sv.properties (rev 0) +++ branches/treeview2/messages/messages_sv.properties 2006-09-05 15:47:20 UTC (rev 1234) @@ -0,0 +1,12 @@ +# JSXE tree view Swedish properties file +# $Id$ +# Currently maintained by Patrik Johansson <pa...@it...> +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +TreeView.RenameNode=Ta bort nod +TreeView.RemoveNode=Ta bort nod +TreeView.AddAttribute=Lägg till attribut +TreeView.RemoveAttribute=Ta bort attribut +TreeView.EditNode=Redigera nod Modified: branches/treeview2/src/treeview/DefaultView.java =================================================================== --- branches/treeview2/src/treeview/DefaultView.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/DefaultView.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -32,10 +32,14 @@ import net.sourceforge.jsxe.dom.*; import net.sourceforge.jsxe.dom.completion.ElementDecl; import net.sourceforge.jsxe.*; +import net.sourceforge.jsxe.action.ContextSpecificAction; import net.sourceforge.jsxe.gui.DocumentView; import net.sourceforge.jsxe.gui.Messages; +import net.sourceforge.jsxe.gui.TabbedView; import net.sourceforge.jsxe.util.Log; import net.sourceforge.jsxe.msg.PropertyChanged; +import net.sourceforge.jsxe.msg.UndoEvent; +import net.sourceforge.jsxe.msg.RedoEvent; //}}} //{{{ Swing components @@ -118,6 +122,7 @@ m_valueTextArea.setFont(new Font("Monospaced", 0, 12)); m_valueTextArea.setLineWrap(false); JScrollPane htmlView = new JScrollPane(m_valueTextArea); + //}}} //{{{ init attributes table @@ -136,6 +141,11 @@ JScrollPane treeView = new JScrollPane(tree); tree.addTreeSelectionListener(new DefaultTreeSelectionListener(this)); + //add context specific actions for the tree. + ActionManager.addActionImplementation("cut", tree, new CutNodeAction()); + ActionManager.addActionImplementation("copy", tree, new CopyNodeAction()); + ActionManager.addActionImplementation("paste", tree, new PasteNodeAction()); + //starts editing if the user start typing on one of the nodes //seems to catch user shortcuts too. Not sure how to resolve that. @@ -163,19 +173,6 @@ // });//}}} //}}} - //{{{ Construct Edit Menu - //TODO: get the keyboard shortcuts to work, - //TODO: get cut/copy/paste to work in the right hand text window - m_editMenu = new JMenu(Messages.getMessage("Edit.Menu")); - m_editMenu.setMnemonic('E'); - JMenuItem 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); - //}}} - //{{{ Create and set up the splitpanes vertSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, treeView, attrView); vertSplitPane.setContinuousLayout(false); @@ -244,6 +241,10 @@ } } + ActionManager.removeActionImplementation("cut", tree); + ActionManager.removeActionImplementation("copy", tree); + ActionManager.removeActionImplementation("paste", tree); + EditBus.removeFromBus(this); return true; @@ -264,7 +265,7 @@ //{{{ getMenus() public JMenu[] getMenus() { - return new JMenu[] { m_editMenu }; + return null; }//}}} //{{{ getDocumentBuffer() @@ -342,6 +343,11 @@ if (CONTINUOUS_LAYOUT.equals(key) || SHOW_COMMENTS.equals(key) || SHOW_ATTRIBUTES.equals(key)) { tree.updateUI(); } + } else { + if ((message instanceof UndoEvent) || (message instanceof RedoEvent)) { + //hack to get undo to work properly + m_valueTextArea.setDocument(new DefaultViewDocument(tree.getSelectedNode())); + } } }//}}} @@ -531,7 +537,6 @@ private DocumentBuffer m_document; private boolean m_viewShown = false; private TreeViewPlugin m_plugin; - private JMenu m_editMenu; private EditTagDialog.ComboValueRenderer m_comboRenderer = new EditTagDialog.ComboValueRenderer(); Modified: branches/treeview2/src/treeview/TreeViewPlugin.java =================================================================== --- branches/treeview2/src/treeview/TreeViewPlugin.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/TreeViewPlugin.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -63,9 +63,6 @@ addAction(new RemoveAttributeAction()); addAction(new EditNodeAction()); addAction(new AddDocTypeAction()); - addAction(new CutNodeAction()); - addAction(new CopyNodeAction()); - addAction(new PasteNodeAction()); }//}}} //{{{ newDocumentView() Modified: branches/treeview2/src/treeview/TreeViewTree.java =================================================================== --- branches/treeview2/src/treeview/TreeViewTree.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/TreeViewTree.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -196,8 +196,8 @@ Clipboard clipBoard = getToolkit().getSystemClipboard(); if (selectedNode != null) { try { - clipBoard.setContents(new TransferableNode(selectedNode), this); selectedNode.getParentNode().remove(selectedNode); + clipBoard.setContents(new TransferableNode(selectedNode), this); updateUI(); return true; } catch (IllegalStateException e) { @@ -205,7 +205,6 @@ } catch (HeadlessException e) { Log.log(Log.ERROR, this, e); } catch (DOMException e) { - clipBoard.setContents(null, this); throw e; } } @@ -376,7 +375,7 @@ private static String toString(AdapterNode node) { StringBuffer s = new StringBuffer(); if (node.getNodeType() == Node.DOCUMENT_NODE) - return "Document Root"; + return Messages.getMessage("treeview.document.root"); String nodeName = node.getNodeName(); if (! nodeName.startsWith("#")) { s.append(nodeName); @@ -451,8 +450,8 @@ if (selectedNode.getNodeType() == Node.ELEMENT_NODE) { - JMenu addElement = new WrappingMenu(Messages.getMessage("xml.element"), 20); - addNodeItem.add(addElement); + WrappingMenu addElement = new WrappingMenu(Messages.getMessage("xml.element"), 20); + addNodeItem.add(addElement.getJMenu()); addElement.add(ActionManager.getAction("treeview.add.element.node")); Iterator allowedElements = selectedNode.getAllowedElements().iterator(); @@ -463,8 +462,8 @@ //Add the allowed entities even if no matter what - JMenu addEntity = new WrappingMenu(Messages.getMessage("xml.entity.reference"), 20); - addNodeItem.add(addEntity); + WrappingMenu addEntity = new WrappingMenu(Messages.getMessage("xml.entity.reference"), 20); + addNodeItem.add(addEntity.getJMenu()); Iterator allowedEntities = ownerDocument.getAllowedEntities().iterator(); while (allowedEntities.hasNext()) { @@ -685,48 +684,48 @@ }//}}} - //{{{ ElementTreeCellRenderer class + // //{{{ ElementTreeCellRenderer class - private class ElementTreeCellRenderer extends DefaultTreeCellRenderer { + // private class ElementTreeCellRenderer extends DefaultTreeCellRenderer { - //{{{ ElementTreeCellRenderer constructor + // //{{{ ElementTreeCellRenderer constructor - public ElementTreeCellRenderer() { - m_defaultLeafIcon = getLeafIcon(); - }//}}} + // public ElementTreeCellRenderer() { + // m_defaultLeafIcon = getLeafIcon(); + // }//}}} - //{{{ getTreeCellRendererComponent + // //{{{ getTreeCellRendererComponent - public Component getTreeCellRendererComponent(JTree tree, - Object value, boolean selected, boolean expanded, - boolean leaf, int row, boolean hasFocus) - { - AdapterNode node = (AdapterNode)value; + // public Component getTreeCellRendererComponent(JTree tree, + // Object value, boolean selected, boolean expanded, + // boolean leaf, int row, boolean hasFocus) + // { + // AdapterNode node = (AdapterNode)value; - // We can rename processing instruction nodes here too. - if (node.getNodeType() == AdapterNode.PROCESSING_INSTRUCTION_NODE) { - setIcon(m_defaultLeafIcon); - setLeafIcon(m_defaultLeafIcon); - setOpenIcon(m_defaultLeafIcon); - setClosedIcon(m_defaultLeafIcon); - setToolTipText(Messages.getMessage("xml.processing.instruction")); - } else { - setIcon(m_elementIcon); - setLeafIcon(m_elementIcon); - setOpenIcon(m_elementIcon); - setClosedIcon(m_elementIcon); - setToolTipText(Messages.getMessage("xml.element")); - } + // // We can rename processing instruction nodes here too. + // if (node.getNodeType() == AdapterNode.PROCESSING_INSTRUCTION_NODE) { + // setIcon(m_defaultLeafIcon); + // setLeafIcon(m_defaultLeafIcon); + // setOpenIcon(m_defaultLeafIcon); + // setClosedIcon(m_defaultLeafIcon); + // setToolTipText(Messages.getMessage("xml.processing.instruction")); + // } else { + // setIcon(m_elementIcon); + // setLeafIcon(m_elementIcon); + // setOpenIcon(m_elementIcon); + // setClosedIcon(m_elementIcon); + // setToolTipText(Messages.getMessage("xml.element")); + // } - //just use the node name, we don't want attributes and such. - setText(((AdapterNode)value).getNodeName()); - return this; + // //just use the node name, we don't want attributes and such. + // setText(((AdapterNode)value).getNodeName()); + // return this; - }//}}} + // }//}}} - private Icon m_defaultLeafIcon; + // private Icon m_defaultLeafIcon; - }//}}} + // }//}}} //{{{ ElementCellEditor class Modified: branches/treeview2/src/treeview/action/AddNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/AddNodeAction.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/action/AddNodeAction.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -52,6 +52,7 @@ import net.sourceforge.jsxe.LocalizedAction; import net.sourceforge.jsxe.gui.DocumentView; import net.sourceforge.jsxe.gui.TabbedView; +import net.sourceforge.jsxe.dom.XMLDocument; import net.sourceforge.jsxe.dom.AdapterNode; import net.sourceforge.jsxe.dom.completion.ElementDecl; import net.sourceforge.jsxe.dom.completion.EntityDecl; @@ -116,27 +117,42 @@ AdapterNode addedNode = null; if (selectedNode != null) { try { + boolean isOk = true; if (m_element != null) { - if (m_element.getAttributes().size() > 0) { - EditTagDialog dialog = new EditTagDialog(jsXe.getActiveView(), - m_element, - new HashMap(), - m_element.empty, - m_element.completionInfo.getEntityHash(), - new ArrayList(), //don't support IDs for now. - selectedNode.getOwnerDocument()); - dialog.show(); - addedNode = selectedNode.addAdapterNode(dialog.getNewNode()); - } else { - addedNode = selectedNode.addAdapterNode(m_element.name, null, AdapterNode.ELEMENT_NODE, selectedNode.childCount()); + XMLDocument document = selectedNode.getOwnerDocument(); + try { + document.beginCompoundEdit(); + if (m_element.getAttributes().size() > 0) { + EditTagDialog dialog = new EditTagDialog(jsXe.getActiveView(), + m_element, + new HashMap(), + m_element.empty, + m_element.completionInfo.getEntityHash(), + new ArrayList(), //don't support IDs for now. + document); + dialog.show(); + isOk = (dialog.getNewNode() != null); + if (isOk) { + addedNode = selectedNode.addAdapterNode(dialog.getNewNode()); + } + } else { + addedNode = selectedNode.addAdapterNode(m_element.name, null, AdapterNode.ELEMENT_NODE, selectedNode.childCount()); + } + } finally { + document.endCompoundEdit(); } } else { //add the node of the correct type to the end of the children of this node addedNode = selectedNode.addAdapterNode(m_name, m_value, m_nodeType, selectedNode.childCount()); } - tree.expandPath(tree.getLeadSelectionPath()); - //The TreeModel doesn't automatically call treeNodesInserted() yet - tree.updateUI(); + + //if we hit cancel in the dialog we don't want to do this. + if (isOk) { + tree.expandPath(tree.getLeadSelectionPath()); + //The TreeModel doesn't automatically call treeNodesInserted() yet + tree.updateUI(); + } + } catch (DOMException dome) { JOptionPane.showMessageDialog(tree, dome, "XML Error", JOptionPane.WARNING_MESSAGE); Modified: branches/treeview2/src/treeview/action/CopyNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/CopyNodeAction.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/action/CopyNodeAction.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -29,10 +29,8 @@ import treeview.*; //{{{ AWT classes -import java.awt.datatransfer.Clipboard; import java.awt.event.ActionEvent; -import java.awt.Toolkit; -import java.awt.HeadlessException; +import java.awt.Component; //}}} //{{{ Swing classes @@ -43,7 +41,7 @@ //{{{ jsXe classes import net.sourceforge.jsxe.jsXe; -import net.sourceforge.jsxe.LocalizedAction; +import net.sourceforge.jsxe.action.ContextSpecificAction; import net.sourceforge.jsxe.gui.DocumentView; import net.sourceforge.jsxe.gui.Messages; import net.sourceforge.jsxe.gui.TabbedView; @@ -60,24 +58,10 @@ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ */ -public class CopyNodeAction extends LocalizedAction { +public class CopyNodeAction implements ContextSpecificAction.ActionImplementation { - //{{{ CopyNodeAction constructor - /** - * Creates a action that copies the current node out of the tree and into - * the clipboard. - */ - public CopyNodeAction() { - super(TreeViewPlugin.PLUGIN_NAME+".copy"); - }//}}} - - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.copy"); - }//}}} - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { + public void invoke(TabbedView view, Component comp, ActionEvent evt) { DocumentView docView = view.getDocumentView(); if (docView instanceof DefaultView) { DefaultView defView = (DefaultView)docView; Modified: branches/treeview2/src/treeview/action/CutNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/CutNodeAction.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/action/CutNodeAction.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -29,10 +29,8 @@ import treeview.*; //{{{ AWT classes -import java.awt.datatransfer.Clipboard; import java.awt.event.ActionEvent; -import java.awt.Toolkit; -import java.awt.HeadlessException; +import java.awt.Component; //}}} //{{{ Swing classes @@ -48,10 +46,11 @@ //{{{ jsXe classes import net.sourceforge.jsxe.jsXe; -import net.sourceforge.jsxe.LocalizedAction; +import net.sourceforge.jsxe.action.ContextSpecificAction; import net.sourceforge.jsxe.gui.DocumentView; import net.sourceforge.jsxe.gui.Messages; import net.sourceforge.jsxe.gui.TabbedView; +import net.sourceforge.jsxe.gui.GUIUtilities; import net.sourceforge.jsxe.dom.AdapterNode; import net.sourceforge.jsxe.util.Log; //}}} @@ -65,25 +64,10 @@ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ */ -public class CutNodeAction extends LocalizedAction { +public class CutNodeAction implements ContextSpecificAction.ActionImplementation { - //{{{ CutNodeAction constructor - /** - * Creates a action that cuts the current node out of the tree and into - * the clipboard. - */ - public CutNodeAction() { - super(TreeViewPlugin.PLUGIN_NAME+".cut"); - // putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke("ctrl X")); - }//}}} - - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.cut"); - }//}}} - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { + public void invoke(TabbedView view, Component comp, ActionEvent evt) { DocumentView docView = view.getDocumentView(); if (docView instanceof DefaultView) { DefaultView defView = (DefaultView)docView; @@ -91,7 +75,7 @@ try { tree.cut(); } catch (DOMException dome) { - JOptionPane.showMessageDialog(tree, dome, "XML Error", JOptionPane.WARNING_MESSAGE); + GUIUtilities.error(tree, "XML.Error", new Object[] { dome }); } } }//}}} Modified: branches/treeview2/src/treeview/action/EditNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/EditNodeAction.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/action/EditNodeAction.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -54,6 +54,7 @@ import net.sourceforge.jsxe.gui.Messages; import net.sourceforge.jsxe.gui.TabbedView; import net.sourceforge.jsxe.dom.AdapterNode; +import net.sourceforge.jsxe.dom.XMLDocument; import net.sourceforge.jsxe.dom.completion.ElementDecl; //}}} @@ -86,18 +87,24 @@ AdapterNode addedNode = null; if (selectedNode != null && selectedNode.getNodeType() == AdapterNode.ELEMENT_NODE) { try { - ElementDecl element = selectedNode.getOwnerDocument().getElementDecl(selectedNode.getNodeName()); + XMLDocument document = selectedNode.getOwnerDocument(); + ElementDecl element = document.getElementDecl(selectedNode.getNodeName()); if (element != null) { - //Edit tag dialog needs to be reworked - EditTagDialog dialog = new EditTagDialog(jsXe.getActiveView(), - element, - new HashMap(), - element.empty, - element.completionInfo.getEntityHash(), - new ArrayList(), //don't support IDs for now. - selectedNode.getOwnerDocument(), - selectedNode); - dialog.show(); + + try { + document.beginCompoundEdit(); + EditTagDialog dialog = new EditTagDialog(jsXe.getActiveView(), + element, + new HashMap(), + element.empty, + element.completionInfo.getEntityHash(), + new ArrayList(), //don't support IDs for now. + selectedNode.getOwnerDocument(), + selectedNode); + dialog.show(); + } finally { + document.endCompoundEdit(); + } //The TreeModel doesn't automatically call treeNodesInserted() yet tree.updateUI(); } Modified: branches/treeview2/src/treeview/action/PasteNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/PasteNodeAction.java 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/action/PasteNodeAction.java 2006-09-05 15:47:20 UTC (rev 1234) @@ -29,10 +29,8 @@ import treeview.*; //{{{ AWT classes -import java.awt.datatransfer.Clipboard; import java.awt.event.ActionEvent; -import java.awt.Toolkit; -import java.awt.HeadlessException; +import java.awt.Component; //}}} //{{{ Swing classes @@ -48,7 +46,7 @@ //{{{ jsXe classes import net.sourceforge.jsxe.jsXe; -import net.sourceforge.jsxe.LocalizedAction; +import net.sourceforge.jsxe.action.ContextSpecificAction; import net.sourceforge.jsxe.gui.DocumentView; import net.sourceforge.jsxe.gui.Messages; import net.sourceforge.jsxe.gui.TabbedView; @@ -65,24 +63,10 @@ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ */ -public class PasteNodeAction extends LocalizedAction { +public class PasteNodeAction implements ContextSpecificAction.ActionImplementation { - //{{{ PasteNodeAction constructor - /** - * Creates an action that pastes the node in the clipboard to the currently - * selected node in the tree. - */ - public PasteNodeAction() { - super(TreeViewPlugin.PLUGIN_NAME+".paste"); - }//}}} - - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.paste"); - }//}}} - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { + public void invoke(TabbedView view, Component comp, ActionEvent evt) { DocumentView docView = view.getDocumentView(); if (docView instanceof DefaultView) { DefaultView defView = (DefaultView)docView; Modified: branches/treeview2/src/treeview/treeview.props =================================================================== --- branches/treeview2/src/treeview/treeview.props 2006-09-05 15:46:47 UTC (rev 1233) +++ branches/treeview2/src/treeview/treeview.props 2006-09-05 15:47:20 UTC (rev 1234) @@ -15,7 +15,7 @@ # a percentage of the horizontal size of the parent container treeview.splitpane.horiz.loc=40 -treeview.show.attributes=ID only +treeview.show.attributes=1 #default size for edit doc type dialog treeview.editdoctypenode.width=200 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-09-07 00:02:04
|
Revision: 1244 http://svn.sourceforge.net/jsxe/?rev=1244&view=rev Author: ian_lewis Date: 2006-09-06 17:01:54 -0700 (Wed, 06 Sep 2006) Log Message: ----------- Updated to not use the show() method since it's deprecated Modified Paths: -------------- branches/treeview2/Changelog branches/treeview2/src/treeview/action/AddDocTypeAction.java branches/treeview2/src/treeview/action/AddNodeAction.java branches/treeview2/src/treeview/action/EditNodeAction.java Modified: branches/treeview2/Changelog =================================================================== --- branches/treeview2/Changelog 2006-09-06 23:23:23 UTC (rev 1243) +++ branches/treeview2/Changelog 2006-09-07 00:01:54 UTC (rev 1244) @@ -1,3 +1,7 @@ +09/06/2006 Ian Lewis <Ian...@me...> + + * Updated to not use show() method since it's deprecated. + 08/31/2006 Ian Lewis <Ian...@me...> * Updated the sourceview actions to use the new ContextSpecificActions in Modified: branches/treeview2/src/treeview/action/AddDocTypeAction.java =================================================================== --- branches/treeview2/src/treeview/action/AddDocTypeAction.java 2006-09-06 23:23:23 UTC (rev 1243) +++ branches/treeview2/src/treeview/action/AddDocTypeAction.java 2006-09-07 00:01:54 UTC (rev 1244) @@ -223,7 +223,7 @@ updateSize(); - show(); + setVisible(true); }//}}} @@ -326,6 +326,5 @@ }//}}} - //}}} } Modified: branches/treeview2/src/treeview/action/AddNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/AddNodeAction.java 2006-09-06 23:23:23 UTC (rev 1243) +++ branches/treeview2/src/treeview/action/AddNodeAction.java 2006-09-07 00:01:54 UTC (rev 1244) @@ -130,7 +130,7 @@ m_element.completionInfo.getEntityHash(), new ArrayList(), //don't support IDs for now. document); - dialog.show(); + dialog.setVisible(true); isOk = (dialog.getNewNode() != null); if (isOk) { addedNode = selectedNode.addAdapterNode(dialog.getNewNode()); Modified: branches/treeview2/src/treeview/action/EditNodeAction.java =================================================================== --- branches/treeview2/src/treeview/action/EditNodeAction.java 2006-09-06 23:23:23 UTC (rev 1243) +++ branches/treeview2/src/treeview/action/EditNodeAction.java 2006-09-07 00:01:54 UTC (rev 1244) @@ -101,7 +101,7 @@ new ArrayList(), //don't support IDs for now. selectedNode.getOwnerDocument(), selectedNode); - dialog.show(); + dialog.setVisible(true); } finally { document.endCompoundEdit(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |