fix 105977 - Not able to open the older xslt projects in the latest NB build.
1.1 --- a/xslt.core/src/org/netbeans/modules/xslt/core/XSLTDataObject.java Thu Jun 07 13:40:43 2007 +0000
1.2 +++ b/xslt.core/src/org/netbeans/modules/xslt/core/XSLTDataObject.java Thu Jun 07 13:42:33 2007 +0000
1.3 @@ -18,11 +18,15 @@
1.4 */
1.5 package org.netbeans.modules.xslt.core;
1.6
1.7 +import java.awt.event.ActionEvent;
1.8 import java.io.IOException;
1.9 import java.util.LinkedList;
1.10 import java.util.List;
1.11 import java.util.concurrent.atomic.AtomicBoolean;
1.12 import java.util.concurrent.atomic.AtomicReference;
1.13 +import javax.swing.AbstractAction;
1.14 +import javax.swing.Action;
1.15 +import org.netbeans.modules.xslt.core.multiview.XsltMultiViewSupport;
1.16 import org.netbeans.modules.xslt.mapper.model.MapperContext;
1.17 import org.netbeans.modules.xslt.model.XslModel;
1.18 import org.netbeans.spi.xml.cookies.CheckXMLSupport;
1.19 @@ -182,8 +186,9 @@
1.20 }
1.21 }
1.22
1.23 + @Override
1.24 protected Node createNodeDelegate() {
1.25 - return new XSLTDataNode(this);
1.26 + return new XSLTDataNode(this, getEditorSupport());
1.27 }
1.28
1.29 public XSLTDataEditorSupport getEditorSupport() {
1.30 @@ -212,28 +217,31 @@
1.31 private static class XSLTDataNode extends DataNode {
1.32 XSLTDataEditorSupport myEditorSupport;
1.33
1.34 - public XSLTDataNode(XSLTDataObject obj) {
1.35 + public XSLTDataNode(XSLTDataObject obj, XSLTDataEditorSupport support) {
1.36 super(obj, Children.LEAF);
1.37 setIconBaseWithExtension(XSLTDataLoaderBeanInfo.PATH_TO_IMAGE);
1.38 + myEditorSupport = support;
1.39 }
1.40
1.41 -// public Action getPreferredAction() {
1.42 -// return new AbstractAction() {
1.43 -// private static final long serialVersionUID = 1L;
1.44 -// public void actionPerformed(ActionEvent e) {
1.45 -// // Fix for #81066
1.46 -// if ( myEditorSupport.getOpenedPanes()==null ||
1.47 -// myEditorSupport.getOpenedPanes().length==0 ) {
1.48 -// myEditorSupport.open();
1.49 -// XsltMultiViewSupport support = XsltMultiViewSupport.getInstance();
1.50 -// support.requestViewOpen(myEditorSupport);
1.51 -// } else {
1.52 -// myEditorSupport.open();
1.53 -// }
1.54 -// }
1.55 -// };
1.56 -// }
1.57 -//
1.58 + @Override
1.59 + public Action getPreferredAction() {
1.60 + return new AbstractAction() {
1.61 + private static final long serialVersionUID = 1L;
1.62 + public void actionPerformed(ActionEvent e) {
1.63 + // Fix for #81066
1.64 + if ( myEditorSupport.getOpenedPanes()==null ||
1.65 + myEditorSupport.getOpenedPanes().length==0 )
1.66 + {
1.67 + myEditorSupport.open();
1.68 + XsltMultiViewSupport support =
1.69 + XsltMultiViewSupport.getInstance();
1.70 + support.requestViewOpen(myEditorSupport);
1.71 + } else {
1.72 + myEditorSupport.open();
1.73 + }
1.74 + }
1.75 + };
1.76 + }
1.77
1.78 }
1.79
2.1 --- a/xslt.core/src/org/netbeans/modules/xslt/core/resources/layer.xml Thu Jun 07 13:40:43 2007 +0000
2.2 +++ b/xslt.core/src/org/netbeans/modules/xslt/core/resources/layer.xml Thu Jun 07 13:42:33 2007 +0000
2.3 @@ -23,8 +23,13 @@
2.4 <folder name="application">
2.5 <folder name="xslt+xml">
2.6 <folder name="Actions">
2.7 - <file name="org-openide-actions-EditAction.instance"/>
2.8 - <attr name="org-openide-actions-EditAction.instance/org-openide-actions-FileSystemAction.instance" boolvalue="true"/>
2.9 + <file name="org-openide-actions-EditAction.instance_hidden"/>
2.10 + <file name="org-openide-actions-OpenAction.instance"/>
2.11 + <attr name="org-openide-actions-OpenAction.instance/sep-1a.instance" boolvalue="true"/>
2.12 + <file name="sep-1a.instance">
2.13 + <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
2.14 + </file>
2.15 + <attr name="sep-1a.instance/org-openide-actions-FileSystemAction.instance" boolvalue="true"/>
2.16 <file name="org-openide-actions-FileSystemAction.instance"/>
2.17 <attr name="org-openide-actions-FileSystemAction.instance/sep-1.instance" boolvalue="true"/>
2.18 <file name="sep-1.instance">
2.19 @@ -32,7 +37,7 @@
2.20 </file>
2.21 <attr name="sep-1.instance/org-netbeans-modules-xml-core-actions-CollectXMLAction.instance" boolvalue="true"/>
2.22 <file name="org-netbeans-modules-xml-core-actions-CollectXMLAction.instance"/>
2.23 - <attr name="org-netbeans-modules-xml-core-actions-CollectXMLAction.instance/sep-2.instance" boolvalue="true" />
2.24 + <attr name="org-netbeans-modules-xml-core-actions-CollectXMLAction.instance/sep-2.instance" boolvalue="true"/>
2.25 <file name="sep-2.instance">
2.26 <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
2.27 </file>
2.28 @@ -40,9 +45,9 @@
2.29 <file name="org-openide-actions-CutAction.instance"/>
2.30 <attr name="org-openide-actions-CutAction.instance/org-openide-actions-CopyAction.instance" boolvalue="true"/>
2.31 <file name="org-openide-actions-CopyAction.instance"/>
2.32 - <attr name="org-openide-actions-CopyAction.instance/org-openide-actions-PasteAction.instance" boolvalue="true" />
2.33 + <attr name="org-openide-actions-CopyAction.instance/org-openide-actions-PasteAction.instance" boolvalue="true"/>
2.34 <file name="org-openide-actions-PasteAction.instance"/>
2.35 - <attr name="org-openide-actions-PasteAction.instance/sep-3.instance" boolvalue="true" />
2.36 + <attr name="org-openide-actions-PasteAction.instance/sep-3.instance" boolvalue="true"/>
2.37 <file name="sep-3.instance">
2.38 <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
2.39 </file>
2.40 @@ -105,4 +110,3 @@
2.41 </folder>
2.42
2.43 </filesystem>
2.44 -