1.1 --- a/bpel.refactoring/build.xml Thu Feb 15 04:33:40 2007 +0000
1.2 +++ b/bpel.refactoring/build.xml Mon Feb 19 13:24:25 2007 +0000
1.3 @@ -1,21 +1,21 @@
1.4 <?xml version="1.0" encoding="UTF-8"?>
1.5 <!--
1.6 - The contents of this file are subject to the terms of the Common Development
1.7 - and Distribution License (the License). You may not use this file except in
1.8 - compliance with the License.
1.9 -
1.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
1.11 - or http://www.netbeans.org/cddl.txt.
1.12 -
1.13 - When distributing Covered Code, include this CDDL Header Notice in each file
1.14 - and include the License file at http://www.netbeans.org/cddl.txt.
1.15 - If applicable, add the following below the CDDL Header, with the fields
1.16 - enclosed by brackets [] replaced by your own identifying information:
1.17 - "Portions Copyrighted [year] [name of copyright owner]"
1.18 -
1.19 - The Original Software is NetBeans. The Initial Developer of the Original
1.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
1.21 - Microsystems, Inc. All Rights Reserved.
1.22 + The contents of this file are subject to the terms of the Common Development
1.23 + and Distribution License (the License). You may not use this file except in
1.24 + compliance with the License.
1.25 +
1.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
1.27 + or http://www.netbeans.org/cddl.txt.
1.28 +
1.29 + When distributing Covered Code, include this CDDL Header Notice in each file
1.30 + and include the License file at http://www.netbeans.org/cddl.txt.
1.31 + If applicable, add the following below the CDDL Header, with the fields
1.32 + enclosed by brackets [] replaced by your own identifying information:
1.33 + "Portions Copyrighted [year] [name of copyright owner]"
1.34 +
1.35 + The Original Software is NetBeans. The Initial Developer of the Original
1.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
1.37 + Microsystems, Inc. All Rights Reserved.
1.38 -->
1.39 <project name="refactoring" default="netbeans" basedir=".">
1.40 <import file="nbproject/build-impl.xml"/>
2.1 --- a/bpel.refactoring/nbproject/project.properties Thu Feb 15 04:33:40 2007 +0000
2.2 +++ b/bpel.refactoring/nbproject/project.properties Mon Feb 19 13:24:25 2007 +0000
2.3 @@ -2,18 +2,18 @@
2.4 # The contents of this file are subject to the terms of the Common Development
2.5 # and Distribution License (the License). You may not use this file except in
2.6 # compliance with the License.
2.7 -#
2.8 +#
2.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
2.10 # or http://www.netbeans.org/cddl.txt.
2.11 -#
2.12 +#
2.13 # When distributing Covered Code, include this CDDL Header Notice in each file
2.14 # and include the License file at http://www.netbeans.org/cddl.txt.
2.15 # If applicable, add the following below the CDDL Header, with the fields
2.16 # enclosed by brackets [] replaced by your own identifying information:
2.17 # "Portions Copyrighted [year] [name of copyright owner]"
2.18 -#
2.19 +#
2.20 # The Original Software is NetBeans. The Initial Developer of the Original
2.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
2.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
2.23 # Microsystems, Inc. All Rights Reserved.
2.24
2.25 javac.source=1.5
3.1 --- a/bpel.refactoring/nbproject/project.xml Thu Feb 15 04:33:40 2007 +0000
3.2 +++ b/bpel.refactoring/nbproject/project.xml Mon Feb 19 13:24:25 2007 +0000
3.3 @@ -1,21 +1,21 @@
3.4 <?xml version="1.0" encoding="UTF-8"?>
3.5 <!--
3.6 - The contents of this file are subject to the terms of the Common Development
3.7 - and Distribution License (the License). You may not use this file except in
3.8 - compliance with the License.
3.9 -
3.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
3.11 - or http://www.netbeans.org/cddl.txt.
3.12 -
3.13 - When distributing Covered Code, include this CDDL Header Notice in each file
3.14 - and include the License file at http://www.netbeans.org/cddl.txt.
3.15 - If applicable, add the following below the CDDL Header, with the fields
3.16 - enclosed by brackets [] replaced by your own identifying information:
3.17 - "Portions Copyrighted [year] [name of copyright owner]"
3.18 -
3.19 - The Original Software is NetBeans. The Initial Developer of the Original
3.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
3.21 - Microsystems, Inc. All Rights Reserved.
3.22 + The contents of this file are subject to the terms of the Common Development
3.23 + and Distribution License (the License). You may not use this file except in
3.24 + compliance with the License.
3.25 +
3.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
3.27 + or http://www.netbeans.org/cddl.txt.
3.28 +
3.29 + When distributing Covered Code, include this CDDL Header Notice in each file
3.30 + and include the License file at http://www.netbeans.org/cddl.txt.
3.31 + If applicable, add the following below the CDDL Header, with the fields
3.32 + enclosed by brackets [] replaced by your own identifying information:
3.33 + "Portions Copyrighted [year] [name of copyright owner]"
3.34 +
3.35 + The Original Software is NetBeans. The Initial Developer of the Original
3.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
3.37 + Microsystems, Inc. All Rights Reserved.
3.38 -->
3.39 <project xmlns="http://www.netbeans.org/ns/project/1">
3.40 <type>org.netbeans.modules.apisupport.project</type>
4.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/BpelVisitor.java Thu Feb 15 04:33:40 2007 +0000
4.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/BpelVisitor.java Mon Feb 19 13:24:25 2007 +0000
4.3 @@ -2,18 +2,18 @@
4.4 * The contents of this file are subject to the terms of the Common Development
4.5 * and Distribution License (the License). You may not use this file except in
4.6 * compliance with the License.
4.7 - *
4.8 + *
4.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
4.10 * or http://www.netbeans.org/cddl.txt.
4.11 - *
4.12 + *
4.13 * When distributing Covered Code, include this CDDL Header Notice in each file
4.14 * and include the License file at http://www.netbeans.org/cddl.txt.
4.15 * If applicable, add the following below the CDDL Header, with the fields
4.16 * enclosed by brackets [] replaced by your own identifying information:
4.17 * "Portions Copyrighted [year] [name of copyright owner]"
4.18 - *
4.19 + *
4.20 * The Original Software is NetBeans. The Initial Developer of the Original
4.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
4.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
4.23 * Microsystems, Inc. All Rights Reserved.
4.24 */
4.25 package org.netbeans.modules.bpel.refactoring;
4.26 @@ -60,6 +60,7 @@
4.27 import org.netbeans.modules.xml.xam.Named;
4.28 import org.netbeans.modules.xml.xam.Referenceable;
4.29 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.CorrelationProperty;
4.30 +import static org.netbeans.modules.print.api.PrintUI.*;
4.31
4.32 /**
4.33 * @author Vladimir Yaroslavskiy
4.34 @@ -79,8 +80,8 @@
4.35 @Override
4.36 public void visit(Import _import)
4.37 {
4.38 -//Log.out();
4.39 -//Log.out("[IMPORT] location: " + _import.getLocation());
4.40 +//out();
4.41 +//out("[IMPORT] location: " + _import.getLocation());
4.42 if (ImportHelper.getWsdlModel(_import) == myTarget ||
4.43 ImportHelper.getSchemaModel(_import) == myTarget)
4.44 {
4.45 @@ -91,8 +92,8 @@
4.46 @Override
4.47 public void visit(PartnerLink partnerLink)
4.48 {
4.49 -//Log.out();
4.50 -//Log.out("[PARTNER LINK]: " + Util.getName(partnerLink));
4.51 +//out();
4.52 +//out("[PARTNER LINK]: " + Util.getName(partnerLink));
4.53 Util.visit(
4.54 partnerLink.getPartnerLinkType(),
4.55 myTarget,
4.56 @@ -135,56 +136,56 @@
4.57 @Override
4.58 public void visit(StartCounterValue value)
4.59 {
4.60 -//Log.out();
4.61 -//Log.out("[START COUNTER]: " + Util.getName(value));
4.62 +//out();
4.63 +//out("[START COUNTER]: " + Util.getName(value));
4.64 visitContentElement(value);
4.65 }
4.66
4.67 @Override
4.68 public void visit(FinalCounterValue value)
4.69 {
4.70 -//Log.out();
4.71 -//Log.out("[FINAL COUNTER]: " + Util.getName(value));
4.72 +//out();
4.73 +//out("[FINAL COUNTER]: " + Util.getName(value));
4.74 visitContentElement(value);
4.75 }
4.76
4.77 @Override
4.78 public void visit(Branches branches)
4.79 {
4.80 -//Log.out();
4.81 -//Log.out("[BRANCHES]: " + Util.getName(branches));
4.82 +//out();
4.83 +//out("[BRANCHES]: " + Util.getName(branches));
4.84 visitContentElement(branches);
4.85 }
4.86
4.87 @Override
4.88 public void visit(BooleanExpr booleanExpression)
4.89 {
4.90 -//Log.out();
4.91 -//Log.out("[BOOLEAN EXPRESSION]: " + Util.getName(booleanExpression));
4.92 +//out();
4.93 +//out("[BOOLEAN EXPRESSION]: " + Util.getName(booleanExpression));
4.94 visitContentElement(booleanExpression);
4.95 }
4.96
4.97 @Override
4.98 public void visit(RepeatEvery repeatEvery)
4.99 {
4.100 -//Log.out();
4.101 -//Log.out("[REPEAT EVERY]: " + Util.getName(repeatEvery));
4.102 +//out();
4.103 +//out("[REPEAT EVERY]: " + Util.getName(repeatEvery));
4.104 visitContentElement(repeatEvery);
4.105 }
4.106
4.107 @Override
4.108 public void visit(DeadlineExpression deadline)
4.109 {
4.110 -//Log.out();
4.111 -//Log.out("[DEADLNE]: " + Util.getName(deadline));
4.112 +//out();
4.113 +//out("[DEADLNE]: " + Util.getName(deadline));
4.114 visitContentElement(deadline);
4.115 }
4.116
4.117 @Override
4.118 public void visit(For _for)
4.119 {
4.120 -//Log.out();
4.121 -//Log.out("[FOR]: " + Util.getName(_for));
4.122 +//out();
4.123 +//out("[FOR]: " + Util.getName(_for));
4.124 visitContentElement(_for);
4.125 }
4.126
4.127 @@ -243,9 +244,9 @@
4.128 @Override
4.129 public void visit(From from)
4.130 {
4.131 -//Log.out();
4.132 -//Log.out();
4.133 -//Log.out("[FROM]: " + Util.getName(from));
4.134 +//out();
4.135 +//out();
4.136 +//out("[FROM]: " + Util.getName(from));
4.137 Util.visit(
4.138 from.getPart(),
4.139 myTarget,
4.140 @@ -287,9 +288,9 @@
4.141 @Override
4.142 public void visit(To to)
4.143 {
4.144 -//Log.out();
4.145 -//Log.out();
4.146 -//Log.out("[TO]: " + Util.getName(to));
4.147 +//out();
4.148 +//out();
4.149 +//out("[TO]: " + Util.getName(to));
4.150 Util.visit(
4.151 to.getPart(),
4.152 myTarget,
4.153 @@ -329,7 +330,7 @@
4.154 }
4.155
4.156 private void visitContentElement(BpelEntity entity) {
4.157 -//Log.out("[CONTENT]: " + ((ContentElement) entity).getContent());
4.158 +//out("[CONTENT]: " + ((ContentElement) entity).getContent());
4.159 if (myXPath != null) {
4.160 myXPath.visit(((ContentElement) entity).getContent(), entity);
4.161 }
4.162 @@ -338,8 +339,8 @@
4.163 @Override
4.164 public void visit(OnEvent event)
4.165 {
4.166 -//Log.out();
4.167 -//Log.out("[EVENT]: " + Util.getName(event));
4.168 +//out();
4.169 +//out("[EVENT]: " + Util.getName(event));
4.170 Util.visit(
4.171 event.getMessageType(),
4.172 myTarget,
4.173 @@ -375,8 +376,8 @@
4.174 @Override
4.175 public void visit(OnMessage message)
4.176 {
4.177 -//Log.out();
4.178 -//Log.out("[MESSAGE]: " + Util.getName(message));
4.179 +//out();
4.180 +//out("[MESSAGE]: " + Util.getName(message));
4.181 Util.visit(
4.182 message.getPortType(),
4.183 myTarget,
4.184 @@ -412,8 +413,8 @@
4.185 @Override
4.186 public void visit(Catch _catch)
4.187 {
4.188 -//Log.out();
4.189 -//Log.out("[CATCH]: " + Util.getName(_catch));
4.190 +//out();
4.191 +//out("[CATCH]: " + Util.getName(_catch));
4.192 Util.visit(
4.193 _catch.getFaultMessageType(),
4.194 myTarget,
4.195 @@ -437,8 +438,8 @@
4.196 @Override
4.197 public void visit(Reply reply)
4.198 {
4.199 -//Log.out();
4.200 -//Log.out("[REPLY]: " + Util.getName(reply));
4.201 +//out();
4.202 +//out("[REPLY]: " + Util.getName(reply));
4.203 Util.visit(
4.204 reply.getFaultName(),
4.205 myTarget,
4.206 @@ -480,8 +481,8 @@
4.207 @Override
4.208 public void visit(Receive receive)
4.209 {
4.210 -//Log.out();
4.211 -//Log.out("[RECEIVE]: " + Util.getName(receive));
4.212 +//out();
4.213 +//out("[RECEIVE]: " + Util.getName(receive));
4.214 Util.visit(
4.215 receive.getPortType(),
4.216 myTarget,
4.217 @@ -517,8 +518,8 @@
4.218 @Override
4.219 public void visit(Invoke invoke)
4.220 {
4.221 -//Log.out();
4.222 -//Log.out("[INVOKE]: " + Util.getName(invoke));
4.223 +//out();
4.224 +//out("[INVOKE]: " + Util.getName(invoke));
4.225 Util.visit(
4.226 invoke.getPortType(),
4.227 myTarget,
4.228 @@ -576,8 +577,8 @@
4.229 @Override
4.230 public void visit(Throw _throw)
4.231 {
4.232 -//Log.out();
4.233 -//Log.out("[THROW]: " + Util.getName(_throw));
4.234 +//out();
4.235 +//out("[THROW]: " + Util.getName(_throw));
4.236 Util.visit(
4.237 _throw.getFaultName(),
4.238 myTarget,
4.239 @@ -595,8 +596,8 @@
4.240 @Override
4.241 public void visit(Variable variable)
4.242 {
4.243 -//Log.out();
4.244 -//Log.out("[VARIABLE]: " + Util.getName(variable));
4.245 +//out();
4.246 +//out("[VARIABLE]: " + Util.getName(variable));
4.247 Util.visit(
4.248 variable.getMessageType(),
4.249 myTarget,
5.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Renamer.java Thu Feb 15 04:33:40 2007 +0000
5.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Renamer.java Mon Feb 19 13:24:25 2007 +0000
5.3 @@ -2,18 +2,18 @@
5.4 * The contents of this file are subject to the terms of the Common Development
5.5 * and Distribution License (the License). You may not use this file except in
5.6 * compliance with the License.
5.7 - *
5.8 + *
5.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
5.10 * or http://www.netbeans.org/cddl.txt.
5.11 - *
5.12 + *
5.13 * When distributing Covered Code, include this CDDL Header Notice in each file
5.14 * and include the License file at http://www.netbeans.org/cddl.txt.
5.15 * If applicable, add the following below the CDDL Header, with the fields
5.16 * enclosed by brackets [] replaced by your own identifying information:
5.17 * "Portions Copyrighted [year] [name of copyright owner]"
5.18 - *
5.19 + *
5.20 * The Original Software is NetBeans. The Initial Developer of the Original
5.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
5.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
5.23 * Microsystems, Inc. All Rights Reserved.
5.24 */
5.25 package org.netbeans.modules.bpel.refactoring;
5.26 @@ -63,6 +63,7 @@
5.27 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PartnerLinkType;
5.28 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PropertyAlias;
5.29 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Role;
5.30 +import static org.netbeans.modules.print.api.PrintUI.*;
5.31
5.32 /**
5.33 * @author Vladimir Yaroslavskiy
5.34 @@ -114,8 +115,8 @@
5.35 Component component,
5.36 FileRenameRequest request) throws IOException
5.37 {
5.38 -//Log.out();
5.39 -//Log.out("FILE RENAME: " + Util.getName(component));
5.40 +//out();
5.41 +//out("FILE RENAME: " + Util.getName(component));
5.42 if ( !(component instanceof Import)) {
5.43 return;
5.44 }
5.45 @@ -129,10 +130,10 @@
5.46 }
5.47
5.48 private void renameComponent(Component component,Named target) throws IOException{
5.49 -//Log.out();
5.50 -//Log.out("RENAME: " + Util.getName(target));
5.51 -//Log.out(" in: " + Util.getName(component));
5.52 -//Log.out();
5.53 +//out();
5.54 +//out("RENAME: " + Util.getName(target));
5.55 +//out(" in: " + Util.getName(component));
5.56 +//out();
5.57 if (component instanceof PartReference &&
5.58 ((PartReference) component).getPart() != null &&
5.59 component instanceof ReferenceCollection &&
5.60 @@ -221,9 +222,9 @@
5.61 rename((ContentElement) component);
5.62 }
5.63 else {
5.64 -//Log.out();
5.65 -//Log.out("!!! RENAME IN !!! : " + component.getClass().getName());
5.66 -//Log.out();
5.67 +//out();
5.68 +//out("!!! RENAME IN !!! : " + component.getClass().getName());
5.69 +//out();
5.70 return;
5.71 }
5.72 }
5.73 @@ -259,9 +260,9 @@
5.74
5.75 private void rename(ContentElement element) throws IOException {
5.76 String content = myXPath.rename(element.getContent(), (BpelEntity) element);
5.77 -//Log.out();
5.78 -//Log.out("New content: " + content);
5.79 -//Log.out();
5.80 +//out();
5.81 +//out("New content: " + content);
5.82 +//out();
5.83 try {
5.84 element.setContent(content);
5.85 }
5.86 @@ -343,8 +344,8 @@
5.87 Named target) throws IOException
5.88 {
5.89 if (target instanceof CorrelationProperty) {
5.90 -//Log.out();
5.91 -//Log.out("RENAME");
5.92 +//out();
5.93 +//out("RENAME");
5.94 List<WSDLReference<CorrelationProperty>> references =
5.95 correlationSet.getProperties();
5.96
5.97 @@ -357,10 +358,10 @@
5.98 for (WSDLReference<CorrelationProperty> reference : references) {
5.99 if (reference.get() != null) {
5.100 list.add(reference);
5.101 -//Log.out(" see: " + reference.get());
5.102 +//out(" see: " + reference.get());
5.103 }
5.104 else {
5.105 -//Log.out(" add");
5.106 +//out(" add");
5.107 list.add(correlationSet.createWSDLReference(
5.108 (CorrelationProperty) target, CorrelationProperty.class));
5.109 }
5.110 @@ -375,10 +376,10 @@
5.111 }
5.112
5.113 private void rename(Variable variable, Named target) {
5.114 -//Log.out();
5.115 -//Log.out("RENAME: " + Util.getName(target));
5.116 -//Log.out(" in: " + Util.getName(variable));
5.117 -//Log.out();
5.118 +//out();
5.119 +//out("RENAME: " + Util.getName(target));
5.120 +//out(" in: " + Util.getName(variable));
5.121 +//out();
5.122 if (target instanceof GlobalElement) {
5.123 variable.setElement(
5.124 variable.createSchemaReference((GlobalElement) target, GlobalElement.class));
5.125 @@ -438,8 +439,8 @@
5.126 return new QName(qName.getNamespaceURI(), target.getName(), qName.getPrefix());
5.127 }
5.128
5.129 - // --------------------------------------------------------
5.130 - private static class StringAttribute implements Attribute {
5.131 + // --------------------------------------------------------------
5.132 + private static final class StringAttribute implements Attribute {
5.133
5.134 public StringAttribute(String name) {
5.135 myName = name;
6.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Util.java Thu Feb 15 04:33:40 2007 +0000
6.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Util.java Mon Feb 19 13:24:25 2007 +0000
6.3 @@ -2,18 +2,18 @@
6.4 * The contents of this file are subject to the terms of the Common Development
6.5 * and Distribution License (the License). You may not use this file except in
6.6 * compliance with the License.
6.7 - *
6.8 + *
6.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
6.10 * or http://www.netbeans.org/cddl.txt.
6.11 - *
6.12 + *
6.13 * When distributing Covered Code, include this CDDL Header Notice in each file
6.14 * and include the License file at http://www.netbeans.org/cddl.txt.
6.15 * If applicable, add the following below the CDDL Header, with the fields
6.16 * enclosed by brackets [] replaced by your own identifying information:
6.17 * "Portions Copyrighted [year] [name of copyright owner]"
6.18 - *
6.19 + *
6.20 * The Original Software is NetBeans. The Initial Developer of the Original
6.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
6.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
6.23 * Microsystems, Inc. All Rights Reserved.
6.24 */
6.25 package org.netbeans.modules.bpel.refactoring;
6.26 @@ -32,6 +32,7 @@
6.27 import org.netbeans.modules.xml.xam.Reference;
6.28 import org.netbeans.modules.xml.xam.dom.NamedComponentReference;
6.29 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
6.30 +import static org.netbeans.modules.print.api.PrintUI.*;
6.31
6.32 /**
6.33 * @author Vladimir Yaroslavskiy
6.34 @@ -61,12 +62,12 @@
6.35 if (reference == null || reference.get() == null) {
6.36 return;
6.37 }
6.38 -//Log.out();
6.39 -//Log.out(" Visit: " + getName(reference.get()));
6.40 -//Log.out(" target: " + target.getName());
6.41 +//out();
6.42 +//out(" Visit: " + getName(reference.get()));
6.43 +//out(" target: " + target.getName());
6.44 if (target.equals(reference.get())) {
6.45 -//Log.out();
6.46 -//Log.out("AdD: " + getName(component));
6.47 +//out();
6.48 +//out("AdD: " + getName(component));
6.49 usage.addItem(component);
6.50 }
6.51 }
6.52 @@ -77,26 +78,26 @@
6.53 Component component,
6.54 UsageGroup usage)
6.55 {
6.56 -//Log.out();
6.57 -//Log.out("VISIT: " + qName);
6.58 +//out();
6.59 +//out("VISIT: " + qName);
6.60 if (target instanceof Named && contains(qName, (Named) target)) {
6.61 -//Log.out();
6.62 -//Log.out("ADd: " + getName(component));
6.63 +//out();
6.64 +//out("ADd: " + getName(component));
6.65 usage.addItem(component);
6.66 }
6.67 }
6.68
6.69 private static boolean contains(QName qName, Named target) {
6.70 if (qName == null) {
6.71 -//Log.out("qName is null");
6.72 +//out("qName is null");
6.73 return false;
6.74 }
6.75 String part = qName.getLocalPart();
6.76
6.77 if ( !part.equals(target.getName())) {
6.78 -//Log.out("Target name != part");
6.79 -//Log.out(" part: " + part);
6.80 -//Log.out(" Target name: " + target.getName());
6.81 +//out("Target name != part");
6.82 +//out(" part: " + part);
6.83 +//out(" Target name: " + target.getName());
6.84 return false;
6.85 }
6.86 return qName.getNamespaceURI().equals(getNamespace(target.getModel()));
7.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/WsdlVisitor.java Thu Feb 15 04:33:40 2007 +0000
7.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/WsdlVisitor.java Mon Feb 19 13:24:25 2007 +0000
7.3 @@ -2,18 +2,18 @@
7.4 * The contents of this file are subject to the terms of the Common Development
7.5 * and Distribution License (the License). You may not use this file except in
7.6 * compliance with the License.
7.7 - *
7.8 + *
7.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7.10 * or http://www.netbeans.org/cddl.txt.
7.11 - *
7.12 + *
7.13 * When distributing Covered Code, include this CDDL Header Notice in each file
7.14 * and include the License file at http://www.netbeans.org/cddl.txt.
7.15 * If applicable, add the following below the CDDL Header, with the fields
7.16 * enclosed by brackets [] replaced by your own identifying information:
7.17 * "Portions Copyrighted [year] [name of copyright owner]"
7.18 - *
7.19 + *
7.20 * The Original Software is NetBeans. The Initial Developer of the Original
7.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
7.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
7.23 * Microsystems, Inc. All Rights Reserved.
7.24 */
7.25 package org.netbeans.modules.bpel.refactoring;
7.26 @@ -31,6 +31,7 @@
7.27 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PartnerLinkType;
7.28 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PropertyAlias;
7.29 import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Role;
7.30 +import static org.netbeans.modules.print.api.PrintUI.*;
7.31
7.32 /**
7.33 * @author Vladimir Yaroslavskiy
7.34 @@ -60,8 +61,8 @@
7.35 }
7.36
7.37 private void visitProperty(CorrelationProperty property) {
7.38 -//Log.out();
7.39 -//Log.out("PROPERTY: " + property);
7.40 +//out();
7.41 +//out("PROPERTY: " + property);
7.42 Util.visit(
7.43 property.getType(),
7.44 property.getElement(),
7.45 @@ -72,8 +73,8 @@
7.46 }
7.47
7.48 private void visitAlias(PropertyAlias alias) {
7.49 -//Log.out();
7.50 -//Log.out("ALIAS: " + alias);
7.51 +//out();
7.52 +//out("ALIAS: " + alias);
7.53 Util.visit(
7.54 alias.getType(),
7.55 alias.getElement(),
7.56 @@ -104,8 +105,8 @@
7.57 }
7.58
7.59 private void visitRole(Role role) {
7.60 -//Log.out();
7.61 -//Log.out("ROLE: " + role);
7.62 +//out();
7.63 +//out("ROLE: " + role);
7.64 if (role == null) {
7.65 return;
7.66 }
8.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/XPath.java Thu Feb 15 04:33:40 2007 +0000
8.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/XPath.java Mon Feb 19 13:24:25 2007 +0000
8.3 @@ -2,18 +2,18 @@
8.4 * The contents of this file are subject to the terms of the Common Development
8.5 * and Distribution License (the License). You may not use this file except in
8.6 * compliance with the License.
8.7 - *
8.8 + *
8.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
8.10 * or http://www.netbeans.org/cddl.txt.
8.11 - *
8.12 + *
8.13 * When distributing Covered Code, include this CDDL Header Notice in each file
8.14 * and include the License file at http://www.netbeans.org/cddl.txt.
8.15 * If applicable, add the following below the CDDL Header, with the fields
8.16 * enclosed by brackets [] replaced by your own identifying information:
8.17 * "Portions Copyrighted [year] [name of copyright owner]"
8.18 - *
8.19 + *
8.20 * The Original Software is NetBeans. The Initial Developer of the Original
8.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
8.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
8.23 * Microsystems, Inc. All Rights Reserved.
8.24 */
8.25 package org.netbeans.modules.bpel.refactoring;
8.26 @@ -64,6 +64,7 @@
8.27 import org.netbeans.modules.xml.xpath.XPathPredicateExpression;
8.28 import org.netbeans.modules.xml.xpath.XPathVariableReference;
8.29 import org.netbeans.modules.xml.xpath.visitor.AbstractXPathVisitor;
8.30 +import static org.netbeans.modules.print.api.PrintUI.*;
8.31
8.32 /**
8.33 * @author Vladimir Yaroslavskiy
8.34 @@ -78,8 +79,8 @@
8.35 }
8.36
8.37 void visit(String content, Component component) {
8.38 -//Log.out();
8.39 -//Log.out("XPATH visit: " + content);
8.40 +//out();
8.41 +//out("XPATH visit: " + content);
8.42 visit(content, component, false);
8.43 }
8.44
8.45 @@ -117,13 +118,13 @@
8.46 }
8.47
8.48 private void rename(String newName) {
8.49 -//Log.out();
8.50 -//Log.out("----------------------------------");
8.51 -//Log.out();
8.52 -//Log.out("To rename:");
8.53 +//out();
8.54 +//out("----------------------------------");
8.55 +//out();
8.56 +//out("To rename:");
8.57
8.58 for(XPathExpression expression: myExpressions) {
8.59 -//Log.out("See: " + expression);
8.60 +//out("See: " + expression);
8.61 if (expression instanceof LocationStep) {
8.62 LocationStep step = (LocationStep) expression;
8.63 step.setNodeTest(new StepNodeNameTest(
8.64 @@ -134,9 +135,9 @@
8.65 reference.setVariableName(createName(reference.getVariableName(), newName));
8.66 }
8.67 }
8.68 -//Log.out();
8.69 -//Log.out("----------------------------------");
8.70 -//Log.out();
8.71 +//out();
8.72 +//out("----------------------------------");
8.73 +//out();
8.74 }
8.75
8.76 private String createName(String oldName, String newName) {
8.77 @@ -161,27 +162,27 @@
8.78 @Override
8.79 public void visit(XPathExpressionPath expressionPath)
8.80 {
8.81 -//Log.out();
8.82 -//Log.out("EXPRESION: " + expressionPath);
8.83 +//out();
8.84 +//out("EXPRESION: " + expressionPath);
8.85 XPathExpression rootExpression = expressionPath.getRootExpression();
8.86 myVariable = null;
8.87 myVariableReference = null;
8.88
8.89 if ( !expressionPath.equals(rootExpression)) {
8.90 -///Log.out(" root: " + expression);
8.91 +///out(" root: " + expression);
8.92 rootExpression.accept(this);
8.93 }
8.94 if (myVariable == null) {
8.95 -//Log.out("Variable is not found");
8.96 +//out("Variable is not found");
8.97 return;
8.98 }
8.99 -//Log.out(" Variable: " + myVariable.getName());
8.100 +//out(" Variable: " + myVariable.getName());
8.101
8.102 if (myVariable == myTarget) {
8.103 addItem();
8.104 return;
8.105 }
8.106 - LocationStep[] locations = expressionPath.getSteps();
8.107 + LocationStep [] locations = expressionPath.getSteps();
8.108 List<LocationStep> steps = new LinkedList<LocationStep>();
8.109 steps.add(null); // first step is fake
8.110
8.111 @@ -195,7 +196,7 @@
8.112 visit(locations);
8.113 }
8.114
8.115 - private void visit(LocationStep[] locations) {
8.116 + private void visit(LocationStep [] locations) {
8.117 if (locations == null) {
8.118 return;
8.119 }
8.120 @@ -240,11 +241,11 @@
8.121 String indent)
8.122 {
8.123 if (object instanceof ComplexType) {
8.124 -//Log.out(" visit complex");
8.125 +//out(" visit complex");
8.126 visitComplexType((ComplexType) object, steps, indent);
8.127 }
8.128 else if (object instanceof SimpleType) {
8.129 -//Log.out(" visit simple");
8.130 +//out(" visit simple");
8.131 visitSimpleType((SimpleType) object, steps, indent);
8.132 }
8.133 else if (object instanceof Element) {
8.134 @@ -257,7 +258,7 @@
8.135 if (object == null) {
8.136 return;
8.137 }
8.138 -//Log.out(indent + " unknown !!!: " + object);
8.139 +//out(indent + " unknown !!!: " + object);
8.140 }
8.141 }
8.142
8.143 @@ -270,9 +271,9 @@
8.144
8.145 while (parts.hasNext()) {
8.146 Part part = parts.next();
8.147 -//Log.out();
8.148 -//Log.out(" see part: " + part.getName());
8.149 -//Log.out(" part: " + myPartName);
8.150 +//out();
8.151 +//out(" see part: " + part.getName());
8.152 +//out(" part: " + myPartName);
8.153 if (part.equals(myTarget)) {
8.154 addItem();
8.155
8.156 @@ -281,8 +282,8 @@
8.157 }
8.158 }
8.159 if (myPartName.equals(part.getName())) {
8.160 -//Log.out("==== PART: " + myPartName);
8.161 -//Log.out();
8.162 +//out("==== PART: " + myPartName);
8.163 +//out();
8.164 visitPart(part, createList(steps));
8.165 }
8.166 }
8.167 @@ -293,8 +294,8 @@
8.168 List<LocationStep> steps,
8.169 String indent)
8.170 {
8.171 -///Log.out();
8.172 -//Log.out(indent + "ELEMENT: " + Util.getName(element));
8.173 +///out();
8.174 +//out(indent + "ELEMENT: " + Util.getName(element));
8.175 if (checkUsages(element, steps, false)) {
8.176 return;
8.177 }
8.178 @@ -325,7 +326,7 @@
8.179 List<LocationStep> steps,
8.180 String indent)
8.181 {
8.182 -//Log.out(indent + "CM.TYPE: " + Util.getName(type));
8.183 +//out(indent + "CM.TYPE: " + Util.getName(type));
8.184 if (myVisitedComplexType.contains(type)) {
8.185 return;
8.186 }
8.187 @@ -346,7 +347,7 @@
8.188 visitComplexContent((ComplexContent) definition, steps, indent);
8.189 }
8.190 else {
8.191 -//Log.out(indent + "unk !!: " + definition);
8.192 +//out(indent + "unk !!: " + definition);
8.193 return;
8.194 }
8.195 }
8.196 @@ -364,7 +365,7 @@
8.197 }
8.198
8.199 private void visitChoice(Choice choice, List<LocationStep> steps, String indent) {
8.200 -//Log.out(indent + " [choice] ===================");
8.201 +//out(indent + " [choice] ===================");
8.202 Iterator<Choice> choices = choice.getChoices().iterator();
8.203
8.204 while (choices.hasNext()) {
8.205 @@ -385,7 +386,7 @@
8.206 while (references.hasNext()) {
8.207 visitReference(references.next().getRef(), createList(steps), indent + INDENT);
8.208 }
8.209 -//Log.out(indent + " [===========================");
8.210 +//out(indent + " [===========================");
8.211 }
8.212
8.213 private void visitSequence(
8.214 @@ -393,14 +394,14 @@
8.215 List<LocationStep> steps,
8.216 String indent)
8.217 {
8.218 -//Log.out(indent + " [sequnce] ==================");
8.219 +//out(indent + " [sequnce] ==================");
8.220 List<SequenceDefinition> content = sequence.getContent();
8.221
8.222 if (content == null) {
8.223 return;
8.224 }
8.225 for (SequenceDefinition definition : content) {
8.226 -///Log.out(indent + " see: " + Util.getName(definition));
8.227 +///out(indent + " see: " + Util.getName(definition));
8.228 if (definition instanceof Element) {
8.229 visitElement((Element) definition,
8.230 createList(steps), indent + INDENT);
8.231 @@ -418,11 +419,11 @@
8.232 createList(steps), indent + INDENT);
8.233 }
8.234 else {
8.235 -//Log.out(indent + " error !!!: " + definition);
8.236 +//out(indent + " error !!!: " + definition);
8.237 return;
8.238 }
8.239 }
8.240 -//Log.out(indent + " [===========================");
8.241 +//out(indent + " [===========================");
8.242 }
8.243
8.244 private void visitSimpleType(
8.245 @@ -430,7 +431,7 @@
8.246 List<LocationStep> steps,
8.247 String indent)
8.248 {
8.249 -//Log.out(indent + "SM.TYPE: " + Util.getName(type));
8.250 +//out(indent + "SM.TYPE: " + Util.getName(type));
8.251 checkUsages(type, steps, true);
8.252 }
8.253
8.254 @@ -438,7 +439,7 @@
8.255 public void visit(XPathVariableReference reference)
8.256 {
8.257 QName qName = reference.getVariableName();
8.258 -//Log.out("VAR REFER: " + qName);
8.259 +//out("VAR REFER: " + qName);
8.260 String name = qName.getLocalPart();
8.261 String part = ""; // NOI18N
8.262 int k = name.indexOf("."); // NOI18N
8.263 @@ -450,17 +451,17 @@
8.264 if ( !(myComponent instanceof BpelEntity)) {
8.265 return;
8.266 }
8.267 - Variable[] variables = ((BpelModel) ((BpelEntity) myComponent).getModel()).
8.268 + Variable [] variables = ((BpelModel) ((BpelEntity) myComponent).getModel()).
8.269 getProcess().getVariableContainer().getVariables();
8.270
8.271 if (variables == null) {
8.272 return;
8.273 }
8.274 for (Variable variable : variables) {
8.275 -//Log.out(" see: " + variable.getName());
8.276 +//out(" see: " + variable.getName());
8.277
8.278 if (variable.getName().equals(name)) {
8.279 -//Log.out(" this.");
8.280 +//out(" this.");
8.281 myVariable = variable;
8.282 myVariableReference = reference;
8.283 myPartName = part;
8.284 @@ -472,8 +473,8 @@
8.285 @Override
8.286 public void visit(LocationStep locationStep)
8.287 {
8.288 -//Log.out(" LCL STEP: " + locationStep);
8.289 - XPathPredicateExpression[] expressions = locationStep.getPredicates();
8.290 +//out(" LCL STEP: " + locationStep);
8.291 + XPathPredicateExpression [] expressions = locationStep.getPredicates();
8.292
8.293 if (expressions == null) {
8.294 return;
8.295 @@ -486,28 +487,28 @@
8.296 @Override
8.297 public void visit(XPathCoreFunction coreFunction)
8.298 {
8.299 -//Log.out("CORE FUNC: " + coreFunction);
8.300 +//out("CORE FUNC: " + coreFunction);
8.301 visitChildren(coreFunction);
8.302 }
8.303
8.304 @Override
8.305 public void visit(XPathCoreOperation coreOperation)
8.306 {
8.307 -//Log.out("CORE OPER: " + coreOperation);
8.308 +//out("CORE OPER: " + coreOperation);
8.309 visitChildren(coreOperation);
8.310 }
8.311
8.312 @Override
8.313 public void visit(XPathExtensionFunction extensionFunction)
8.314 {
8.315 -//Log.out("EXT FUNC: " + extensionFunction);
8.316 +//out("EXT FUNC: " + extensionFunction);
8.317 visitChildren(extensionFunction);
8.318 }
8.319
8.320 @Override
8.321 public void visit(XPathLocationPath locationPath)
8.322 {
8.323 -//Log.out("LOCA PATH: " + locationPath);
8.324 +//out("LOCA PATH: " + locationPath);
8.325 visit(locationPath.getSteps());
8.326 }
8.327
8.328 @@ -519,43 +520,43 @@
8.329 if (component == null) {
8.330 return false;
8.331 }
8.332 -//Log.out();
8.333 -//Log.out(" chk compnt: "+ Util.getName(component));
8.334 -//Log.out(" target: "+ myTarget.getName());
8.335 -//Log.out(" step: "+ (steps.size() == 0 ? null : steps.get(0)));
8.336 +//out();
8.337 +//out(" chk compnt: "+ Util.getName(component));
8.338 +//out(" target: "+ myTarget.getName());
8.339 +//out(" step: "+ (steps.size() == 0 ? null : steps.get(0)));
8.340
8.341 if (steps.size() == 0) {
8.342 -//Log.out(" size: 0");
8.343 -//Log.out(" return: false");
8.344 -//Log.out();
8.345 +//out(" size: 0");
8.346 +//out(" return: false");
8.347 +//out();
8.348 return false;
8.349 }
8.350 LocationStep step = steps.get(0);
8.351
8.352 if (myTarget.equals(component)) {
8.353 -//Log.out();
8.354 -//Log.out("name: " + myOldName);
8.355 -//Log.out("step: " + step.getString());
8.356 +//out();
8.357 +//out("name: " + myOldName);
8.358 +//out("step: " + step.getString());
8.359 if (step != null && equalsIgnorePrefix(myOldName, step.getString())) {
8.360 addItem();
8.361
8.362 if (myDoRename) {
8.363 myExpressions.add(step);
8.364 -//Log.out("!! ==== STEP: " + step.getString());
8.365 +//out("!! ==== STEP: " + step.getString());
8.366 }
8.367 -//Log.out(" return: true");
8.368 -//Log.out();
8.369 +//out(" return: true");
8.370 +//out();
8.371 return true;
8.372 }
8.373 }
8.374 else {
8.375 if (nextStep) {
8.376 -//Log.out(" remove: " + step);
8.377 +//out(" remove: " + step);
8.378 steps.remove(0);
8.379 }
8.380 }
8.381 -//Log.out(" return: false");
8.382 -//Log.out();
8.383 +//out(" return: false");
8.384 +//out();
8.385 return false;
8.386 }
8.387
8.388 @@ -574,7 +575,7 @@
8.389 private void addItem() {
8.390 if (myUsage != null) {
8.391 myUsage.addItem(myComponent);
8.392 -//Log.out("!! ===== ADD: " + Util.getName(myComponent));
8.393 +//out("!! ===== ADD: " + Util.getName(myComponent));
8.394 }
8.395 }
8.396
9.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/resources/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
9.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/resources/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
9.3 @@ -2,18 +2,18 @@
9.4 # The contents of this file are subject to the terms of the Common Development
9.5 # and Distribution License (the License). You may not use this file except in
9.6 # compliance with the License.
9.7 -#
9.8 +#
9.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
9.10 # or http://www.netbeans.org/cddl.txt.
9.11 -#
9.12 +#
9.13 # When distributing Covered Code, include this CDDL Header Notice in each file
9.14 # and include the License file at http://www.netbeans.org/cddl.txt.
9.15 # If applicable, add the following below the CDDL Header, with the fields
9.16 # enclosed by brackets [] replaced by your own identifying information:
9.17 # "Portions Copyrighted [year] [name of copyright owner]"
9.18 -#
9.19 +#
9.20 # The Original Software is NetBeans. The Initial Developer of the Original
9.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
9.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
9.23 # Microsystems, Inc. All Rights Reserved.
9.24
9.25 # manifest
10.1 --- a/bpel.search/build.xml Thu Feb 15 04:33:40 2007 +0000
10.2 +++ b/bpel.search/build.xml Mon Feb 19 13:24:25 2007 +0000
10.3 @@ -1,21 +1,21 @@
10.4 <?xml version="1.0" encoding="UTF-8"?>
10.5 <!--
10.6 - The contents of this file are subject to the terms of the Common Development
10.7 - and Distribution License (the License). You may not use this file except in
10.8 - compliance with the License.
10.9 -
10.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
10.11 - or http://www.netbeans.org/cddl.txt.
10.12 -
10.13 - When distributing Covered Code, include this CDDL Header Notice in each file
10.14 - and include the License file at http://www.netbeans.org/cddl.txt.
10.15 - If applicable, add the following below the CDDL Header, with the fields
10.16 - enclosed by brackets [] replaced by your own identifying information:
10.17 - "Portions Copyrighted [year] [name of copyright owner]"
10.18 -
10.19 - The Original Software is NetBeans. The Initial Developer of the Original
10.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
10.21 - Microsystems, Inc. All Rights Reserved.
10.22 + The contents of this file are subject to the terms of the Common Development
10.23 + and Distribution License (the License). You may not use this file except in
10.24 + compliance with the License.
10.25 +
10.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
10.27 + or http://www.netbeans.org/cddl.txt.
10.28 +
10.29 + When distributing Covered Code, include this CDDL Header Notice in each file
10.30 + and include the License file at http://www.netbeans.org/cddl.txt.
10.31 + If applicable, add the following below the CDDL Header, with the fields
10.32 + enclosed by brackets [] replaced by your own identifying information:
10.33 + "Portions Copyrighted [year] [name of copyright owner]"
10.34 +
10.35 + The Original Software is NetBeans. The Initial Developer of the Original
10.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
10.37 + Microsystems, Inc. All Rights Reserved.
10.38 -->
10.39 <project name="search" default="netbeans" basedir=".">
10.40 <import file="nbproject/build-impl.xml"/>
11.1 --- a/bpel.search/nbproject/project.properties Thu Feb 15 04:33:40 2007 +0000
11.2 +++ b/bpel.search/nbproject/project.properties Mon Feb 19 13:24:25 2007 +0000
11.3 @@ -2,18 +2,18 @@
11.4 # The contents of this file are subject to the terms of the Common Development
11.5 # and Distribution License (the License). You may not use this file except in
11.6 # compliance with the License.
11.7 -#
11.8 +#
11.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
11.10 # or http://www.netbeans.org/cddl.txt.
11.11 -#
11.12 +#
11.13 # When distributing Covered Code, include this CDDL Header Notice in each file
11.14 # and include the License file at http://www.netbeans.org/cddl.txt.
11.15 # If applicable, add the following below the CDDL Header, with the fields
11.16 # enclosed by brackets [] replaced by your own identifying information:
11.17 # "Portions Copyrighted [year] [name of copyright owner]"
11.18 -#
11.19 +#
11.20 # The Original Software is NetBeans. The Initial Developer of the Original
11.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
11.23 # Microsystems, Inc. All Rights Reserved.
11.24
11.25 javac.source=1.5
12.1 --- a/bpel.search/nbproject/project.xml Thu Feb 15 04:33:40 2007 +0000
12.2 +++ b/bpel.search/nbproject/project.xml Mon Feb 19 13:24:25 2007 +0000
12.3 @@ -1,21 +1,21 @@
12.4 <?xml version="1.0" encoding="UTF-8"?>
12.5 <!--
12.6 - The contents of this file are subject to the terms of the Common Development
12.7 - and Distribution License (the License). You may not use this file except in
12.8 - compliance with the License.
12.9 -
12.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
12.11 - or http://www.netbeans.org/cddl.txt.
12.12 -
12.13 - When distributing Covered Code, include this CDDL Header Notice in each file
12.14 - and include the License file at http://www.netbeans.org/cddl.txt.
12.15 - If applicable, add the following below the CDDL Header, with the fields
12.16 - enclosed by brackets [] replaced by your own identifying information:
12.17 - "Portions Copyrighted [year] [name of copyright owner]"
12.18 -
12.19 - The Original Software is NetBeans. The Initial Developer of the Original
12.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
12.21 - Microsystems, Inc. All Rights Reserved.
12.22 + The contents of this file are subject to the terms of the Common Development
12.23 + and Distribution License (the License). You may not use this file except in
12.24 + compliance with the License.
12.25 +
12.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
12.27 + or http://www.netbeans.org/cddl.txt.
12.28 +
12.29 + When distributing Covered Code, include this CDDL Header Notice in each file
12.30 + and include the License file at http://www.netbeans.org/cddl.txt.
12.31 + If applicable, add the following below the CDDL Header, with the fields
12.32 + enclosed by brackets [] replaced by your own identifying information:
12.33 + "Portions Copyrighted [year] [name of copyright owner]"
12.34 +
12.35 + The Original Software is NetBeans. The Initial Developer of the Original
12.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
12.37 + Microsystems, Inc. All Rights Reserved.
12.38 -->
12.39 <project xmlns="http://www.netbeans.org/ns/project/1">
12.40 <type>org.netbeans.modules.apisupport.project</type>
12.41 @@ -81,6 +81,15 @@
12.42 </run-dependency>
12.43 </dependency>
12.44 <dependency>
12.45 + <code-name-base>org.netbeans.api.progress</code-name-base>
12.46 + <build-prerequisite/>
12.47 + <compile-dependency/>
12.48 + <run-dependency>
12.49 + <release-version>1</release-version>
12.50 + <specification-version>1.5.11</specification-version>
12.51 + </run-dependency>
12.52 + </dependency>
12.53 + <dependency>
12.54 <code-name-base>org.netbeans.modules.xml.xam</code-name-base>
12.55 <build-prerequisite/>
12.56 <compile-dependency/>
13.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/action/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
13.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/action/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
13.3 @@ -2,18 +2,18 @@
13.4 # The contents of this file are subject to the terms of the Common Development
13.5 # and Distribution License (the License). You may not use this file except in
13.6 # compliance with the License.
13.7 -#
13.8 +#
13.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
13.10 # or http://www.netbeans.org/cddl.txt.
13.11 -#
13.12 +#
13.13 # When distributing Covered Code, include this CDDL Header Notice in each file
13.14 # and include the License file at http://www.netbeans.org/cddl.txt.
13.15 # If applicable, add the following below the CDDL Header, with the fields
13.16 # enclosed by brackets [] replaced by your own identifying information:
13.17 # "Portions Copyrighted [year] [name of copyright owner]"
13.18 -#
13.19 +#
13.20 # The Original Software is NetBeans. The Initial Developer of the Original
13.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
13.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
13.23 # Microsystems, Inc. All Rights Reserved.
13.24
13.25 # SearchAction
14.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/core/Manager.java Thu Feb 15 04:33:40 2007 +0000
14.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/core/Manager.java Mon Feb 19 13:24:25 2007 +0000
14.3 @@ -2,18 +2,18 @@
14.4 * The contents of this file are subject to the terms of the Common Development
14.5 * and Distribution License (the License). You may not use this file except in
14.6 * compliance with the License.
14.7 - *
14.8 + *
14.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
14.10 * or http://www.netbeans.org/cddl.txt.
14.11 - *
14.12 + *
14.13 * When distributing Covered Code, include this CDDL Header Notice in each file
14.14 * and include the License file at http://www.netbeans.org/cddl.txt.
14.15 * If applicable, add the following below the CDDL Header, with the fields
14.16 * enclosed by brackets [] replaced by your own identifying information:
14.17 * "Portions Copyrighted [year] [name of copyright owner]"
14.18 - *
14.19 + *
14.20 * The Original Software is NetBeans. The Initial Developer of the Original
14.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
14.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
14.23 * Microsystems, Inc. All Rights Reserved.
14.24 */
14.25 package org.netbeans.modules.bpel.search.impl.core;
14.26 @@ -23,7 +23,6 @@
14.27 import java.util.List;
14.28 import javax.swing.JComponent;
14.29
14.30 -import static org.netbeans.modules.print.api.PrintUtil.*;
14.31 import org.netbeans.modules.bpel.search.api.SearchManager;
14.32 import org.netbeans.modules.bpel.search.api.SearchMatch;
14.33 import org.netbeans.modules.bpel.search.api.SearchPattern;
15.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
15.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
15.3 @@ -2,18 +2,18 @@
15.4 # The contents of this file are subject to the terms of the Common Development
15.5 # and Distribution License (the License). You may not use this file except in
15.6 # compliance with the License.
15.7 -#
15.8 +#
15.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
15.10 # or http://www.netbeans.org/cddl.txt.
15.11 -#
15.12 +#
15.13 # When distributing Covered Code, include this CDDL Header Notice in each file
15.14 # and include the License file at http://www.netbeans.org/cddl.txt.
15.15 # If applicable, add the following below the CDDL Header, with the fields
15.16 # enclosed by brackets [] replaced by your own identifying information:
15.17 # "Portions Copyrighted [year] [name of copyright owner]"
15.18 -#
15.19 +#
15.20 # The Original Software is NetBeans. The Initial Developer of the Original
15.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
15.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
15.23 # Microsystems, Inc. All Rights Reserved.
15.24
15.25 # Engine
16.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Construct.java Thu Feb 15 04:33:40 2007 +0000
16.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Construct.java Mon Feb 19 13:24:25 2007 +0000
16.3 @@ -2,18 +2,18 @@
16.4 * The contents of this file are subject to the terms of the Common Development
16.5 * and Distribution License (the License). You may not use this file except in
16.6 * compliance with the License.
16.7 - *
16.8 + *
16.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
16.10 * or http://www.netbeans.org/cddl.txt.
16.11 - *
16.12 + *
16.13 * When distributing Covered Code, include this CDDL Header Notice in each file
16.14 * and include the License file at http://www.netbeans.org/cddl.txt.
16.15 * If applicable, add the following below the CDDL Header, with the fields
16.16 * enclosed by brackets [] replaced by your own identifying information:
16.17 * "Portions Copyrighted [year] [name of copyright owner]"
16.18 - *
16.19 + *
16.20 * The Original Software is NetBeans. The Initial Developer of the Original
16.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
16.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
16.23 * Microsystems, Inc. All Rights Reserved.
16.24 */
16.25 package org.netbeans.modules.bpel.search.impl.diagram;
16.26 @@ -21,11 +21,11 @@
16.27 import java.util.List;
16.28 import org.w3c.dom.NamedNodeMap;
16.29 import org.w3c.dom.Node;
16.30 -import org.openide.util.NbBundle;
16.31
16.32 import org.netbeans.modules.bpel.model.api.BpelEntity;
16.33 import org.netbeans.modules.bpel.editors.api.Diagram;
16.34 import org.netbeans.modules.bpel.editors.api.DiagramElement;
16.35 +import static org.netbeans.modules.print.api.PrintUI.*;
16.36
16.37 import org.netbeans.modules.bpel.search.api.SearchException;
16.38 import org.netbeans.modules.bpel.search.api.SearchOption;
16.39 @@ -81,12 +81,11 @@
16.40
16.41 /**{@inheritDoc}*/
16.42 public String getDisplayName() {
16.43 - return NbBundle.getMessage(Engine.class, "CTL_Construct_Display_Name"); // NOI18N
16.44 + return i18n(Engine.class, "CTL_Construct_Display_Name"); // NOI18N
16.45 }
16.46
16.47 /**{@inheritDoc}*/
16.48 public String getShortDescription() {
16.49 - return NbBundle.getMessage(
16.50 - Engine.class, "CTL_Construct_Short_Description"); // NOI18N
16.51 + return i18n(Engine.class, "CTL_Construct_Short_Description"); // NOI18N
16.52 }
16.53 }
17.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Element.java Thu Feb 15 04:33:40 2007 +0000
17.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Element.java Mon Feb 19 13:24:25 2007 +0000
17.3 @@ -2,18 +2,18 @@
17.4 * The contents of this file are subject to the terms of the Common Development
17.5 * and Distribution License (the License). You may not use this file except in
17.6 * compliance with the License.
17.7 - *
17.8 + *
17.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
17.10 * or http://www.netbeans.org/cddl.txt.
17.11 - *
17.12 + *
17.13 * When distributing Covered Code, include this CDDL Header Notice in each file
17.14 * and include the License file at http://www.netbeans.org/cddl.txt.
17.15 * If applicable, add the following below the CDDL Header, with the fields
17.16 * enclosed by brackets [] replaced by your own identifying information:
17.17 * "Portions Copyrighted [year] [name of copyright owner]"
17.18 - *
17.19 + *
17.20 * The Original Software is NetBeans. The Initial Developer of the Original
17.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17.23 * Microsystems, Inc. All Rights Reserved.
17.24 */
17.25 package org.netbeans.modules.bpel.search.impl.diagram;
18.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Engine.java Thu Feb 15 04:33:40 2007 +0000
18.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/diagram/Engine.java Mon Feb 19 13:24:25 2007 +0000
18.3 @@ -2,24 +2,24 @@
18.4 * The contents of this file are subject to the terms of the Common Development
18.5 * and Distribution License (the License). You may not use this file except in
18.6 * compliance with the License.
18.7 - *
18.8 + *
18.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
18.10 * or http://www.netbeans.org/cddl.txt.
18.11 - *
18.12 + *
18.13 * When distributing Covered Code, include this CDDL Header Notice in each file
18.14 * and include the License file at http://www.netbeans.org/cddl.txt.
18.15 * If applicable, add the following below the CDDL Header, with the fields
18.16 * enclosed by brackets [] replaced by your own identifying information:
18.17 * "Portions Copyrighted [year] [name of copyright owner]"
18.18 - *
18.19 + *
18.20 * The Original Software is NetBeans. The Initial Developer of the Original
18.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
18.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
18.23 * Microsystems, Inc. All Rights Reserved.
18.24 */
18.25 package org.netbeans.modules.bpel.search.impl.diagram;
18.26
18.27 import java.util.List;
18.28 -import org.openide.util.NbBundle;
18.29 +import static org.netbeans.modules.print.api.PrintUI.*;
18.30
18.31 import org.netbeans.modules.bpel.editors.api.Diagram;
18.32 import org.netbeans.modules.bpel.editors.api.DiagramElement;
18.33 @@ -65,12 +65,11 @@
18.34
18.35 /**{@inheritDoc}*/
18.36 public String getDisplayName() {
18.37 - return NbBundle.getMessage(Engine.class, "CTL_Engine_Display_Name"); // NOI18N
18.38 + return i18n(Engine.class, "CTL_Engine_Display_Name"); // NOI18N
18.39 }
18.40
18.41 /**{@inheritDoc}*/
18.42 public String getShortDescription() {
18.43 - return NbBundle.getMessage(
18.44 - Engine.class, "CTL_Engine_Short_Description"); // NOI18N
18.45 + return i18n(Engine.class, "CTL_Engine_Short_Description"); // NOI18N
18.46 }
18.47 }
19.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/model/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
19.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/model/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
19.3 @@ -2,18 +2,18 @@
19.4 # The contents of this file are subject to the terms of the Common Development
19.5 # and Distribution License (the License). You may not use this file except in
19.6 # compliance with the License.
19.7 -#
19.8 +#
19.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
19.10 # or http://www.netbeans.org/cddl.txt.
19.11 -#
19.12 +#
19.13 # When distributing Covered Code, include this CDDL Header Notice in each file
19.14 # and include the License file at http://www.netbeans.org/cddl.txt.
19.15 # If applicable, add the following below the CDDL Header, with the fields
19.16 # enclosed by brackets [] replaced by your own identifying information:
19.17 # "Portions Copyrighted [year] [name of copyright owner]"
19.18 -#
19.19 +#
19.20 # The Original Software is NetBeans. The Initial Developer of the Original
19.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
19.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
19.23 # Microsystems, Inc. All Rights Reserved.
19.24
19.25 # Engine
20.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/model/Element.java Thu Feb 15 04:33:40 2007 +0000
20.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/model/Element.java Mon Feb 19 13:24:25 2007 +0000
20.3 @@ -2,18 +2,18 @@
20.4 * The contents of this file are subject to the terms of the Common Development
20.5 * and Distribution License (the License). You may not use this file except in
20.6 * compliance with the License.
20.7 - *
20.8 + *
20.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
20.10 * or http://www.netbeans.org/cddl.txt.
20.11 - *
20.12 + *
20.13 * When distributing Covered Code, include this CDDL Header Notice in each file
20.14 * and include the License file at http://www.netbeans.org/cddl.txt.
20.15 * If applicable, add the following below the CDDL Header, with the fields
20.16 * enclosed by brackets [] replaced by your own identifying information:
20.17 * "Portions Copyrighted [year] [name of copyright owner]"
20.18 - *
20.19 + *
20.20 * The Original Software is NetBeans. The Initial Developer of the Original
20.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
20.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
20.23 * Microsystems, Inc. All Rights Reserved.
20.24 */
20.25 package org.netbeans.modules.bpel.search.impl.model;
21.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/model/Engine.java Thu Feb 15 04:33:40 2007 +0000
21.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/model/Engine.java Mon Feb 19 13:24:25 2007 +0000
21.3 @@ -2,24 +2,24 @@
21.4 * The contents of this file are subject to the terms of the Common Development
21.5 * and Distribution License (the License). You may not use this file except in
21.6 * compliance with the License.
21.7 - *
21.8 + *
21.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
21.10 * or http://www.netbeans.org/cddl.txt.
21.11 - *
21.12 + *
21.13 * When distributing Covered Code, include this CDDL Header Notice in each file
21.14 * and include the License file at http://www.netbeans.org/cddl.txt.
21.15 * If applicable, add the following below the CDDL Header, with the fields
21.16 * enclosed by brackets [] replaced by your own identifying information:
21.17 * "Portions Copyrighted [year] [name of copyright owner]"
21.18 - *
21.19 + *
21.20 * The Original Software is NetBeans. The Initial Developer of the Original
21.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
21.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
21.23 * Microsystems, Inc. All Rights Reserved.
21.24 */
21.25 package org.netbeans.modules.bpel.search.impl.model;
21.26
21.27 import java.util.List;
21.28 -import org.openide.util.NbBundle;
21.29 +import static org.netbeans.modules.print.api.PrintUI.*;
21.30
21.31 import org.netbeans.modules.bpel.model.api.BpelEntity;
21.32 import org.netbeans.modules.bpel.model.api.BpelModel;
21.33 @@ -48,7 +48,7 @@
21.34 }
21.35
21.36 /**{@inheritDoc}*/
21.37 - public Object[] getTargets() {
21.38 + public Object [] getTargets() {
21.39 return Target.values();
21.40 }
21.41
21.42 @@ -94,7 +94,7 @@
21.43 String text = myOption.getText();
21.44 SearchMatch match = myOption.getSearchMatch();
21.45
21.46 - if (match == SearchMatch.PATTERN_MATCH && text.equals("*")) { // NOI18N
21.47 + if (match == SearchMatch.PATTERN && text.equals("*")) { // NOI18N
21.48 return true;
21.49 }
21.50 if (match == SearchMatch.REGULAR_EXPRESSION && text.equals("\\.*")) { // NOI18N
21.51 @@ -113,13 +113,12 @@
21.52
21.53 /**{@inheritDoc}*/
21.54 public String getDisplayName() {
21.55 - return NbBundle.getMessage(Engine.class, "CTL_Engine_Display_Name"); // NOI18N
21.56 + return i18n(Engine.class, "CTL_Engine_Display_Name"); // NOI18N
21.57 }
21.58
21.59 /**{@inheritDoc}*/
21.60 public String getShortDescription() {
21.61 - return NbBundle.getMessage(
21.62 - Engine.class, "CTL_Engine_Short_Description"); // NOI18N
21.63 + return i18n(Engine.class, "CTL_Engine_Short_Description"); // NOI18N
21.64 }
21.65
21.66 private SearchOption myOption;
22.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/resources/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
22.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/resources/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
22.3 @@ -2,18 +2,18 @@
22.4 # The contents of this file are subject to the terms of the Common Development
22.5 # and Distribution License (the License). You may not use this file except in
22.6 # compliance with the License.
22.7 -#
22.8 +#
22.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
22.10 # or http://www.netbeans.org/cddl.txt.
22.11 -#
22.12 +#
22.13 # When distributing Covered Code, include this CDDL Header Notice in each file
22.14 # and include the License file at http://www.netbeans.org/cddl.txt.
22.15 # If applicable, add the following below the CDDL Header, with the fields
22.16 # enclosed by brackets [] replaced by your own identifying information:
22.17 # "Portions Copyrighted [year] [name of copyright owner]"
22.18 -#
22.19 +#
22.20 # The Original Software is NetBeans. The Initial Developer of the Original
22.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
22.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
22.23 # Microsystems, Inc. All Rights Reserved.
22.24
22.25 # manifest
23.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/resources/layer.xml Thu Feb 15 04:33:40 2007 +0000
23.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/resources/layer.xml Mon Feb 19 13:24:25 2007 +0000
23.3 @@ -1,21 +1,21 @@
23.4 <?xml version="1.0"?>
23.5 <!--
23.6 - The contents of this file are subject to the terms of the Common Development
23.7 - and Distribution License (the License). You may not use this file except in
23.8 - compliance with the License.
23.9 -
23.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
23.11 - or http://www.netbeans.org/cddl.txt.
23.12 -
23.13 - When distributing Covered Code, include this CDDL Header Notice in each file
23.14 - and include the License file at http://www.netbeans.org/cddl.txt.
23.15 - If applicable, add the following below the CDDL Header, with the fields
23.16 - enclosed by brackets [] replaced by your own identifying information:
23.17 - "Portions Copyrighted [year] [name of copyright owner]"
23.18 -
23.19 - The Original Software is NetBeans. The Initial Developer of the Original
23.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
23.21 - Microsystems, Inc. All Rights Reserved.
23.22 + The contents of this file are subject to the terms of the Common Development
23.23 + and Distribution License (the License). You may not use this file except in
23.24 + compliance with the License.
23.25 +
23.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
23.27 + or http://www.netbeans.org/cddl.txt.
23.28 +
23.29 + When distributing Covered Code, include this CDDL Header Notice in each file
23.30 + and include the License file at http://www.netbeans.org/cddl.txt.
23.31 + If applicable, add the following below the CDDL Header, with the fields
23.32 + enclosed by brackets [] replaced by your own identifying information:
23.33 + "Portions Copyrighted [year] [name of copyright owner]"
23.34 +
23.35 + The Original Software is NetBeans. The Initial Developer of the Original
23.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
23.37 + Microsystems, Inc. All Rights Reserved.
23.38 -->
23.39 <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.0//EN" "http://www.netbeans.org/dtds/filesystem-1_0.dtd">
23.40
24.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
24.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
24.3 @@ -2,18 +2,18 @@
24.4 # The contents of this file are subject to the terms of the Common Development
24.5 # and Distribution License (the License). You may not use this file except in
24.6 # compliance with the License.
24.7 -#
24.8 +#
24.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
24.10 # or http://www.netbeans.org/cddl.txt.
24.11 -#
24.12 +#
24.13 # When distributing Covered Code, include this CDDL Header Notice in each file
24.14 # and include the License file at http://www.netbeans.org/cddl.txt.
24.15 # If applicable, add the following below the CDDL Header, with the fields
24.16 # enclosed by brackets [] replaced by your own identifying information:
24.17 # "Portions Copyrighted [year] [name of copyright owner]"
24.18 -#
24.19 +#
24.20 # The Original Software is NetBeans. The Initial Developer of the Original
24.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
24.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
24.23 # Microsystems, Inc. All Rights Reserved.
24.24
24.25 # Provider
24.26 @@ -29,7 +29,7 @@
24.27 TLT_Search=Starts the search
24.28 LBL_Options=Options
24.29 LBL_Match_Case=&Match Case
24.30 -LBL_Pattern_Match=&Pattern Match (? and *)
24.31 +LBL_Match_Pattern=Match &Pattern (? and *)
24.32 LBL_Regular_Expression=&Regular Expression
24.33
24.34 # Tree
24.35 @@ -44,12 +44,17 @@
24.36 LBL_Next_Occurence=Next Occurence
24.37 LBL_Collapse_Expand=Collapse / Expand
24.38 LBL_Remove=Remove from Search
24.39 +LBL_Are_You_Sure=Are you sure you want to remove?
24.40
24.41 # View
24.42 # {0} - search result
24.43 CTL_Search_Results_Print=Search Results - {0}
24.44 CTL_Search_Results_Name=Search Results
24.45 CTL_Search_Results_Tooltip=Search Results
24.46 +TLT_Expose=Collapse / Expand (Ctrl+E)
24.47 +TLT_Export=Export as HTML (Ctrl+H)
24.48 +TLT_Previous_Occurence=Previous Occurence (Shift+F12)
24.49 +TLT_Next_Occurence=Next Occurence (F12)
24.50
24.51 # Export
24.52 # {0} - file name
24.53 @@ -62,6 +67,9 @@
24.54 LBL_Open_in_Browser=Open in Browser
24.55 LBL_Search_Results=Search results
24.56 LBL_Description=Description:
24.57 -TLT_Browse=Browse
24.58 LBL_Browse=...
24.59 LBL_HTML_File_Type=HTML Files
24.60 +TLT_Browse=Browse
24.61 +
24.62 +# Progress
24.63 +LBL_Search_Progress=Search Progress
25.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Export.java Thu Feb 15 04:33:40 2007 +0000
25.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Export.java Mon Feb 19 13:24:25 2007 +0000
25.3 @@ -2,18 +2,18 @@
25.4 * The contents of this file are subject to the terms of the Common Development
25.5 * and Distribution License (the License). You may not use this file except in
25.6 * compliance with the License.
25.7 - *
25.8 + *
25.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
25.10 * or http://www.netbeans.org/cddl.txt.
25.11 - *
25.12 + *
25.13 * When distributing Covered Code, include this CDDL Header Notice in each file
25.14 * and include the License file at http://www.netbeans.org/cddl.txt.
25.15 * If applicable, add the following below the CDDL Header, with the fields
25.16 * enclosed by brackets [] replaced by your own identifying information:
25.17 * "Portions Copyrighted [year] [name of copyright owner]"
25.18 - *
25.19 + *
25.20 * The Original Software is NetBeans. The Initial Developer of the Original
25.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
25.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
25.23 * Microsystems, Inc. All Rights Reserved.
25.24 */
25.25 package org.netbeans.modules.bpel.search.impl.ui;
25.26 @@ -45,14 +45,13 @@
25.27 import org.openide.DialogDescriptor;
25.28 import org.openide.ErrorManager;
25.29 import org.openide.awt.HtmlBrowser;
25.30 -import static org.netbeans.modules.print.api.PrintUtil.*;
25.31 -import org.netbeans.modules.print.api.PrintUtil.Dialog;
25.32 +import org.netbeans.modules.print.api.PrintUI;
25.33
25.34 /**
25.35 * @author Vladimir Yaroslavskiy
25.36 * @version 2006.12.21
25.37 */
25.38 -class Export extends Dialog {
25.39 +class Export extends PrintUI {
25.40
25.41 void show(List<List<String>> descriptions, String title) {
25.42 myDescriptions = descriptions;
25.43 @@ -69,7 +68,7 @@
25.44 c.insets = new Insets(MEDIUM_INSET, TINY_INSET, TINY_INSET, TINY_INSET);
25.45
25.46 // file name
25.47 - panel.add(createLabel("LBL_File_Name"), c); // NOI18N
25.48 + panel.add(createLabel(i18n("LBL_File_Name")), c); // NOI18N
25.49
25.50 c.gridy++;
25.51 c.weightx = 1.0;
25.52 @@ -83,8 +82,8 @@
25.53 c.insets = new Insets(MEDIUM_INSET, 0, TINY_INSET, TINY_INSET);
25.54 c.fill = GridBagConstraints.NONE;
25.55 JButton button = createButton(
25.56 - "TLT_Browse", // NOI18N
25.57 - new AbstractAction(getMessage("LBL_Browse")) { // NOI18N
25.58 + i18n("TLT_Browse"), // NOI18N
25.59 + new AbstractAction(i18n("LBL_Browse")) { // NOI18N
25.60 public void actionPerformed(ActionEvent event) {
25.61 selectFile();
25.62 }
25.63 @@ -99,7 +98,7 @@
25.64 // description
25.65 c.gridy++;
25.66 c.insets = new Insets(TINY_INSET, TINY_INSET, TINY_INSET, MEDIUM_INSET);
25.67 - panel.add(createLabel("LBL_Description"), c); // NOI18N
25.68 + panel.add(createLabel(i18n("LBL_Description")), c); // NOI18N
25.69
25.70 c.insets = new Insets(TINY_INSET, TINY_INSET, TINY_INSET, TINY_INSET);
25.71 c.weightx = 1.0;
25.72 @@ -122,8 +121,8 @@
25.73 c.insets = new Insets(TINY_INSET, 0, TINY_INSET, TINY_INSET);
25.74 c.fill = GridBagConstraints.NONE;
25.75 myRunBrowser = createCheckBox(
25.76 - "LBL_Open_in_Browser", // NOI18N
25.77 - new AbstractAction(getMessage("LBL_Open_in_Browser")) { // NOI18N
25.78 + i18n("LBL_Open_in_Browser"), // NOI18N
25.79 + new AbstractAction(i18n("LBL_Open_in_Browser")) { // NOI18N
25.80 public void actionPerformed(ActionEvent event) {}
25.81 }
25.82 );
25.83 @@ -145,7 +144,7 @@
25.84 File file = new File(name);
25.85
25.86 if (file.exists()) {
25.87 - if (showWarning("LBL_File_Exists", name)) { // NOI18N
25.88 + if (printWarning(i18n("LBL_File_Exists", name))) { // NOI18N
25.89 exportFile(file);
25.90 }
25.91 else {
25.92 @@ -166,7 +165,7 @@
25.93 file.isDirectory();
25.94 }
25.95 public String getDescription() {
25.96 - return getMessage("LBL_HTML_File_Type"); // NOI18N
25.97 + return i18n("LBL_HTML_File_Type"); // NOI18N
25.98 }
25.99 });
25.100 chooser.setSelectedFile(new File(myFileName.getText()));
25.101 @@ -182,7 +181,7 @@
25.102 // create html
25.103 StringBuffer html = new StringBuffer();
25.104 html.append("<html><body>" + LS); // NOI18N
25.105 - html.append("<h3>" + getMessage("LBL_Search_Results") + // NOI18N
25.106 + html.append("<h3>" + i18n("LBL_Search_Results") + // NOI18N
25.107 "</h3>" + LS + LS); // NOI18N
25.108
25.109 if (myTitle != null) {
25.110 @@ -190,7 +189,7 @@
25.111 }
25.112 if (text.size() > 0) {
25.113 html.append("<p><b>" + // NOI18N
25.114 - getMessage("LBL_Description") + "</b>"); // NOI18N
25.115 + i18n("LBL_Description") + "</b>"); // NOI18N
25.116
25.117 for (String item : text) {
25.118 html.append(item + LS);
25.119 @@ -225,7 +224,7 @@
25.120 outputStream.close();
25.121 }
25.122 catch (IOException e) {
25.123 - printError("LBL_Cannot_Write_to_File", file.getAbsolutePath()); // NOI18N
25.124 + printError(i18n("LBL_Cannot_Write_to_File", file.getAbsolutePath())); // NOI18N
25.125 show();
25.126 return;
25.127 }
25.128 @@ -254,7 +253,7 @@
25.129 {
25.130 myDescriptor = new DialogDescriptor(
25.131 getPanel(),
25.132 - getMessage("LBL_Export_Title") // NOI18N
25.133 + i18n("LBL_Export_Title") // NOI18N
25.134 );
25.135 return myDescriptor;
25.136 }
26.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Find.java Thu Feb 15 04:33:40 2007 +0000
26.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Find.java Mon Feb 19 13:24:25 2007 +0000
26.3 @@ -2,18 +2,18 @@
26.4 * The contents of this file are subject to the terms of the Common Development
26.5 * and Distribution License (the License). You may not use this file except in
26.6 * compliance with the License.
26.7 - *
26.8 + *
26.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
26.10 * or http://www.netbeans.org/cddl.txt.
26.11 - *
26.12 + *
26.13 * When distributing Covered Code, include this CDDL Header Notice in each file
26.14 * and include the License file at http://www.netbeans.org/cddl.txt.
26.15 * If applicable, add the following below the CDDL Header, with the fields
26.16 * enclosed by brackets [] replaced by your own identifying information:
26.17 * "Portions Copyrighted [year] [name of copyright owner]"
26.18 - *
26.19 + *
26.20 * The Original Software is NetBeans. The Initial Developer of the Original
26.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
26.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
26.23 * Microsystems, Inc. All Rights Reserved.
26.24 */
26.25 package org.netbeans.modules.bpel.search.impl.ui;
26.26 @@ -31,13 +31,11 @@
26.27 import javax.swing.KeyStroke;
26.28
26.29 import org.openide.actions.FindAction;
26.30 -import org.openide.util.NbBundle;
26.31 -
26.32 import org.netbeans.modules.xml.xam.ui.search.SearchControlPanel;
26.33 import org.netbeans.modules.xml.xam.ui.search.SearchProvider;
26.34 import org.netbeans.modules.xml.xam.ui.search.Query;
26.35
26.36 -import static org.netbeans.modules.print.api.PrintUtil.*;
26.37 +import static org.netbeans.modules.print.api.PrintUI.*;
26.38 import org.netbeans.modules.bpel.search.api.SearchElement;
26.39 import org.netbeans.modules.bpel.search.api.SearchEvent;
26.40 import org.netbeans.modules.bpel.search.api.SearchException;
26.41 @@ -123,7 +121,7 @@
26.42 }
26.43
26.44 public String getInputDescription() {
26.45 - return NbBundle.getMessage(Provider.class, "CTL_Input_Description"); // NOI18N
26.46 + return i18n(Provider.class, "CTL_Input_Description"); // NOI18N
26.47 }
26.48
26.49 public List<Object> search(Query query)
26.50 @@ -147,6 +145,7 @@
26.51 throw new org.netbeans.modules.xml.xam.ui.search.SearchException(
26.52 e.getMessage(), e);
26.53 }
26.54 +//out("returned: " + myElements);
26.55 return myElements;
26.56 }
26.57
26.58 @@ -154,13 +153,13 @@
26.59 if (query.isRegularExpression()) {
26.60 return SearchMatch.REGULAR_EXPRESSION;
26.61 }
26.62 - return SearchMatch.PATTERN_MATCH;
26.63 + return SearchMatch.PATTERN;
26.64 }
26.65
26.66 private String getText(Query query, SearchMatch match) {
26.67 - String text = query.getQuery();
26.68 + String text = query.getQuery().trim();
26.69
26.70 - if (match == SearchMatch.PATTERN_MATCH) {
26.71 + if (match == SearchMatch.PATTERN) {
26.72 return "*" + text + "*"; // NOI18N
26.73 }
26.74 return text;
26.75 @@ -174,14 +173,11 @@
26.76 myElements.add(event.getSearchElement());
26.77 }
26.78
26.79 - public void searchFinished(SearchEvent event) {
26.80 - myCurrentIndex = 0;
26.81 - }
26.82 + public void searchFinished(SearchEvent event) {}
26.83
26.84 private Object mySource;
26.85 private SearchEngine mySearchEngine;
26.86 }
26.87
26.88 - private int myCurrentIndex;
26.89 private List<Object> myElements;
26.90 }
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Progress.java Mon Feb 19 13:24:25 2007 +0000
27.3 @@ -0,0 +1,46 @@
27.4 +/*
27.5 + * The contents of this file are subject to the terms of the Common Development
27.6 + * and Distribution License (the License). You may not use this file except in
27.7 + * compliance with the License.
27.8 + *
27.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
27.10 + * or http://www.netbeans.org/cddl.txt.
27.11 + *
27.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
27.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
27.14 + * If applicable, add the following below the CDDL Header, with the fields
27.15 + * enclosed by brackets [] replaced by your own identifying information:
27.16 + * "Portions Copyrighted [year] [name of copyright owner]"
27.17 + *
27.18 + * The Original Software is NetBeans. The Initial Developer of the Original
27.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
27.20 + * Microsystems, Inc. All Rights Reserved.
27.21 + */
27.22 +package org.netbeans.modules.bpel.search.impl.ui;
27.23 +
27.24 +import static org.netbeans.modules.print.api.PrintUI.*;
27.25 +import org.netbeans.api.progress.ProgressHandle;
27.26 +import org.netbeans.api.progress.ProgressHandleFactory;
27.27 +import org.netbeans.modules.bpel.search.api.SearchEvent;
27.28 +import org.netbeans.modules.bpel.search.spi.SearchListener;
27.29 +
27.30 +/**
27.31 + * @author Vladimir Yaroslavskiy
27.32 + * @version 2007.01.25
27.33 + */
27.34 +final class Progress implements SearchListener {
27.35 +
27.36 + public void searchStarted(SearchEvent event) {
27.37 + myProgress = ProgressHandleFactory.createHandle(
27.38 + i18n(Progress.class, "LBL_Search_Progress")); // NOI18N
27.39 + myProgress.start();
27.40 + }
27.41 +
27.42 + public void searchFinished(SearchEvent event) {
27.43 + myProgress.finish();
27.44 + }
27.45 +
27.46 + public void searchFound(SearchEvent event) {}
27.47 +
27.48 + private ProgressHandle myProgress;
27.49 +}
28.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Search.java Thu Feb 15 04:33:40 2007 +0000
28.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Search.java Mon Feb 19 13:24:25 2007 +0000
28.3 @@ -2,18 +2,18 @@
28.4 * The contents of this file are subject to the terms of the Common Development
28.5 * and Distribution License (the License). You may not use this file except in
28.6 * compliance with the License.
28.7 - *
28.8 + *
28.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
28.10 * or http://www.netbeans.org/cddl.txt.
28.11 - *
28.12 + *
28.13 * When distributing Covered Code, include this CDDL Header Notice in each file
28.14 * and include the License file at http://www.netbeans.org/cddl.txt.
28.15 * If applicable, add the following below the CDDL Header, with the fields
28.16 * enclosed by brackets [] replaced by your own identifying information:
28.17 * "Portions Copyrighted [year] [name of copyright owner]"
28.18 - *
28.19 + *
28.20 * The Original Software is NetBeans. The Initial Developer of the Original
28.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
28.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
28.23 * Microsystems, Inc. All Rights Reserved.
28.24 */
28.25 package org.netbeans.modules.bpel.search.impl.ui;
28.26 @@ -35,27 +35,25 @@
28.27 import javax.swing.JPanel;
28.28
28.29 import org.openide.DialogDescriptor;
28.30 -import org.netbeans.modules.print.api.PrintUtil.Dialog;
28.31 +import org.netbeans.modules.print.api.PrintUI;
28.32
28.33 import org.netbeans.modules.bpel.search.api.SearchException;
28.34 import org.netbeans.modules.bpel.search.api.SearchOption;
28.35 import org.netbeans.modules.bpel.search.api.SearchMatch;
28.36 import org.netbeans.modules.bpel.search.spi.SearchEngine;
28.37 -import org.netbeans.modules.bpel.search.spi.SearchListener;
28.38
28.39 /**
28.40 * @author Vladimir Yaroslavskiy
28.41 * @version 2006.11.23
28.42 */
28.43 -public final class Search extends Dialog {
28.44 +public final class Search extends PrintUI {
28.45
28.46 /**{@inheritDoc}*/
28.47 public Component getUIComponent(List<SearchEngine> engines, Object source) {
28.48 mySource = source;
28.49 - myTree = new Tree();
28.50 mySearchEngine = engines.get(0);
28.51 - mySearchEngine.addSearchListener(myTree);
28.52 - // todo a? progress
28.53 + mySearchEngine.addSearchListener(new Tree());
28.54 + mySearchEngine.addSearchListener(new Progress());
28.55 show();
28.56 return getUIComponent();
28.57 }
28.58 @@ -71,10 +69,12 @@
28.59 c.gridx = 0;
28.60
28.61 // text
28.62 + c.insets = new Insets(SMALL_INSET, 0, 0, 0);
28.63 panel.add(createTextPanel(), c);
28.64
28.65 // option
28.66 - panel.add(getSeparator("LBL_Options"), c); // NOI18N
28.67 + c.insets = new Insets(0, 0, 0, 0);
28.68 + panel.add(createSeparator(i18n("LBL_Options")), c); // NOI18N
28.69 panel.add(createOptionPanel(), c);
28.70
28.71 return panel;
28.72 @@ -88,18 +88,13 @@
28.73 // text
28.74 c.gridy++;
28.75 c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
28.76 - JLabel label = createLabel("LBL_Name"); // NOI18N
28.77 + JLabel label = createLabel(i18n("LBL_Name")); // NOI18N
28.78 panel.add(label, c);
28.79
28.80 c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
28.81 c.fill = GridBagConstraints.HORIZONTAL;
28.82 c.weightx = 1.0;
28.83 myName = new TextField(ASTERISK);
28.84 - myName.addActionListener(new ActionListener() {
28.85 - public void actionPerformed(ActionEvent event) {
28.86 - updateButton();
28.87 - }
28.88 - });
28.89 setWidth(myName.getUIComponent(), TEXT_WIDTH);
28.90 label.setLabelFor(myName.getUIComponent());
28.91 panel.add(myName.getUIComponent(), c);
28.92 @@ -109,7 +104,7 @@
28.93 c.fill = GridBagConstraints.NONE;
28.94 c.weightx = 0.0;
28.95 c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
28.96 - label = createLabel("LBL_Type"); // NOI18N
28.97 + label = createLabel(i18n("LBL_Type")); // NOI18N
28.98 panel.add(label, c);
28.99
28.100 c.fill = GridBagConstraints.HORIZONTAL;
28.101 @@ -131,8 +126,8 @@
28.102
28.103 c.gridy++;
28.104 myMatchCase = createCheckBox(
28.105 - "LBL_Match_Case", // NOI18N
28.106 - new AbstractAction(getMessage("LBL_Match_Case")) { // NOI18N
28.107 + i18n("LBL_Match_Case"), // NOI18N
28.108 + new AbstractAction(i18n("LBL_Match_Case")) { // NOI18N
28.109 public void actionPerformed(ActionEvent event) {}
28.110 }
28.111 );
28.112 @@ -140,8 +135,8 @@
28.113
28.114 c.gridy++;
28.115 myPatternMatch = createCheckBox(
28.116 - "LBL_Pattern_Match", // NOI18N
28.117 - new AbstractAction(getMessage("LBL_Pattern_Match")) { // NOI18N
28.118 + i18n("LBL_Match_Pattern"), // NOI18N
28.119 + new AbstractAction(i18n("LBL_Match_Pattern")) { // NOI18N
28.120 public void actionPerformed(ActionEvent event) {
28.121 exclusion(myPatternMatch, myRegularExpression);
28.122 }
28.123 @@ -153,8 +148,8 @@
28.124
28.125 c.gridy++;
28.126 myRegularExpression = createCheckBox(
28.127 - "LBL_Regular_Expression", // NOI18N
28.128 - new AbstractAction(getMessage("LBL_Regular_Expression")) { // NOI18N
28.129 + i18n("LBL_Regular_Expression"), // NOI18N
28.130 + new AbstractAction(i18n("LBL_Regular_Expression")) { // NOI18N
28.131 public void actionPerformed(ActionEvent event) {
28.132 exclusion(myRegularExpression, myPatternMatch);
28.133 }
28.134 @@ -182,7 +177,7 @@
28.135
28.136 private SearchMatch getMatch() {
28.137 if (myPatternMatch.isSelected()) {
28.138 - return SearchMatch.PATTERN_MATCH;
28.139 + return SearchMatch.PATTERN;
28.140 }
28.141 if (myRegularExpression.isSelected()) {
28.142 return SearchMatch.REGULAR_EXPRESSION;
28.143 @@ -190,22 +185,15 @@
28.144 return null;
28.145 }
28.146
28.147 - private void updateButton() {
28.148 -// String text = myName.getText();
28.149 -// boolean enabled = text != null && text.length() > 0;
28.150 -// mySearchButton.setEnabled(enabled);
28.151 -// todo r
28.152 - }
28.153 -
28.154 private void search() {
28.155 myDescriptor.setClosingOptions(
28.156 - new Object[] {
28.157 + new Object [] {
28.158 mySearchButton,
28.159 DialogDescriptor.CANCEL_OPTION
28.160 }
28.161 );
28.162 SearchOption option = new SearchOption.Adapter(
28.163 - myName.getText(),
28.164 + myName.getText().trim(),
28.165 mySource,
28.166 myTarget.getSelectedItem(),
28.167 getMatch(),
28.168 @@ -217,11 +205,11 @@
28.169 }
28.170 catch (SearchException e) {
28.171 myDescriptor.setClosingOptions(
28.172 - new Object[] {
28.173 + new Object [] {
28.174 DialogDescriptor.CANCEL_OPTION
28.175 }
28.176 );
28.177 - printError("ERR_Pattern_Error", e.getMessage()); // NOI18N
28.178 + printError(i18n("ERR_Pattern_Error", e.getMessage())); // NOI18N
28.179 }
28.180 }
28.181
28.182 @@ -229,19 +217,17 @@
28.183 protected void closed()
28.184 {
28.185 myName.save();
28.186 - mySearchEngine.removeSearchListener(myTree);
28.187 mySearchEngine = null;
28.188 mySource = null;
28.189 - myTree = null;
28.190 }
28.191
28.192 @Override
28.193 protected DialogDescriptor createDescriptor()
28.194 {
28.195 - Object[] buttons = getButtons();
28.196 + Object [] buttons = getButtons();
28.197 myDescriptor = new DialogDescriptor(
28.198 getPanel(),
28.199 - getMessage("LBL_Advanced_Search"), // NOI18N
28.200 + i18n("LBL_Advanced_Search"), // NOI18N
28.201 true, // modal
28.202 buttons,
28.203 mySearchButton,
28.204 @@ -255,19 +241,17 @@
28.205 }
28.206 }
28.207 );
28.208 - updateButton();
28.209 -
28.210 return myDescriptor;
28.211 }
28.212
28.213 - private Object[] getButtons() {
28.214 + private Object [] getButtons() {
28.215 mySearchButton = createButton(
28.216 - "TLT_Search", // NOI18N
28.217 - new AbstractAction(getMessage("LBL_Search")) { // NOI18N
28.218 + i18n("TLT_Search"), // NOI18N
28.219 + new AbstractAction(i18n("LBL_Search")) { // NOI18N
28.220 public void actionPerformed(ActionEvent event) {}
28.221 }
28.222 );
28.223 - return new Object[] {
28.224 + return new Object [] {
28.225 mySearchButton,
28.226 DialogDescriptor.CANCEL_OPTION,
28.227 };
28.228 @@ -276,7 +260,6 @@
28.229 private Object mySource;
28.230 private TextField myName;
28.231 private JComboBox myTarget;
28.232 - private SearchListener myTree;
28.233 private JButton mySearchButton;
28.234 private JCheckBox myMatchCase;
28.235 private JCheckBox myPatternMatch;
29.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/TextField.java Thu Feb 15 04:33:40 2007 +0000
29.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/TextField.java Mon Feb 19 13:24:25 2007 +0000
29.3 @@ -2,18 +2,18 @@
29.4 * The contents of this file are subject to the terms of the Common Development
29.5 * and Distribution License (the License). You may not use this file except in
29.6 * compliance with the License.
29.7 - *
29.8 + *
29.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
29.10 * or http://www.netbeans.org/cddl.txt.
29.11 - *
29.12 + *
29.13 * When distributing Covered Code, include this CDDL Header Notice in each file
29.14 * and include the License file at http://www.netbeans.org/cddl.txt.
29.15 * If applicable, add the following below the CDDL Header, with the fields
29.16 * enclosed by brackets [] replaced by your own identifying information:
29.17 * "Portions Copyrighted [year] [name of copyright owner]"
29.18 - *
29.19 + *
29.20 * The Original Software is NetBeans. The Initial Developer of the Original
29.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
29.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
29.23 * Microsystems, Inc. All Rights Reserved.
29.24 */
29.25 package org.netbeans.modules.bpel.search.impl.ui;
30.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Tree.java Thu Feb 15 04:33:40 2007 +0000
30.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/Tree.java Mon Feb 19 13:24:25 2007 +0000
30.3 @@ -2,18 +2,18 @@
30.4 * The contents of this file are subject to the terms of the Common Development
30.5 * and Distribution License (the License). You may not use this file except in
30.6 * compliance with the License.
30.7 - *
30.8 + *
30.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
30.10 * or http://www.netbeans.org/cddl.txt.
30.11 - *
30.12 + *
30.13 * When distributing Covered Code, include this CDDL Header Notice in each file
30.14 * and include the License file at http://www.netbeans.org/cddl.txt.
30.15 * If applicable, add the following below the CDDL Header, with the fields
30.16 * enclosed by brackets [] replaced by your own identifying information:
30.17 * "Portions Copyrighted [year] [name of copyright owner]"
30.18 - *
30.19 + *
30.20 * The Original Software is NetBeans. The Initial Developer of the Original
30.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
30.23 * Microsystems, Inc. All Rights Reserved.
30.24 */
30.25 package org.netbeans.modules.bpel.search.impl.ui;
30.26 @@ -52,10 +52,9 @@
30.27 import javax.swing.tree.TreePath;
30.28 import javax.swing.tree.TreeSelectionModel;
30.29
30.30 -import org.openide.util.NbBundle;
30.31 import org.openide.windows.WindowManager;
30.32 +import static org.netbeans.modules.print.api.PrintUI.*;
30.33
30.34 -import static org.netbeans.modules.print.api.PrintUtil.*;
30.35 import org.netbeans.modules.bpel.search.api.SearchEvent;
30.36 import org.netbeans.modules.bpel.search.api.SearchElement;
30.37 import org.netbeans.modules.bpel.search.spi.SearchListener;
30.38 @@ -65,11 +64,15 @@
30.39 * @author Vladimir Yaroslavskiy
30.40 * @version 2006.11.24
30.41 */
30.42 -final class Tree implements SearchListener {
30.43 +final class Tree extends JTree implements SearchListener {
30.44 +
30.45 + Tree() {
30.46 + super(new DefaultTreeModel(new DefaultMutableTreeNode()));
30.47 + myRoot = (DefaultMutableTreeNode) getModel().getRoot();
30.48 + }
30.49
30.50 public void searchStarted(SearchEvent event) {
30.51 //out();
30.52 - myRoot = new DefaultMutableTreeNode();
30.53 myFoundCount = 0;
30.54 }
30.55
30.56 @@ -84,26 +87,48 @@
30.57 public void searchFinished(SearchEvent event) {
30.58 String text = event.getSearchOption().getText();
30.59 String count = String.valueOf(myFoundCount);
30.60 - String title = NbBundle.getMessage(
30.61 - Tree.class, "LBL_Found_Occurrences", text, myFoundCount); // NOI18N
30.62 - myRoot.setUserObject(
30.63 - new SearchElement.Adapter(title, title, Util.getIcon("find"), null)); // NOI18N
30.64
30.65 + String title = i18n(
30.66 + Tree.class, "LBL_Found_Occurrences", text, "" + myFoundCount); // NOI18N
30.67 +
30.68 + myRoot.setUserObject(new SearchElement.Adapter(
30.69 + title, title, icon(Util.class, "find"), null)); // NOI18N
30.70 +
30.71 + createOccurences();
30.72 +
30.73 + updateRoot();
30.74 View view = (View) WindowManager.getDefault().findTopComponent(View.NAME);
30.75 - view.show(createTree());
30.76 + view.show(this);
30.77 }
30.78
30.79 - private JTree createTree() {
30.80 - myTree = new JTree(new DefaultTreeModel(myRoot));
30.81 - myTree.getSelectionModel().setSelectionMode(
30.82 + private void createOccurences() {
30.83 + myOccurences = new ArrayList<DefaultMutableTreeNode>();
30.84 + createOccurences(myRoot);
30.85 + myIndex = -1;
30.86 + }
30.87 +
30.88 + private void createOccurences(DefaultMutableTreeNode node) {
30.89 + Enumeration children = node.children();
30.90 +
30.91 + if (node.isLeaf()) {
30.92 + myOccurences.add(node);
30.93 + }
30.94 + while (children.hasMoreElements()) {
30.95 + createOccurences((DefaultMutableTreeNode) children.nextElement());
30.96 + }
30.97 + }
30.98 +
30.99 + private void updateRoot() {
30.100 + getSelectionModel().setSelectionMode(
30.101 TreeSelectionModel.SINGLE_TREE_SELECTION);
30.102 - ToolTipManager.sharedInstance().registerComponent(myTree);
30.103 - myTree.setCellRenderer(new TreeRenderer());
30.104 - myTree.setShowsRootHandles(false);
30.105 - myTree.setRootVisible(true);
30.106 - myTree.setSelectionPath(new TreePath(myRoot.getPath()));
30.107 + ToolTipManager.sharedInstance().registerComponent(this);
30.108 + setCellRenderer(new TreeRenderer());
30.109 + setShowsRootHandles(false);
30.110 + setRootVisible(true);
30.111 + setSelectionPath(new TreePath(myRoot.getPath()));
30.112 + expandPath(new TreePath(myRoot.getPath()));
30.113
30.114 - myTree.addTreeWillExpandListener(new TreeWillExpandListener() {
30.115 + addTreeWillExpandListener(new TreeWillExpandListener() {
30.116 public void treeWillExpand(TreeExpansionEvent event) {
30.117 }
30.118 public void treeWillCollapse(TreeExpansionEvent event) {
30.119 @@ -111,7 +136,7 @@
30.120 collapseChildren(getNode(event.getPath()));
30.121 }
30.122 });
30.123 - myTree.addTreeExpansionListener(new TreeExpansionListener() {
30.124 + addTreeExpansionListener(new TreeExpansionListener() {
30.125 public void treeExpanded(TreeExpansionEvent event) {
30.126 //out("Expanded: " + getNode(event.getPath()));
30.127 expandChildren(getNode(event.getPath()));
30.128 @@ -121,7 +146,7 @@
30.129 updateSize();
30.130 }
30.131 });
30.132 - myTree.addMouseListener(new MouseAdapter() {
30.133 + addMouseListener(new MouseAdapter() {
30.134 public void mousePressed(MouseEvent event) {
30.135 if (SwingUtilities.isRightMouseButton(event)) {
30.136 showPopupMenu(event, event.getX(), event.getY());
30.137 @@ -138,14 +163,12 @@
30.138 }
30.139 }
30.140 });
30.141 - myTree.addKeyListener(new KeyAdapter() {
30.142 + addKeyListener(new KeyAdapter() {
30.143 public void keyReleased(KeyEvent event) {
30.144 handleEvent(event);
30.145 }
30.146 });
30.147 updateSize();
30.148 -
30.149 - return myTree;
30.150 }
30.151
30.152 private void handleEvent(KeyEvent event) {
30.153 @@ -162,12 +185,12 @@
30.154 }
30.155
30.156 private void handleAction(int code, int modifiers, DefaultMutableTreeNode node) {
30.157 - if (code == KeyEvent.VK_O && isAlt(modifiers)) {
30.158 + if (code == KeyEvent.VK_D && isAlt(modifiers)) {
30.159 + selectOnDiagram(node);
30.160 + }
30.161 + else if (code == KeyEvent.VK_O && isAlt(modifiers)) {
30.162 gotoSource(node);
30.163 }
30.164 - else if (code == KeyEvent.VK_D && isAlt(modifiers)) {
30.165 - selectOnDiagram(node);
30.166 - }
30.167 else if (code == KeyEvent.VK_C && isCtrl(modifiers)) {
30.168 copy(node);
30.169 }
30.170 @@ -187,7 +210,7 @@
30.171 nextOccurence(node);
30.172 }
30.173 else if (code == KeyEvent.VK_E && isCtrl(modifiers)) {
30.174 - collapseExpand(getSelectedNode());
30.175 + expose(node);
30.176 }
30.177 else if (code == KeyEvent.VK_DELETE) {
30.178 remove(node);
30.179 @@ -232,7 +255,7 @@
30.180 item.setEnabled( !node.isLeaf());
30.181 item.addActionListener(new ActionListener() {
30.182 public void actionPerformed(ActionEvent event) {
30.183 - collapseExpand(node);
30.184 + expose(node);
30.185 }
30.186 });
30.187 item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK));
30.188 @@ -256,6 +279,17 @@
30.189 private void createAction(JPopupMenu popup, final DefaultMutableTreeNode node) {
30.190 JMenuItem item;
30.191
30.192 + // select on diagram
30.193 + item = createItem("LBL_Select_on_Diagram"); // NOI18N
30.194 + item.setEnabled( !node.isRoot());
30.195 + item.addActionListener(new ActionListener() {
30.196 + public void actionPerformed(ActionEvent event) {
30.197 + selectOnDiagram(node);
30.198 + }
30.199 + });
30.200 + item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.ALT_MASK));
30.201 + popup.add(item);
30.202 +
30.203 // go to source
30.204 item = createItem("LBL_Go_to_Source"); // NOI18N
30.205 item.setEnabled( !node.isRoot());
30.206 @@ -267,17 +301,6 @@
30.207 item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.ALT_MASK));
30.208 popup.add(item);
30.209
30.210 - // select on diagram
30.211 - item = createItem("LBL_Select_on_Diagram"); // NOI18N
30.212 - item.setEnabled( !node.isRoot());
30.213 - item.addActionListener(new ActionListener() {
30.214 - public void actionPerformed(ActionEvent event) {
30.215 - selectOnDiagram(node);
30.216 - }
30.217 - });
30.218 - item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.ALT_MASK));
30.219 - popup.add(item);
30.220 -
30.221 // copy
30.222 item = createItem("LBL_Copy"); // NOI18N
30.223 item.addActionListener(new ActionListener() {
30.224 @@ -316,7 +339,7 @@
30.225 }
30.226
30.227 private void updateSize() {
30.228 - myTree.putClientProperty(Dimension.class.getName(), myTree.getMaximumSize());
30.229 + putClientProperty(Dimension.class.getName(), getMaximumSize());
30.230 }
30.231
30.232 private void gotoSource(DefaultMutableTreeNode node) {
30.233 @@ -327,12 +350,28 @@
30.234 ((SearchElement) node.getUserObject()).selectOnDiagram();
30.235 }
30.236
30.237 - private void previousOccurence(TreeNode node) {
30.238 -// todo a
30.239 + public void previousOccurence(TreeNode node) {
30.240 + myIndex--;
30.241 +
30.242 + if (myIndex < 0) {
30.243 + myIndex = myOccurences.size() - 1;
30.244 + }
30.245 + selectOccurence();
30.246 }
30.247
30.248 - private void nextOccurence(TreeNode node) {
30.249 -// todo a
30.250 + public void nextOccurence(TreeNode node) {
30.251 + myIndex++;
30.252 +
30.253 + if (myIndex == myOccurences.size()) {
30.254 + myIndex = 0;
30.255 + }
30.256 + selectOccurence();
30.257 + }
30.258 +
30.259 + private void selectOccurence() {
30.260 + TreePath path = new TreePath(myOccurences.get(myIndex).getPath());
30.261 + setSelectionPath(path);
30.262 + scrollPathToVisible(path);
30.263 }
30.264
30.265 private void copy(TreeNode node) {
30.266 @@ -356,7 +395,7 @@
30.267 }
30.268 }
30.269
30.270 - private void export(DefaultMutableTreeNode node) {
30.271 + public void export(DefaultMutableTreeNode node) {
30.272 List<List<String>> descriptions = new ArrayList<List<String>>();
30.273 export(node, descriptions);
30.274 descriptions.add (null);
30.275 @@ -410,13 +449,13 @@
30.276 return false;
30.277 }
30.278
30.279 - private void collapseExpand(DefaultMutableTreeNode node) {
30.280 + public void expose(DefaultMutableTreeNode node) {
30.281 if (node == null || node.isLeaf()) {
30.282 return;
30.283 }
30.284 myIsReformAll = true;
30.285 TreePath path = new TreePath(node.getPath());
30.286 - boolean isExpanded = myTree.isExpanded(path);
30.287 + boolean isExpanded = isExpanded(path);
30.288
30.289 // for root special check
30.290 if (node.isRoot()) {
30.291 @@ -426,7 +465,7 @@
30.292 while (children.hasMoreElements()) {
30.293 DefaultMutableTreeNode child =
30.294 (DefaultMutableTreeNode) children.nextElement();
30.295 - isExpanded = myTree.isExpanded(new TreePath(child.getPath()));
30.296 + isExpanded = isExpanded(new TreePath(child.getPath()));
30.297
30.298 if (isExpanded) {
30.299 break;
30.300 @@ -439,14 +478,14 @@
30.301 collapseChildren(node);
30.302 }
30.303 else {
30.304 - myTree.collapsePath(path);
30.305 + collapsePath(path);
30.306 }
30.307 }
30.308 else {
30.309 // expand
30.310 - myTree.expandPath(path);
30.311 + expandPath(path);
30.312
30.313 - if (myTree.isExpanded(path)) {
30.314 + if (isExpanded(path)) {
30.315 expandChildren(node);
30.316 }
30.317 }
30.318 @@ -461,9 +500,9 @@
30.319 DefaultMutableTreeNode child =
30.320 (DefaultMutableTreeNode) children.nextElement();
30.321 TreePath path = new TreePath(child.getPath());
30.322 - myTree.expandPath(path);
30.323 + expandPath(path);
30.324
30.325 - if (myTree.isExpanded(path)) {
30.326 + if (isExpanded(path)) {
30.327 expandChildren(child);
30.328 }
30.329 }
30.330 @@ -476,9 +515,9 @@
30.331
30.332 if ( !children.hasMoreElements()) {
30.333 TreePath path = new TreePath(child.getPath());
30.334 - myTree.expandPath(path);
30.335 + expandPath(path);
30.336
30.337 - if (myTree.isExpanded(path)) {
30.338 + if (isExpanded(path)) {
30.339 expandChildren(child);
30.340 }
30.341 }
30.342 @@ -494,7 +533,7 @@
30.343 DefaultMutableTreeNode child =
30.344 (DefaultMutableTreeNode) children.nextElement();
30.345 TreePath path = new TreePath(child.getPath());
30.346 - myTree.collapsePath(path);
30.347 + collapsePath(path);
30.348 }
30.349 }
30.350 }
30.351 @@ -502,9 +541,12 @@
30.352 private void remove(DefaultMutableTreeNode node) {
30.353 DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
30.354
30.355 - if (parent != null) {
30.356 + if (parent == null) {
30.357 + return;
30.358 + }
30.359 + if (printConfirmation(i18n(Tree.class, "LBL_Are_You_Sure"))) { // NOI18N
30.360 parent.remove(node);
30.361 - myTree.updateUI();
30.362 + updateUI();
30.363 }
30.364 }
30.365
30.366 @@ -512,8 +554,8 @@
30.367 return (DefaultMutableTreeNode) path.getLastPathComponent();
30.368 }
30.369
30.370 - private DefaultMutableTreeNode getSelectedNode() {
30.371 - TreePath[] paths = myTree.getSelectionPaths();
30.372 + public DefaultMutableTreeNode getSelectedNode() {
30.373 + TreePath [] paths = getSelectionPaths();
30.374
30.375 if (paths == null || paths.length == 0) {
30.376 return myRoot;
30.377 @@ -527,7 +569,7 @@
30.378 }
30.379
30.380 private JMenuItem createItem(String name) {
30.381 - return new JMenuItem(NbBundle.getMessage(Tree.class, name));
30.382 + return new JMenuItem(i18n(Tree.class, name));
30.383 }
30.384
30.385 private void addElement(
30.386 @@ -584,8 +626,8 @@
30.387 return elements.iterator();
30.388 }
30.389
30.390 - // ----------------------------------------------------------------
30.391 - private static class TreeRenderer extends DefaultTreeCellRenderer {
30.392 + // ----------------------------------------------------------------------
30.393 + private static final class TreeRenderer extends DefaultTreeCellRenderer {
30.394
30.395 public Component getTreeCellRendererComponent (
30.396 JTree tree, Object value, boolean select, boolean expanded,
30.397 @@ -602,9 +644,10 @@
30.398 }
30.399 }
30.400
30.401 - private JTree myTree;
30.402 + private int myIndex;
30.403 private Export myExport;
30.404 private int myFoundCount;
30.405 private boolean myIsReformAll;
30.406 private DefaultMutableTreeNode myRoot;
30.407 + private List<DefaultMutableTreeNode> myOccurences;
30.408 }
31.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/View.java Thu Feb 15 04:33:40 2007 +0000
31.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/ui/View.java Mon Feb 19 13:24:25 2007 +0000
31.3 @@ -2,35 +2,39 @@
31.4 * The contents of this file are subject to the terms of the Common Development
31.5 * and Distribution License (the License). You may not use this file except in
31.6 * compliance with the License.
31.7 - *
31.8 + *
31.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
31.10 * or http://www.netbeans.org/cddl.txt.
31.11 - *
31.12 + *
31.13 * When distributing Covered Code, include this CDDL Header Notice in each file
31.14 * and include the License file at http://www.netbeans.org/cddl.txt.
31.15 * If applicable, add the following below the CDDL Header, with the fields
31.16 * enclosed by brackets [] replaced by your own identifying information:
31.17 * "Portions Copyrighted [year] [name of copyright owner]"
31.18 - *
31.19 + *
31.20 * The Original Software is NetBeans. The Initial Developer of the Original
31.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
31.23 * Microsystems, Inc. All Rights Reserved.
31.24 */
31.25 package org.netbeans.modules.bpel.search.impl.ui;
31.26
31.27 +import java.awt.Dimension;
31.28 import java.awt.GridBagConstraints;
31.29 import java.awt.GridBagLayout;
31.30 +import java.awt.event.ActionEvent;
31.31 import java.awt.event.FocusEvent;
31.32 import java.awt.event.FocusListener;
31.33 import java.util.Date;
31.34
31.35 +import javax.swing.AbstractAction;
31.36 +import javax.swing.JButton;
31.37 import javax.swing.JScrollPane;
31.38 -import javax.swing.JTree;
31.39 +import javax.swing.JToolBar;
31.40
31.41 import org.openide.util.HelpCtx;
31.42 -import org.openide.util.NbBundle;
31.43 import org.openide.windows.TopComponent;
31.44
31.45 +import static org.netbeans.modules.print.api.PrintUI.*;
31.46 import org.netbeans.modules.bpel.search.impl.util.Util;
31.47
31.48 /**
31.49 @@ -41,12 +45,12 @@
31.50
31.51 /**{@inheritDoc}*/
31.52 public View() {
31.53 - setIcon(Util.getIcon("find").getImage()); // NOI18N
31.54 + setIcon(icon(Util.class, "find").getImage()); // NOI18N
31.55 setLayout(new GridBagLayout());
31.56 setFocusable(true);
31.57 }
31.58
31.59 - void show(JTree tree) {
31.60 + void show(Tree tree) {
31.61 myTree = tree;
31.62 myModifiedDate = new Date(System.currentTimeMillis());
31.63 myTree.addFocusListener(this);
31.64 @@ -68,25 +72,91 @@
31.65
31.66 private void setActivatedNode() {
31.67 String root = myTree.getModel().getRoot().toString();
31.68 - String name = NbBundle.getMessage(
31.69 + String name = i18n(
31.70 View.class, "CTL_Search_Results_Print", root); // NOI18N
31.71 setActivatedNodes(new Node [] { new Node(myTree, name, myModifiedDate) });
31.72 }
31.73
31.74 private void createPanel() {
31.75 removeAll();
31.76 - JScrollPane scrollPanel = new JScrollPane(myTree);
31.77 + JScrollPane scrollPane = new JScrollPane(myTree);
31.78 GridBagConstraints c = new GridBagConstraints();
31.79 c.anchor = GridBagConstraints.NORTH;
31.80 +
31.81 + // buttons
31.82 + add(createButtonPanel(), c);
31.83 +
31.84 + // tree
31.85 c.fill = GridBagConstraints.BOTH;
31.86 c.weightx = 1.0;
31.87 c.weighty = 1.0;
31.88 - add(scrollPanel, c);
31.89 -//todo a add buttons on toolbar
31.90 + add(scrollPane, c);
31.91
31.92 revalidate();
31.93 repaint();
31.94 }
31.95 +
31.96 + private JToolBar createButtonPanel() {
31.97 + JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
31.98 + toolBar.setFloatable(false);
31.99 + JButton button;
31.100 +
31.101 + // collapse/expand
31.102 + button = createButton(
31.103 + i18n(View.class, "TLT_Expose"), // NOI18N
31.104 + new AbstractAction(null, icon(Util.class, "expose")) { // NOI18N
31.105 + public void actionPerformed(ActionEvent event) {
31.106 + myTree.expose(myTree.getSelectedNode());
31.107 + }
31.108 + }
31.109 + );
31.110 + setSize(button);
31.111 + toolBar.add(button);
31.112 +
31.113 + // export
31.114 + button = createButton(
31.115 + i18n(View.class, "TLT_Export"), // NOI18N
31.116 + new AbstractAction(null, icon(Util.class, "export")) { // NOI18N
31.117 + public void actionPerformed(ActionEvent event) {
31.118 + myTree.export(myTree.getSelectedNode());
31.119 + }
31.120 + }
31.121 + );
31.122 + setSize(button);
31.123 + toolBar.add(button);
31.124 +
31.125 + // previous occurence
31.126 + button = createButton(
31.127 + i18n(View.class, "TLT_Previous_Occurence"), // NOI18N
31.128 + new AbstractAction(null, icon(Util.class, "previous")) { // NOI18N
31.129 + public void actionPerformed(ActionEvent event) {
31.130 + myTree.previousOccurence(myTree.getSelectedNode());
31.131 + }
31.132 + }
31.133 + );
31.134 + setSize(button);
31.135 + toolBar.add(button);
31.136 +
31.137 + // next occurence
31.138 + button = createButton(
31.139 + i18n(View.class, "TLT_Next_Occurence"), // NOI18N
31.140 + new AbstractAction(null, icon(Util.class, "next")) { // NOI18N
31.141 + public void actionPerformed(ActionEvent event) {
31.142 + myTree.nextOccurence(myTree.getSelectedNode());
31.143 + }
31.144 + }
31.145 + );
31.146 + setSize(button);
31.147 + toolBar.add(button);
31.148 +
31.149 + return toolBar;
31.150 + }
31.151 +
31.152 + private void setSize(JButton button) {
31.153 + button.setMaximumSize(IMAGE_BUTTON_SIZE);
31.154 + button.setMinimumSize(IMAGE_BUTTON_SIZE);
31.155 + button.setPreferredSize(IMAGE_BUTTON_SIZE);
31.156 + }
31.157
31.158 /**{@inheritDoc}*/
31.159 @Override
31.160 @@ -113,14 +183,14 @@
31.161 @Override
31.162 public String getDisplayName()
31.163 {
31.164 - return NbBundle.getMessage(View.class, "CTL_Search_Results_Name"); // NOI18N
31.165 + return i18n(View.class, "CTL_Search_Results_Name"); // NOI18N
31.166 }
31.167
31.168 /**{@inheritDoc}*/
31.169 @Override
31.170 public String getToolTipText()
31.171 {
31.172 - return NbBundle.getMessage(View.class, "CTL_Search_Results_Tooltip"); // NOI18N
31.173 + return i18n(View.class, "CTL_Search_Results_Tooltip"); // NOI18N
31.174 }
31.175
31.176 @Override
31.177 @@ -137,7 +207,9 @@
31.178 return NAME;
31.179 }
31.180
31.181 + private Tree myTree;
31.182 + private Date myModifiedDate;
31.183 +
31.184 public static final String NAME = "search"; // NOI18N
31.185 - private JTree myTree;
31.186 - private Date myModifiedDate;
31.187 + private static final Dimension IMAGE_BUTTON_SIZE = new Dimension(24, 24);
31.188 }
32.1 --- a/bpel.search/src/org/netbeans/modules/bpel/search/impl/util/Util.java Thu Feb 15 04:33:40 2007 +0000
32.2 +++ b/bpel.search/src/org/netbeans/modules/bpel/search/impl/util/Util.java Mon Feb 19 13:24:25 2007 +0000
32.3 @@ -2,18 +2,18 @@
32.4 * The contents of this file are subject to the terms of the Common Development
32.5 * and Distribution License (the License). You may not use this file except in
32.6 * compliance with the License.
32.7 - *
32.8 + *
32.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
32.10 * or http://www.netbeans.org/cddl.txt.
32.11 - *
32.12 + *
32.13 * When distributing Covered Code, include this CDDL Header Notice in each file
32.14 * and include the License file at http://www.netbeans.org/cddl.txt.
32.15 * If applicable, add the following below the CDDL Header, with the fields
32.16 * enclosed by brackets [] replaced by your own identifying information:
32.17 * "Portions Copyrighted [year] [name of copyright owner]"
32.18 - *
32.19 + *
32.20 * The Original Software is NetBeans. The Initial Developer of the Original
32.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
32.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
32.23 * Microsystems, Inc. All Rights Reserved.
32.24 */
32.25 package org.netbeans.modules.bpel.search.impl.util;
32.26 @@ -22,10 +22,7 @@
32.27 import java.util.Collection;
32.28 import java.util.List;
32.29
32.30 -import javax.swing.ImageIcon;
32.31 -
32.32 import org.openide.util.Lookup;
32.33 -import org.netbeans.modules.print.api.PrintUtil;
32.34
32.35 /**
32.36 * @author Vladimir Yaroslavskiy
32.37 @@ -46,13 +43,4 @@
32.38 }
32.39 return list;
32.40 }
32.41 -
32.42 - /**
32.43 - * Returns icon for given name.
32.44 - * @param name given name
32.45 - * @return icon for given name
32.46 - */
32.47 - public static ImageIcon getIcon(String name) {
32.48 - return PrintUtil.getIcon(Util.class, name);
32.49 - }
32.50 }
33.1 --- a/xslt.project/nbproject/project.properties Thu Feb 15 04:33:40 2007 +0000
33.2 +++ b/xslt.project/nbproject/project.properties Mon Feb 19 13:24:25 2007 +0000
33.3 @@ -2,18 +2,18 @@
33.4 # The contents of this file are subject to the terms of the Common Development
33.5 # and Distribution License (the License). You may not use this file except in
33.6 # compliance with the License.
33.7 -#
33.8 +#
33.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
33.10 # or http://www.netbeans.org/cddl.txt.
33.11 -#
33.12 +#
33.13 # When distributing Covered Code, include this CDDL Header Notice in each file
33.14 # and include the License file at http://www.netbeans.org/cddl.txt.
33.15 # If applicable, add the following below the CDDL Header, with the fields
33.16 # enclosed by brackets [] replaced by your own identifying information:
33.17 # "Portions Copyrighted [year] [name of copyright owner]"
33.18 -#
33.19 +#
33.20 # The Original Software is NetBeans. The Initial Developer of the Original
33.21 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
33.22 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
33.23 # Microsystems, Inc. All Rights Reserved.
33.24
33.25 javac.source=1.5
34.1 --- a/xslt.project/nbproject/project.xml Thu Feb 15 04:33:40 2007 +0000
34.2 +++ b/xslt.project/nbproject/project.xml Mon Feb 19 13:24:25 2007 +0000
34.3 @@ -1,21 +1,21 @@
34.4 <?xml version="1.0" encoding="UTF-8"?>
34.5 <!--
34.6 - The contents of this file are subject to the terms of the Common Development
34.7 - and Distribution License (the License). You may not use this file except in
34.8 - compliance with the License.
34.9 -
34.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
34.11 - or http://www.netbeans.org/cddl.txt.
34.12 -
34.13 - When distributing Covered Code, include this CDDL Header Notice in each file
34.14 - and include the License file at http://www.netbeans.org/cddl.txt.
34.15 - If applicable, add the following below the CDDL Header, with the fields
34.16 - enclosed by brackets [] replaced by your own identifying information:
34.17 - "Portions Copyrighted [year] [name of copyright owner]"
34.18 -
34.19 - The Original Software is NetBeans. The Initial Developer of the Original
34.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
34.21 - Microsystems, Inc. All Rights Reserved.
34.22 + The contents of this file are subject to the terms of the Common Development
34.23 + and Distribution License (the License). You may not use this file except in
34.24 + compliance with the License.
34.25 +
34.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
34.27 + or http://www.netbeans.org/cddl.txt.
34.28 +
34.29 + When distributing Covered Code, include this CDDL Header Notice in each file
34.30 + and include the License file at http://www.netbeans.org/cddl.txt.
34.31 + If applicable, add the following below the CDDL Header, with the fields
34.32 + enclosed by brackets [] replaced by your own identifying information:
34.33 + "Portions Copyrighted [year] [name of copyright owner]"
34.34 +
34.35 + The Original Software is NetBeans. The Initial Developer of the Original
34.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
34.37 + Microsystems, Inc. All Rights Reserved.
34.38 -->
34.39 <project xmlns="http://www.netbeans.org/ns/project/1">
34.40 <type>org.netbeans.modules.apisupport.project</type>
35.1 --- a/xslt.project/src/org/netbeans/modules/xslt/project/resources/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
35.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/resources/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
35.3 @@ -2,19 +2,20 @@
35.4 # The contents of this file are subject to the terms of the Common Development
35.5 # and Distribution License (the License). You may not use this file except in
35.6 # compliance with the License.
35.7 -#
35.8 +#
35.9 # You can obtain a copy of the License at http://www.netbeans.org/cddl.html
35.10 # or http://www.netbeans.org/cddl.txt.
35.11 -#
35.12 +#
35.13 # When distributing Covered Code, include this CDDL Header Notice in each file
35.14 # and include the License file at http://www.netbeans.org/cddl.txt.
35.15 # If applicable, add the following below the CDDL Header, with the fields
35.16 # enclosed by brackets [] replaced by your own identifying information:
35.17 # "Portions Copyrighted [year] [name of copyright owner]"
35.18 +#
35.19 +# The Original Software is NetBeans. The Initial Developer of the Original
35.20 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
35.21 +# Microsystems, Inc. All Rights Reserved.
35.22 #
35.23 -# The Original Software is NetBeans. The Initial Developer of the Original
35.24 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
35.25 -# Microsystems, Inc. All Rights Reserved.
35.26
35.27 # manifest
35.28 OpenIDE-Module-Name=XSLT Project
35.29 @@ -22,3 +23,5 @@
35.30 OpenIDE-Module-Short-Description=XSLT Project.
35.31 OpenIDE-Module-Long-Description=XSLT Project.
35.32
35.33 +# layer.xml
35.34 +Templates/SOA/xslt.service=XSLT Service
36.1 --- a/xslt.project/src/org/netbeans/modules/xslt/project/resources/layer.xml Thu Feb 15 04:33:40 2007 +0000
36.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/resources/layer.xml Mon Feb 19 13:24:25 2007 +0000
36.3 @@ -1,21 +1,21 @@
36.4 <?xml version="1.0" encoding="UTF-8"?>
36.5 <!--
36.6 - The contents of this file are subject to the terms of the Common Development
36.7 - and Distribution License (the License). You may not use this file except in
36.8 - compliance with the License.
36.9 -
36.10 - You can obtain a copy of the License at http://www.netbeans.org/cddl.html
36.11 - or http://www.netbeans.org/cddl.txt.
36.12 -
36.13 - When distributing Covered Code, include this CDDL Header Notice in each file
36.14 - and include the License file at http://www.netbeans.org/cddl.txt.
36.15 - If applicable, add the following below the CDDL Header, with the fields
36.16 - enclosed by brackets [] replaced by your own identifying information:
36.17 - "Portions Copyrighted [year] [name of copyright owner]"
36.18 -
36.19 - The Original Software is NetBeans. The Initial Developer of the Original
36.20 - Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
36.21 - Microsystems, Inc. All Rights Reserved.
36.22 + The contents of this file are subject to the terms of the Common Development
36.23 + and Distribution License (the License). You may not use this file except in
36.24 + compliance with the License.
36.25 +
36.26 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
36.27 + or http://www.netbeans.org/cddl.txt.
36.28 +
36.29 + When distributing Covered Code, include this CDDL Header Notice in each file
36.30 + and include the License file at http://www.netbeans.org/cddl.txt.
36.31 + If applicable, add the following below the CDDL Header, with the fields
36.32 + enclosed by brackets [] replaced by your own identifying information:
36.33 + "Portions Copyrighted [year] [name of copyright owner]"
36.34 +
36.35 + The Original Software is NetBeans. The Initial Developer of the Original
36.36 + Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
36.37 + Microsystems, Inc. All Rights Reserved.
36.38 -->
36.39 <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
36.40
36.41 @@ -30,19 +30,20 @@
36.42 <attr name="template" boolvalue="true"/>
36.43 <attr name="templateWizardIterator" newvalue="org.netbeans.modules.xslt.project.prjwizard.NewXsltproProjectWizardIterator"/>
36.44 <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.xslt.project.prjwizard.Bundle"/>
36.45 - <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/xsltProjectIcon.gif"/>
36.46 + <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/xsltProjectIcon.png"/>
36.47 <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/emptyProject.html"/>
36.48 </file>
36.49 </folder>
36.50 </folder>
36.51
36.52 <folder name="SOA">
36.53 - <file name="xsl.xsl" url="xsl.xsl">
36.54 + <file name="xslt.service">
36.55 <attr name="template" boolvalue="true"/>
36.56 <attr name="instantiatingIterator" newvalue="org.netbeans.modules.xslt.project.wizard.element.Iterator"/>
36.57 - <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/template/xsl.html"/>
36.58 - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.xslt.project.resources.template.Bundle"/>
36.59 - <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/template/xsl.gif"/>
36.60 + <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/xslt.html"/>
36.61 + <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.xslt.project.resources.Bundle"/>
36.62 + <!--attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/xslt/project/resources/xslt.gif"/-->
36.63 + <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/xslt/core/resources/xslt_file.gif"/>
36.64 </file>
36.65 </folder>
36.66 </folder>
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/resources/xslt.html Mon Feb 19 13:24:25 2007 +0000
37.3 @@ -0,0 +1,3 @@
37.4 +<html><body>
37.5 + Creates new XSLT Service.
37.6 +</body></html>
38.1 --- a/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/Bundle.properties Thu Feb 15 04:33:40 2007 +0000
38.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/Bundle.properties Mon Feb 19 13:24:25 2007 +0000
38.3 @@ -1,45 +1,91 @@
38.4 +#
38.5 +# The contents of this file are subject to the terms of the Common Development
38.6 +# and Distribution License (the License). You may not use this file except in
38.7 +# compliance with the License.
38.8 +#
38.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
38.10 +# or http://www.netbeans.org/cddl.txt.
38.11 +#
38.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
38.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
38.14 +# If applicable, add the following below the CDDL Header, with the fields
38.15 +# enclosed by brackets [] replaced by your own identifying information:
38.16 +# "Portions Copyrighted [year] [name of copyright owner]"
38.17 +#
38.18 +# The Original Software is NetBeans. The Initial Developer of the Original
38.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
38.20 +# Microsystems, Inc. All Rights Reserved.
38.21 +
38.22 # Iterator
38.23 -# {0} - current page in wizard
38.24 -# {1} - total count of pages in wizard
38.25 -LBL_x_of_y={0} of {1}
38.26 +LBL_Title=XSLT Service
38.27 +
38.28 +# Util
38.29 +# {0} - argument
38.30 +ERR_Illegal_Argument=illegal argument - {0}
38.31 +
38.32 +# Panel.Startup
38.33 +LBL_Transformation=&Request-Reply Service
38.34 +LBL_Transformation_Text=The XSLT service receives a message from a web service, transforms it and sends it back.
38.35 +LBL_Proxy=&Service Proxy
38.36 +LBL_Proxy_Text=The XSLT service acts as a proxy service, transforming messages exchanged by two web services.
38.37 +
38.38 +# Panel.WSDL
38.39 +# {0} - message
38.40 +ERR_Occurred=Error occurred: {0}
38.41 +# {0} - file name
38.42 +ERR_File_Already_Exists=File {0} already exists.
38.43 +ERR_File_Name_Must_Be_Specified=File name must be specified!
38.44 +LBL_Existing_WSDL=&Existing WSDL file
38.45 +LBL_Create_New_WSDL=&Create new WSDL file
38.46 +LBL_Name=&Name
38.47 +
38.48 +# Panel.WebService
38.49 +ERR_Web_Service_Is_Required=Web Service is required.
38.50 +LBL_Web_Service_File=&Web Service:
38.51 +TLT_Browse_WSDL=Browse WSDL file
38.52 +LBL_Browse_WSDL=&Browse ...
38.53 +
38.54 +# Dialog
38.55 +LBL_Name=Name:
38.56 +ERR_Name_Must_Be_Specified=Name must be specified!
38.57 +
38.58 +# Dialog.Operation
38.59 +LBL_Enter_Operation_Name=Enter Operation Name
38.60 +
38.61 +# Panel.Operation
38.62 +ERR_Input_Type_Must_Be_Specified=Input type must be specified!
38.63 +ERR_Output_Type_Must_Be_Specified=Output type must be specified!
38.64 +ERR_Operation_Is_Required=Operation is required.
38.65 +ERR_Operation_With_Input_Is_Required=Operation with input is required.
38.66 +ERR_Operation_With_Output_Is_Required=Operation with output is required.
38.67 +LBL_Operation=&Operation:
38.68 +TLT_Create_Operation=Create new operation
38.69 +LBL_Create_Operation=Cre&ate ...
38.70 +LBL_Input_Type=&Input Type:
38.71 +LBL_Output_Type=Output &Type:
38.72 +LBL_XSL_File=&XSL File:
38.73 +TLT_Choose_Input_Type=Allows to choose input type
38.74 +LBL_Choose_Input_Type=&Choose ...
38.75 +TLT_Choose_Output_Type=Allows to choose output type
38.76 +LBL_Choose_Output_Type=C&hoose ...
38.77 +LBL_Partner_Role_Port=&Port (Partner/Role):
38.78 +LBL_Transform_JBI=Transform &JBI
38.79 +
38.80 +# Dialog.Type
38.81 +LBL_Select_Type=Select Type
38.82 +TLT_Browse_Schema=Browse Schema file
38.83 +LBL_Browse_Schema=&Browse ...
38.84 +
38.85 +# Panel.Proxy
38.86 +# {0} - from
38.87 +# {1} - to
38.88 +LBL_From_To={0} -> {1}
38.89 +LBL_We_Implement=We Implement
38.90 +LBL_We_Call=We Call
38.91 +LBL_Transform_Request=Transform Re&quest
38.92 +LBL_Transform_Reply=Transform Rep&ly
38.93
38.94 # Panel
38.95 -# {0} - file name
38.96 -ERR_File_Exists=File {0} already exists.
38.97 -ERR_Service_Is_Required=Service is required.
38.98 -ERR_Operation_Is_Required=Operation is required.
38.99 -ERR_Set_Service=Please set service at first.
38.100 -ERR_Operation_With_Input_Is_Required=Operation with input is required.
38.101 -ERR_Operation_With_Input_Message_Is_Required=Operation with input message is required.
38.102 -ERR_Operation_With_Output_Is_Required=Operation with output is required.
38.103 -ERR_Operation_With_Output_Message_Is_Required=Operation with output message is required.
38.104 -LBL_File=&File Name:
38.105 -LBL_Service=&Service:
38.106 -LBL_Operation=&Operation:
38.107 -TLT_Create_WSDL=Create new WSDL file
38.108 -LBL_Create_WSDL=&Create
38.109 -
38.110 -# WSDL
38.111 -# {0} - message
38.112 -ERR_Occurred=Error occurred:\n{0}
38.113 -LBL_Enter_File_Name=Enter File Name
38.114 -
38.115 -# Type
38.116 -LBL_Select_Type=Select Type
38.117 -
38.118 -# Operattio
38.119 -LBL_Enter_Opetation_Name=Enter Opetation Name
38.120 -LBL_Input_Type=&Input Type:
38.121 -LBL_Output_Type=Output &Type:
38.122 -TLT_Create_Operation=Create new operation
38.123 -LBL_Create_Operation=Cre&ate
38.124 -TLT_Browse_Input_Type=Allows to select input type
38.125 -LBL_Browse_Input_Type=&Browse
38.126 -TLT_Browse_Output_Type=Allows to select output type
38.127 -LBL_Browse_Output_Type=Br&owse
38.128 -ERR_Input_Type_Must_Be_Specified=Input type must be specified!
38.129 -ERR_Output_Type_Must_Be_Specified=Output type must be specified!
38.130 -
38.131 -# Name
38.132 -LBL_Name=Name:
38.133 -ERR_Name_Must_Be_Specified=Name must be specified!
38.134 +LBL_Service_Type=Service type
38.135 +LBL_WSDL_File=WSDL file
38.136 +LBL_XSLT_Configuration=XSLT configuration
39.1 --- a/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/Iterator.java Thu Feb 15 04:33:40 2007 +0000
39.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/Iterator.java Mon Feb 19 13:24:25 2007 +0000
39.3 @@ -2,60 +2,46 @@
39.4 * The contents of this file are subject to the terms of the Common Development
39.5 * and Distribution License (the License). You may not use this file except in
39.6 * compliance with the License.
39.7 - *
39.8 + *
39.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
39.10 * or http://www.netbeans.org/cddl.txt.
39.11 - *
39.12 + *
39.13 * When distributing Covered Code, include this CDDL Header Notice in each file
39.14 * and include the License file at http://www.netbeans.org/cddl.txt.
39.15 * If applicable, add the following below the CDDL Header, with the fields
39.16 * enclosed by brackets [] replaced by your own identifying information:
39.17 * "Portions Copyrighted [year] [name of copyright owner]"
39.18 - *
39.19 + *
39.20 * The Original Software is NetBeans. The Initial Developer of the Original
39.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
39.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
39.23 * Microsystems, Inc. All Rights Reserved.
39.24 */
39.25 package org.netbeans.modules.xslt.project.wizard.element;
39.26
39.27 import java.io.IOException;
39.28 -import java.util.Collection;
39.29 import java.util.Collections;
39.30 -import java.util.List;
39.31 import java.util.Set;
39.32 import javax.swing.event.ChangeListener;
39.33
39.34 import org.openide.WizardDescriptor;
39.35 -import org.openide.cookies.SaveCookie;
39.36 import org.openide.filesystems.FileObject;
39.37 -import org.openide.loaders.DataObject;
39.38 import org.openide.loaders.TemplateWizard;
39.39 -import org.openide.util.NbBundle;
39.40
39.41 import org.netbeans.api.project.Project;
39.42 import org.netbeans.spi.project.ui.templates.support.Templates;
39.43 -
39.44 -import org.netbeans.modules.xml.xam.dom.NamedComponentReference;
39.45 -import org.netbeans.modules.xml.wsdl.model.Definitions;
39.46 -import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;
39.47 -import org.netbeans.modules.xml.wsdl.model.Input;
39.48 import org.netbeans.modules.xml.wsdl.model.Message;
39.49 import org.netbeans.modules.xml.wsdl.model.Operation;
39.50 -import org.netbeans.modules.xml.wsdl.model.Output;
39.51 -import org.netbeans.modules.xml.wsdl.model.Part;
39.52 -import org.netbeans.modules.xml.wsdl.model.PortType;
39.53 -import org.netbeans.modules.xml.wsdl.model.WSDLComponentFactory;
39.54 -import org.netbeans.modules.xml.wsdl.model.WSDLModel;
39.55
39.56 -import org.netbeans.modules.xml.wsdl.model.extensions.bpel.BPELComponentFactory;
39.57 -import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PartnerLinkType;
39.58 -import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Role;
39.59 -
39.60 +import org.netbeans.modules.xslt.core.xsltmap.AbstractTransformationDesc;
39.61 +import org.netbeans.modules.xslt.core.xsltmap.AbstractTransformationUC;
39.62 +import org.netbeans.modules.xslt.core.xsltmap.FilterOneWayUC;
39.63 +import org.netbeans.modules.xslt.core.xsltmap.FilterRequestReplyUC;
39.64 import org.netbeans.modules.xslt.core.xsltmap.InputTransformationDesc;
39.65 +import org.netbeans.modules.xslt.core.xsltmap.OutputTransformationDesc;
39.66 import org.netbeans.modules.xslt.core.xsltmap.RequestReplyServiceUC;
39.67 import org.netbeans.modules.xslt.core.xsltmap.XsltMapModel;
39.68
39.69 -import static org.netbeans.modules.print.api.PrintUtil.*;
39.70 +import static org.netbeans.modules.print.api.PrintUI.*;
39.71
39.72 /**
39.73 * @author Vladimir Yaroslavskiy
39.74 @@ -68,59 +54,14 @@
39.75 return new Iterator();
39.76 }
39.77
39.78 -// private Template() {
39.79 -// }
39.80 -// todo r
39.81 -
39.82 -// protected Template (String [][] templates, String path, boolean isSetMain) {
39.83 -// myCreatedXsl = null;
39.84 -// myTemplates = templates;
39.85 -// myPath = path;
39.86 -// myIsSetMain = isSetMain;
39.87 -// }
39.88 -
39.89 /**{@inheritDoc}*/
39.90 public Set instantiate(TemplateWizard wizard) throws IOException {
39.91 -//todo r
39.92 -// FileObject targetDirectory = Templates.getTargetFolder(wizard);
39.93 -// String name = Templates.getTargetName(wizard);
39.94 -// String nameUTF8 = encodeUTF8 (Templates.getTargetName (wizard));
39.95 -// String pakage;
39.96 -// String packageAndNameUTF8;
39.97 -//Log.out ();
39.98 -//Log.out (" targetDirectory: " + targetDirectory.getPath ());
39.99 -//Log.out ("projectDirectory: " + projectDirectory.getPath ());
39.100 -//Log.out ("package: '" + myPackage + "'");
39.101 -
39.102 -// if (myPackage.equals ("")) { // NOI18N
39.103 -// pakage = ""; // NOI18N
39.104 -// packageAndNameUTF8 = nameUTF8;
39.105 -// }
39.106 -// else {
39.107 -// pakage = "package " + myPackage + ";"; // NOI18N
39.108 -// packageAndNameUTF8 = myPackageUTF8 + "." + nameUTF8; // NOI18N
39.109 -// }
39.110 -// String fullNameUTF8 = packageAndNameUTF8.replace (".", "/"); // NOI18N
39.111 -//
39.112 -// String [][] param = new String [][] {
39.113 -// {"__USER__", System.getProperty ("user.name")}, // NOI18N
39.114 -// {"__NAME__", name}, // NOI18N
39.115 -// {"__PACKAGE__", pakage}, // NOI18N
39.116 -// {"__NAME_UTF_8__", nameUTF8}, // NOI18N
39.117 -// {"__PACKAGE_AND_NAME_UTF_8__", packageAndNameUTF8}, // NOI18N
39.118 -// {"__FULL_NAME_UTF_8__", fullNameUTF8}, // NOI18N
39.119 -// };
39.120 -// addName (myTemplates, name);
39.121 -// unsetMainElement (project);
39.122 -//
39.123 return Collections.singleton(createFiles(wizard));
39.124 }
39.125
39.126 /**{@inheritDoc}*/
39.127 public void initialize(TemplateWizard wizard) {
39.128 -// myIndex = 0;
39.129 - Project project = Templates.getProject(wizard);
39.130 - createPanel(project);
39.131 + myPanel = new PanelStartup(Templates.getProject(wizard), null);
39.132 }
39.133
39.134 /**{@inheritDoc}*/
39.135 @@ -130,41 +71,32 @@
39.136
39.137 /**{@inheritDoc}*/
39.138 public String name() {
39.139 - return NbBundle.getMessage(
39.140 - Iterator.class, "LBL_x_of_y", // NOI18N
39.141 - new Integer(1/*myIndex + 1*/),
39.142 - new Integer(1/*myPanels.length)*/));
39.143 -// todo r
39.144 + return i18n(Iterator.class, "LBL_Title"); // NOI18N
39.145 }
39.146
39.147 /**{@inheritDoc}*/
39.148 public boolean hasNext() {
39.149 -// todo r
39.150 - return false;//myIndex < myPanels.length - 1;
39.151 + return myPanel.getNext() != null;
39.152 }
39.153
39.154 /**{@inheritDoc}*/
39.155 public boolean hasPrevious() {
39.156 -// todo r
39.157 - return false;//myIndex > 0;
39.158 + return myPanel.getPrevious() != null;
39.159 }
39.160
39.161 /**{@inheritDoc}*/
39.162 public void nextPanel() {
39.163 -// todo r
39.164 - //myIndex++;
39.165 + myPanel = myPanel.getNext();
39.166 }
39.167
39.168 /**{@inheritDoc}*/
39.169 public void previousPanel() {
39.170 -// todo r
39.171 - //myIndex--;
39.172 + myPanel = myPanel.getPrevious();
39.173 }
39.174
39.175 /**{@inheritDoc}*/
39.176 public WizardDescriptor.Panel current() {
39.177 -// todo r
39.178 - return myPanel;//s [myIndex];
39.179 + return myPanel;
39.180 }
39.181
39.182 /**{@inheritDoc}*/
39.183 @@ -173,27 +105,106 @@
39.184 /**{@inheritDoc}*/
39.185 public void removeChangeListener(ChangeListener listener) {}
39.186
39.187 - private void createPanel(Project project) {
39.188 -// todo r
39.189 - myPanel = //new WizardDescriptor.Panel [] {
39.190 - new Panel(project);
39.191 -// };
39.192 + private FileObject createFiles(TemplateWizard wizard) throws IOException {
39.193 + FileObject file = null;
39.194 + Project project = Templates.getProject(wizard);
39.195 + String choice = (String) wizard.getProperty(Panel.CHOICE);
39.196 + XsltMapModel model = XsltMapModel.getDefault(project);
39.197 + AbstractTransformationUC use = null;
39.198 +
39.199 + if (Panel.CHOICE_REQUEST_REPLY.equals(choice)) {
39.200 + use = createRequestReply(model, wizard);
39.201 + file = createXslFile(project, (String) wizard.getProperty(Panel.INPUT_FILE));
39.202 + }
39.203 + else if (Panel.CHOICE_FILTER_ONE_WAY.equals(choice)) {
39.204 + use = createFilterOneWay(model, wizard);
39.205 + file = createXslFile(project, (String) wizard.getProperty(Panel.INPUT_FILE));
39.206 + }
39.207 + else if (Panel.CHOICE_FILTER_REQUEST_REPLY.equals(choice)) {
39.208 + use = createFilterRequestReply(model, wizard);
39.209 + file = createXslFile(project, (String) wizard.getProperty(Panel.INPUT_FILE));
39.210 + file = createXslFile(project, (String) wizard.getProperty(Panel.OUTPUT_FILE));
39.211 + }
39.212 + model.addTransformationUC(use);
39.213 + model.sync();
39.214 +
39.215 + return file;
39.216 }
39.217 -
39.218 - private FileObject createFiles(TemplateWizard wizard) throws IOException {
39.219 - Project project = Templates.getProject(wizard);
39.220 - String file = (String) wizard.getProperty(Panel.FILE);
39.221 -// WSDLModel model = Util.getWSDLModel((FileObject) wizard.getProperty(Panel.WSDL));
39.222 - Operation operation = (Operation) wizard.getProperty(Panel.OPERATION);
39.223
39.224 - createXsltMap(project, file, operation);
39.225 -// updateWSDLModel(model, operation);//todo r
39.226 - return createXslFile(project, file);
39.227 + private AbstractTransformationUC createRequestReply(
39.228 + XsltMapModel model,
39.229 + TemplateWizard wizard)
39.230 + {
39.231 + AbstractTransformationUC use = new RequestReplyServiceUC(model);
39.232 + createDescription(new InputTransformationDesc(model, use), wizard, true);
39.233 + return use;
39.234 + }
39.235 +
39.236 + private AbstractTransformationUC createFilterOneWay(
39.237 + XsltMapModel model,
39.238 + TemplateWizard wizard)
39.239 + {
39.240 + AbstractTransformationUC use = new FilterOneWayUC(model);
39.241 + createDescription(new InputTransformationDesc(model, use), wizard, true);
39.242 + createDescription(new OutputTransformationDesc(model, use), wizard, false);
39.243 + return use;
39.244 + }
39.245 +
39.246 + private AbstractTransformationUC createFilterRequestReply(
39.247 + XsltMapModel model,
39.248 + TemplateWizard wizard)
39.249 + {
39.250 + AbstractTransformationUC use = new FilterRequestReplyUC(model);
39.251 + createDescription(new InputTransformationDesc(model, use), wizard, true);
39.252 + createDescription(new OutputTransformationDesc(model, use), wizard, false);
39.253 + return use;
39.254 + }
39.255 +
39.256 + private void createDescription(
39.257 + AbstractTransformationDesc description,
39.258 + TemplateWizard wizard,
39.259 + boolean isInput)
39.260 + {
39.261 + String file;
39.262 + Operation operation;
39.263 + Panel.PartnerRolePort partnerRolePort;
39.264 +
39.265 + if (isInput) {
39.266 + file = (String) wizard.getProperty(Panel.INPUT_FILE);
39.267 + operation = (Operation) wizard.getProperty(Panel.INPUT_OPERATION);
39.268 + partnerRolePort =
39.269 + (Panel.PartnerRolePort) wizard.getProperty(Panel.INPUT_PARTNER_ROLE_PORT);
39.270 + description.setTransformJBI(
39.271 + ((Boolean) wizard.getProperty(Panel.INPUT_TRANSFORM_JBI)).booleanValue());
39.272 + }
39.273 + else {
39.274 + file = (String) wizard.getProperty(Panel.OUTPUT_FILE);
39.275 + operation = (Operation) wizard.getProperty(Panel.OUTPUT_OPERATION);
39.276 + partnerRolePort =
39.277 + (Panel.PartnerRolePort) wizard.getProperty(Panel.OUTPUT_PARTNER_ROLE_PORT);
39.278 + description.setTransformJBI(
39.279 + ((Boolean) wizard.getProperty(Panel.OUTPUT_TRANSFORM_JBI)).booleanValue());
39.280 + }
39.281 + String namespace =
39.282 + "{" + operation.getModel().getDefinitions().getTargetNamespace()+"}"; // NOI18N
39.283 + description.setPartnerLink(
39.284 + namespace + partnerRolePort.getPartnerLinkType().getName());
39.285 + description.setRoleName(partnerRolePort.getRole().getName());
39.286 + description.setPortType(
39.287 + namespace + partnerRolePort.getPortType().getName());
39.288 +
39.289 + description.setOperation(operation.getName());
39.290 +
39.291 + Message message = operation.getOutput().getMessage().get();
39.292 + description.setMessageType(namespace + message.getName());
39.293 +
39.294 + description.setFile(file);
39.295 }
39.296
39.297 private FileObject createXslFile(Project project, String file) throws IOException {
39.298 String text =
39.299 - "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">" + LS + // NOI18N
39.300 + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform" + // NOI18N
39.301 + "\" version=\"1.0\">" + LS + // NOI18N
39.302 " <xsl:template match=\"/\">" + LS + // NOI18N
39.303 " </xsl:template>" + LS + // NOI18N
39.304 "</xsl:stylesheet>"; // NOI18N
39.305 @@ -201,32 +212,5 @@
39.306 return Util.createFile(Util.getSrcFolder(project), file, text);
39.307 }
39.308
39.309 - private void createXsltMap(
39.310 - Project project,
39.311 - String file,
39.312 - Operation operation) throws IOException
39.313 - {
39.314 - XsltMapModel model = XsltMapModel.getDefault(project);
39.315 - RequestReplyServiceUC use = new RequestReplyServiceUC();
39.316 - InputTransformationDesc description = new InputTransformationDesc(model, use);
39.317 -
39.318 - description.setPartnerLink(
39.319 - "{" + operation.getModel().getDefinitions().getTargetNamespace() + "}" + // NOI18N
39.320 - "PartnerLinkType"); // todo m
39.321 - description.setRoleName("Role"); // todo m
39.322 - description.setPortType(((PortType) operation.getParent()).getName());
39.323 - description.setOperation(operation.getName());
39.324 - description.setMessageType(
39.325 - "{" + operation.getModel().getDefinitions().getTargetNamespace() + "}" + // NOI18N
39.326 - operation.getOutput().getMessage().get().getName());//todo m {ns}
39.327 - description.setFile(file);
39.328 - description.setTransformJBI("no"); // NOI18N
39.329 -
39.330 - model.addTransformationUC(use);
39.331 - model.sync();
39.332 - }
39.333 -
39.334 -// todo r
39.335 -// private int myIndex;
39.336 - private WizardDescriptor.Panel myPanel;
39.337 + private Panel myPanel;
39.338 }
40.1 --- a/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/Panel.java Thu Feb 15 04:33:40 2007 +0000
40.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/Panel.java Mon Feb 19 13:24:25 2007 +0000
40.3 @@ -2,18 +2,18 @@
40.4 * The contents of this file are subject to the terms of the Common Development
40.5 * and Distribution License (the License). You may not use this file except in
40.6 * compliance with the License.
40.7 - *
40.8 + *
40.9 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
40.10 * or http://www.netbeans.org/cddl.txt.
40.11 - *
40.12 + *
40.13 * When distributing Covered Code, include this CDDL Header Notice in each file
40.14 * and include the License file at http://www.netbeans.org/cddl.txt.
40.15 * If applicable, add the following below the CDDL Header, with the fields
40.16 * enclosed by brackets [] replaced by your own identifying information:
40.17 * "Portions Copyrighted [year] [name of copyright owner]"
40.18 - *
40.19 + *
40.20 * The Original Software is NetBeans. The Initial Developer of the Original
40.21 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
40.22 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
40.23 * Microsystems, Inc. All Rights Reserved.
40.24 */
40.25 package org.netbeans.modules.xslt.project.wizard.element;
40.26 @@ -22,467 +22,170 @@
40.27 import java.awt.GridBagConstraints;
40.28 import java.awt.GridBagLayout;
40.29 import java.awt.Insets;
40.30 -import java.awt.event.ActionEvent;
40.31 -import java.awt.event.ActionListener;
40.32 -import java.util.ArrayList;
40.33 import java.util.Collection;
40.34 -import java.util.List;
40.35
40.36 -import javax.swing.AbstractAction;
40.37 import javax.swing.DefaultListCellRenderer;
40.38 -import javax.swing.JButton;
40.39 -import javax.swing.JComboBox;
40.40 -import javax.swing.JLabel;
40.41 import javax.swing.JList;
40.42 import javax.swing.JPanel;
40.43 -import javax.swing.JTextField;
40.44 import javax.swing.event.ChangeListener;
40.45
40.46 import org.openide.WizardDescriptor;
40.47 import org.openide.WizardValidationException;
40.48 import org.openide.filesystems.FileObject;
40.49 import org.openide.util.HelpCtx;
40.50 -import org.openide.util.NbBundle;
40.51
40.52 import org.netbeans.api.project.Project;
40.53 import org.netbeans.modules.xml.xam.dom.NamedComponentReference;
40.54 import org.netbeans.modules.xml.schema.model.GlobalElement;
40.55 import org.netbeans.modules.xml.schema.model.GlobalType;
40.56 -import org.netbeans.modules.xml.wsdl.model.Definitions;
40.57 import org.netbeans.modules.xml.wsdl.model.Message;
40.58 import org.netbeans.modules.xml.wsdl.model.Operation;
40.59 import org.netbeans.modules.xml.wsdl.model.OperationParameter;
40.60 import org.netbeans.modules.xml.wsdl.model.Part;
40.61 import org.netbeans.modules.xml.wsdl.model.PortType;
40.62 -import org.netbeans.modules.xml.wsdl.model.WSDLModel;
40.63 -import org.netbeans.modules.xml.wsdl.ui.view.ElementOrType;
40.64 -
40.65 -import static org.netbeans.modules.print.api.PrintUtil.*;
40.66 -import static org.netbeans.modules.print.api.PrintUtil.Dialog.*;
40.67 +import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PartnerLinkType;
40.68 +import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Role;
40.69
40.70 /**
40.71 * @author Vladimir Yaroslavskiy
40.72 * @version 2006.12.25
40.73 */
40.74 -final class Panel implements WizardDescriptor.ValidatingPanel/*, ChangeListener todo r */{
40.75 +abstract class Panel implements WizardDescriptor.ValidatingPanel {
40.76
40.77 - Panel(Project project) {
40.78 + Panel(Project project, Panel parent) {
40.79 myProject = project;
40.80 myFolder = Util.getSrcFolder(project);
40.81 + myParent = parent;
40.82 }
40.83 -
40.84 +
40.85 + protected final Project getProject() {
40.86 + return myProject;
40.87 + }
40.88 +
40.89 + protected final FileObject getFolder() {
40.90 + return myFolder;
40.91 + }
40.92 +
40.93 + protected final Panel getParent() {
40.94 + return myParent;
40.95 + }
40.96 +
40.97 + protected abstract void createPanel(JPanel panel, GridBagConstraints c);
40.98 + protected void setEnabled(boolean enabled) {}
40.99 + protected void update() {}
40.100 +
40.101 + protected String getComponentName() {
40.102 + return null;
40.103 + }
40.104 +
40.105 + protected Panel getNext() {
40.106 + return null;
40.107 + }
40.108 +
40.109 + protected Object getResult() {
40.110 + return null;
40.111 + }
40.112 +
40.113 + protected final Panel getPrevious() {
40.114 + return myParent;
40.115 + }
40.116 +
40.117 + protected String getError() {
40.118 + return null;
40.119 + }
40.120 +
40.121 + protected final String getError(String error1, String error2) {
40.122 + if (error1 != null) {
40.123 + return error1;
40.124 + }
40.125 + return error2;
40.126 + }
40.127 +
40.128 public JPanel getComponent() {
40.129 if (myComponent == null) {
40.130 - myComponent = createPanel();
40.131 + myComponent = createMainPanel();
40.132 + String name = getComponentName();
40.133 + myComponent.setName(name);
40.134 +
40.135 + String [] steps = new String [] {NAME_TYPE, NAME_WSDL, NAME_XSLT};
40.136 + myComponent.putClientProperty("WizardPanel_contentData", steps); // NOI18N
40.137 +
40.138 + for (int i=0; i < steps.length; i++) {
40.139 + if (name.equals(steps [i])) {
40.140 + myComponent.putClientProperty(
40.141 + "WizardPanel_contentSelectedIndex", new Integer(i - 1)); // NOI18N
40.142 + }
40.143 + }
40.144 }
40.145 return myComponent;
40.146 }
40.147 -
40.148 - /**
40.149 - * Is called when Next of Finish buttons are clicked and
40.150 - * allows deeper check to find out that panel is in valid
40.151 - * state and it is ok to leave it.
40.152 - *
40.153 - * @throws WizardValidationException when validation fails
40.154 - * @since 4.28
40.155 -// todo r
40.156 - */
40.157 - public void validate() throws WizardValidationException {
40.158 -// String errorMessage = validateBindingName();
40.159 -//
40.160 -// if (errorMessage != null) {
40.161 -// throw new WizardValidationException(component.getBindingNameComponent(), errorMessage, errorMessage);
40.162 -// }
40.163 -// errorMessage = validateOperations();
40.164 -// if (errorMessage != null) {
40.165 -// throw new WizardValidationException(component.getOperationsComponent(), errorMessage, errorMessage);
40.166 -// }
40.167 -// todo r
40.168 - FileObject file = myFolder.getFileObject(myFile.getText());
40.169
40.170 - if (file != null) {
40.171 - String name = file.getNameExt();
40.172 - String error = "File " + name + " already exists."; // NOI18N
40.173 - String message = NbBundle.getMessage(Panel.class,
40.174 - "ERR_File_Exists", name); // NOI18N
40.175 - throw new WizardValidationException(myComponent, error, message);
40.176 - }
40.177 - FileObject wsdl = getWSDLFile();
40.178 -
40.179 - if (wsdl == null) {
40.180 - String error = "Service is required."; // NOI18N
40.181 - String message = NbBundle.getMessage(Panel.class,
40.182 - "ERR_Service_Is_Required"); // NOI18N
40.183 - throw new WizardValidationException(myComponent, error, message);
40.184 - }
40.185 - Operation operation = getOperation();
40.186 -
40.187 - if (operation == null) {
40.188 - String error = "Operation is required."; // NOI18N
40.189 - String message = NbBundle.getMessage(Panel.class,
40.190 - "ERR_Operation_Is_Required"); // NOI18N
40.191 - throw new WizardValidationException(myComponent, error, message);
40.192 - }
40.193 - if (operation.getInput() == null) {
40.194 - String error = "Operation with input is required."; // NOI18N
40.195 - String message = NbBundle.getMessage(Panel.class,
40.196 - "ERR_Operation_With_Input_Is_Required"); // NOI18N
40.197 - throw new WizardValidationException(myComponent, error, message);
40.198 - }
40.199 - if (operation.getInput().getMessage() == null) {
40.200 - String error = "Operation with input is required."; // NOI18N
40.201 - String message = NbBundle.getMessage(Panel.class,
40.202 - "ERR_Operation_With_Input_Message_Is_Required"); // NOI18N
40.203 - throw new WizardValidationException(myComponent, error, message);
40.204 - }
40.205 - if (operation.getOutput() == null) {
40.206 - String error = "Operation with output is required."; // NOI18N
40.207 - String message = NbBundle.getMessage(Panel.class,
40.208 - "ERR_Operation_With_Output_Is_Required"); // NOI18N
40.209 - throw new WizardValidationException(myComponent, error, message);
40.210 - }
40.211 - if (operation.getOutput().getMessage() == null) {
40.212 - String error = "Operation with output is required."; // NOI18N
40.213 - String message = NbBundle.getMessage(Panel.class,
40.214 - "ERR_Operation_With_Output_Message_Is_Required"); // NOI18N
40.215 - throw new WizardValidationException(myComponent, error, message);
40.216 - }
40.217 - }
40.218 -
40.219 -//todo r
40.220 - /**
40.221 - * Test whether the panel is finished and it is safe to proceed to the next one.
40.222 - * If the panel is valid, the "Next" (or "Finish") button will be enabled.
40.223 - * <p><strong>Tip:</strong> if your panel is actually the component itself
40.224 - * (so {@link #getComponent} returns <code>this</code>), be sure to specifically
40.225 - * override this method, as the unrelated implementation in {@link java.awt.Component#isValid}
40.226 - * if not overridden could cause your wizard to behave erratically.
40.227 - * @return <code>true</code> if the user has entered satisfactory information
40.228 - * todo r
40.229 - */
40.230 - public boolean isValid() {
40.231 - return true;
40.232 -// // If it is always OK to press Next or Finish, then:
40.233 -// String errorMessage = getAnyErrors();
40.234 -// myWizard.putProperty("WizardPanel_errorMessage", errorMessage); // NOI18N
40.235 -// return errorMessage == null;
40.236 -// // If it depends on some condition (form filled out...), then:
40.237 -// // return someCondition();
40.238 -// // and when this condition changes (last form field filled in...) then:
40.239 -// // fireChangeEvent();
40.240 -// // and uncomment the complicated stuff below.
40.241 - }
40.242 -
40.243 -// public void stateChanged(ChangeEvent event) {
40.244 -// isValid();
40.245 -// }
40.246 -// todo r
40.247 -
40.248 -// private String getAnyErrors() {
40.249 -// String errorMessage = null;
40.250 -//// errorMessage = validateOperations();
40.251 -//// errorMessage = validateBindingName();
40.252 -// return errorMessage;
40.253 -// }
40.254 -// todo r
40.255 -
40.256 - public HelpCtx getHelp() {
40.257 - return HelpCtx.DEFAULT_HELP;
40.258 - }
40.259 -
40.260 - public synchronized void addChangeListener(ChangeListener listener) {
40.261 -// listeners.add(listener);
40.262 -// todo r
40.263 - }
40.264 -
40.265 - public synchronized void removeChangeListener(ChangeListener listener) {
40.266 -// listeners.remove(listener);
40.267 -// todo r
40.268 - }
40.269 -
40.270 -/*
40.271 - protected void fireChangeEvent() {
40.272 -// todo r
40.273 - Iterator<ChangeListener> it;
40.274 -
40.275 - synchronized (listeners) {
40.276 - it = new HashSet<ChangeListener>(listeners).iterator();
40.277 - }
40.278 - ChangeEvent ev = new ChangeEvent(this);
40.279 - while (it.hasNext()) {
40.280 - it.next().stateChanged(ev);
40.281 - }
40.282 - }
40.283 -*/
40.284 - public void readSettings(Object settings) {
40.285 -// todo r
40.286 -// myWizard = (WizardDescriptor) settings;
40.287 - // WizardDescriptor.getProperty & putProperty to store information entered
40.288 - }
40.289 -
40.290 -// todo r
40.291 -// public void storeSettings(Object settings) {
40.292 -// if ( WizardDescriptor.PREVIOUS_OPTION.equals( ((WizardDescriptor)settings).getValue() ) ) {
40.293 -// return;
40.294 -// }
40.295 -// if (isValid()) {
40.296 -// ;
40.297 -// }
40.298 -// myComponent.storeValues((WizardDescriptor) settings);
40.299 -// }
40.300 -
40.301 - public void storeSettings(Object settings) {
40.302 - WizardDescriptor descriptor = (WizardDescriptor) settings;
40.303 - descriptor.putProperty(FILE, myFile.getText());
40.304 -// descriptor.putProperty(WSDL, getWSDLFile());
40.305 - descriptor.putProperty(OPERATION, getOperation());
40.306 - }
40.307 -
40.308 - private JPanel createPanel() {
40.309 - JPanel mainPanel = new JPanel(new GridBagLayout());
40.310 + private JPanel createMainPanel() {
40.311 JPanel panel = new JPanel(new GridBagLayout());
40.312 GridBagConstraints c = new GridBagConstraints();
40.313 - c.anchor = GridBagConstraints.WEST;
40.314 -
40.315 - createServicePanel(panel, c);
40.316 - createXmlPanel(panel, c);
40.317
40.318 c.weightx = 1.0;
40.319 c.weighty = 1.0;
40.320 c.insets = new Insets(0, 0, 0, 0);
40.321 c.anchor = GridBagConstraints.NORTHWEST;
40.322 c.fill = GridBagConstraints.HORIZONTAL;
40.323 - mainPanel.add(panel, c);
40.324 -
40.325 -// panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.yellow));
40.326 -// mainPanel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.red));
40.327 - return mainPanel;
40.328 + createPanel(panel, c);
40.329 +
40.330 +// panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.red));
40.331 + return panel;
40.332 }
40.333
40.334 - private void createServicePanel(JPanel panel, GridBagConstraints c) {
40.335 - JButton button;
40.336 - JLabel label;
40.337 + public void validate() throws WizardValidationException {
40.338 + String error = getError();
40.339
40.340 - // file name
40.341 - c.gridy++;
40.342 - c.weightx = 0.0;
40.343 - c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
40.344 - label = createLabel(getClass(), "LBL_File"); // NOI18N
40.345 - panel.add(label, c);
40.346 -
40.347 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.348 - c.fill = GridBagConstraints.HORIZONTAL;
40.349 - c.weightx = 1.0;
40.350 - myFile = new JTextField(getFileName());
40.351 - label.setLabelFor(myFile);
40.352 - panel.add(myFile, c);
40.353 -
40.354 - // service
40.355 - c.gridy++;
40.356 - c.weightx = 0.0;
40.357 - c.fill = GridBagConstraints.NONE;
40.358 - c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
40.359 - label = createLabel(getClass(), "LBL_Service"); // NOI18N
40.360 - panel.add(label, c);
40.361 -
40.362 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.363 - c.fill = GridBagConstraints.HORIZONTAL;
40.364 - c.weightx = 1.0;
40.365 - myService = new JComboBox();
40.366 - updateWSDLFiles(null);
40.367 - myService.setRenderer(new Renderer());
40.368 - myService.addActionListener(
40.369 - new ActionListener() {
40.370 - public void actionPerformed(ActionEvent event) {
40.371 - updateOperations(null);
40.372 - }
40.373 - }
40.374 - );
40.375 - label.setLabelFor(myService);
40.376 - panel.add(myService, c);
40.377 -
40.378 - c.weightx = 0.0;
40.379 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.380 - button = createButton(
40.381 - "TLT_Create_WSDL", // NOI18N
40.382 - getClass(),
40.383 - new AbstractAction(getMessage(getClass(), "LBL_Create_WSDL")) { // NOI18N
40.384 - public void actionPerformed(ActionEvent event) {
40.385 - createWSDL();
40.386 - }
40.387 - }
40.388 - );
40.389 - panel.add(button, c);
40.390 -
40.391 - // operation
40.392 - c.gridy++;
40.393 - c.weightx = 0.0;
40.394 - c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
40.395 - label = createLabel(getClass(), "LBL_Operation"); // NOI18N
40.396 - panel.add(label, c);
40.397 -
40.398 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.399 - c.fill = GridBagConstraints.HORIZONTAL;
40.400 - c.weightx = 1.0;
40.401 - myOperation = new JComboBox();
40.402 - updateOperations(null);
40.403 - myOperation.setRenderer(new Renderer());
40.404 - myOperation.addActionListener(
40.405 - new ActionListener() {
40.406 - public void actionPerformed(ActionEvent event) {
40.407 - updateTypes();
40.408 - }
40.409 - }
40.410 - );
40.411 - label.setLabelFor(myOperation);
40.412 - panel.add(myOperation, c);
40.413 -
40.414 - c.weightx = 0.0;
40.415 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.416 - button = createButton(
40.417 - "TLT_Create_Operation", // NOI18N
40.418 - getClass(),
40.419 - new AbstractAction(getMessage(getClass(), "LBL_Create_Operation")) { // NOI18N
40.420 - public void actionPerformed(ActionEvent event) {
40.421 - createOperation();
40.422 - }
40.423 - }
40.424 - );
40.425 - panel.add(button, c);
40.426 - }
40.427 -
40.428 - private void createOperation() {
40.429 - WSDLModel model = Util.getWSDLModel(getWSDLFile());
40.430 -
40.431 - if (model == null) {
40.432 - printError(getClass(), "ERR_Set_Service"); // NOI18N
40.433 - }
40.434 - else {
40.435 - new Operattio(model, myProject, this).show();
40.436 + if (error != null) {
40.437 + throw new WizardValidationException(myComponent, error, error);
40.438 }
40.439 }
40.440
40.441 - private Operation [] getOperations(WSDLModel model) {
40.442 - List<Operation> operations = new ArrayList<Operation>();
40.443 -
40.444 - if (model == null) {
40.445 - return operations.toArray(new Operation[operations.size()]);
40.446 - }
40.447 - Collection<PortType> portTypes = model.getDefinitions().getPortTypes();
40.448 -
40.449 - for (PortType portType : portTypes) {
40.450 - Collection<Operation> ops = portType.getOperations();
40.451 -
40.452 - for (Operation operation : ops) {
40.453 - operations.add(operation);
40.454 - }
40.455 - }
40.456 - return operations.toArray(new Operation[operations.size()]);
40.457 + protected final String i18n(String key) {
40.458 + return org.netbeans.modules.print.api.PrintUI.i18n(Panel.class, key);
40.459 }
40.460
40.461 - void updateWSDLFiles(FileObject item) {
40.462 - myService.removeAllItems();
40.463 - FileObject [] files = Util.getWSDLFiles(myProject);
40.464 + protected final String i18n(String key, String param) {
40.465 + return org.netbeans.modules.print.api.PrintUI.i18n(Panel.class, key, param);
40.466 + }
40.467
40.468 - for (FileObject file : files) {
40.469 - myService.addItem(file);
40.470 - }
40.471 - if (item != null) {
40.472 - myService.setSelectedItem(item);
40.473 + protected final String i18n(String key, String param1, String param2) {
40.474 + return org.netbeans.modules.print.api.PrintUI.i18n(
40.475 + Panel.class, key, param1, param2);
40.476 + }
40.477 +
40.478 + public boolean isValid() {
40.479 + return true;
40.480 + }
40.481 +
40.482 + public HelpCtx getHelp() {
40.483 + return HelpCtx.DEFAULT_HELP;
40.484 + }
40.485 +
40.486 + public void storeSettings(Object object) {}
40.487 +
40.488 + public void addChangeListener(ChangeListener listener) {}
40.489 + public void removeChangeListener(ChangeListener listener) {}
40.490 + public void readSettings(Object object) {}
40.491 +
40.492 + protected final int getXslFileNumber(int start) {
40.493 + int count = start;
40.494 +
40.495 + while (true) {
40.496 + if (getFolder().getFileObject(NAME + count, EXT) == null) {
40.497 + return count;
40.498 + }
40.499 + count++;
40.500 }
40.501 }
40.502
40.503 - protected void updateOperations(Operation current) {
40.504 - myOperation.removeAllItems();
40.505 - Operation [] operations = getOperations(Util.getWSDLModel(getWSDLFile()));
40.506 -
40.507 - for (Operation operation : operations) {
40.508 - myOperation.addItem(operation);
40.509 - }
40.510 - if (current != null) {
40.511 - myOperation.setSelectedItem(current);
40.512 - }
40.513 + protected final String getXslFileName(int number) {
40.514 + return NAME + number + DOT + EXT;
40.515 }
40.516
40.517 - private void createXmlPanel(JPanel panel, GridBagConstraints c) {
40.518 - JButton button;
40.519 - JLabel label;
40.520 -
40.521 - // input type
40.522 - c.gridy++;
40.523 - c.weightx = 0.0;
40.524 - c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
40.525 - label = createLabel(getClass(), "LBL_Input_Type"); // NOI18N
40.526 - panel.add(label, c);
40.527 -
40.528 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.529 - c.fill = GridBagConstraints.HORIZONTAL;
40.530 - c.weightx = 1.0;
40.531 - myInput = new JTextField();
40.532 - myInput.setEnabled(false);
40.533 - label.setLabelFor(myInput);
40.534 - panel.add(myInput, c);
40.535 -
40.536 -//todo r
40.537 -// c.weightx = 0.0;
40.538 -// c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.539 -// button = createButton(
40.540 -// "TLT_Browse_Input_Type", // NOI18N
40.541 -// getClass(),
40.542 -// new AbstractAction(getMessage(getClass(), "LBL_Browse_Input_Type")) { // NOI18N
40.543 -// public void actionPerformed(ActionEvent event) {
40.544 -//// browseType(true);
40.545 -// }
40.546 -// }
40.547 -// );
40.548 -// // todo a? setEnabled if wsdl is selected
40.549 -//// panel.add(button, c);
40.550 -
40.551 - // output type
40.552 - c.gridy++;
40.553 - c.weightx = 0.0;
40.554 - c.weighty = 1.0;
40.555 - c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
40.556 - label = createLabel(getClass(), "LBL_Output_Type"); // NOI18N
40.557 - panel.add(label, c);
40.558 -
40.559 - c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.560 - c.fill = GridBagConstraints.HORIZONTAL;
40.561 - myOutput = new JTextField();
40.562 - myOutput.setEnabled(false);
40.563 - label.setLabelFor(myOutput);
40.564 - panel.add(myOutput, c);
40.565 -
40.566 - updateTypes();
40.567 -
40.568 - //todo r
40.569 -// c.weightx = 0.0;
40.570 -// c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
40.571 -// button = createButton(
40.572 -// "TLT_Browse_Output_Type", // NOI18N
40.573 -// getClass(),
40.574 -// new AbstractAction(getMessage(getClass(), "LBL_Browse_Output_Type")) { // NOI18N
40.575 -// public void actionPerformed(ActionEvent event) {
40.576 -//// browseType(false);
40.577 -// }
40.578 -// }
40.579 -// );
40.580 -//// panel.add(button, c);
40.581 - }
40.582 -
40.583 - private void updateTypes() {
40.584 - Operation operation = getOperation();
40.585 -
40.586 - if (operation == null) {
40.587 - myInput.setText(EMPTY);
40.588 - myOutput.setText(EMPTY);
40.589 - return;
40.590 - }
40.591 - myInput.setText(getType(operation.getInput()));
40.592 - myOutput.setText(getType(operation.getOutput()));
40.593 - }
40.594 -
40.595 - private String getType(OperationParameter parameter) {
40.596 + protected final String getType(OperationParameter parameter) {
40.597 if (parameter == null) {
40.598 //out("1");
40.599 return EMPTY;
40.600 @@ -511,7 +214,10 @@
40.601 //out("5");
40.602 return EMPTY;
40.603 }
40.604 - Part part = iterator.next();
40.605 + return getType(iterator.next());
40.606 + }
40.607 +
40.608 + private String getType(Part part) {
40.609 NamedComponentReference<GlobalType> refType = part.getType();
40.610
40.611 if (refType != null) {
40.612 @@ -533,35 +239,8 @@
40.613 return EMPTY;
40.614 }
40.615
40.616 - private FileObject getWSDLFile() {
40.617 - return (FileObject) myService.getSelectedItem();
40.618 - }
40.619 -
40.620 - private Operation getOperation() {
40.621 - return (Operation) myOperation.getSelectedItem();
40.622 - }
40.623 -
40.624 - private String getFileName() {
40.625 - FileObject file = myFolder.getFileObject(NAME, EXT);
40.626 - int count = 1;
40.627 -
40.628 - while (file != null) {
40.629 - file = myFolder.getFileObject(NAME + (count++), EXT);
40.630 - }
40.631 - count--;
40.632 -
40.633 - if (count == 0) {
40.634 - return NAME + DOT + EXT;
40.635 - }
40.636 - return NAME + count + DOT + EXT;
40.637 - }
40.638 -
40.639 - private void createWSDL() {
40.640 - new WSDL(myFolder, this).show();
40.641 - }
40.642 -
40.643 - // -----------------------------------------------------
40.644 - private class Renderer extends DefaultListCellRenderer {
40.645 + // -------------------------------------------------------
40.646 + protected class Renderer extends DefaultListCellRenderer {
40.647
40.648 public Component getListCellRendererComponent(
40.649 JList list, Object value, int index,
40.650 @@ -570,42 +249,118 @@
40.651 super.getListCellRendererComponent(list, value, index, isSelected, hasFocus);
40.652
40.653 if (value instanceof FileObject) {
40.654 - setText(Util.calculateRelativeName((FileObject) value, myProject));
40.655 + setText(Util.calculateRelativeName((FileObject) value, getProject()));
40.656 }
40.657 if (value instanceof Operation) {
40.658 - Operation operation = (Operation) value;
40.659 - PortType portType = (PortType) operation.getParent();
40.660 - setText(portType.getName() + "/" + operation.getName()); // NOI18N
40.661 + setText(((Operation) value).getName());
40.662 + }
40.663 + if (value instanceof PartnerRolePort) {
40.664 + setText(((PartnerRolePort) value).getName());
40.665 }
40.666 return this;
40.667 }
40.668 }
40.669
40.670 - private JTextField myFile;
40.671 - private JComboBox myService;
40.672 - private JComboBox myOperation;
40.673 - private JTextField myInput;
40.674 - private JTextField myOutput;
40.675 + // ----------------------------------
40.676 + public static class PartnerRolePort {
40.677 + public PartnerRolePort(
40.678 + PartnerLinkType partnerLinkType,
40.679 + Role role,
40.680 + PortType portType)
40.681 + {
40.682 + myPartnerLinkType = partnerLinkType;
40.683 + myRole = role;
40.684 + myPortType = portType;
40.685 + }
40.686 +
40.687 + public PartnerLinkType getPartnerLinkType() {
40.688 + return myPartnerLinkType;
40.689 + }
40.690 +
40.691 + public Role getRole() {
40.692 + return myRole;
40.693 + }
40.694 +
40.695 + public PortType getPortType() {
40.696 + return myPortType;
40.697 + }
40.698 +
40.699 + public String getName() {
40.700 + return
40.701 + myPortType.getName() + " (" + // NOI18N
40.702 + myPartnerLinkType.getName() + "/" + // NOI18N
40.703 + myRole.getName() + ")"; // NOI18N
40.704 + }
40.705 +
40.706 + /**{@inheritDoc}*/
40.707 + @Override
40.708 + public boolean equals(Object object)
40.709 + {
40.710 + if ( !(object instanceof PartnerRolePort)) {
40.711 + return false;
40.712 + }
40.713 + PartnerRolePort partnerRolePort = (PartnerRolePort) object;
40.714 +
40.715 + return
40.716 + partnerRolePort.getPartnerLinkType().equals(getPartnerLinkType()) &&
40.717 + partnerRolePort.getRole().equals(getRole()) &&
40.718 + partnerRolePort.getPortType().equals(getPortType());
40.719 + }
40.720 +
40.721 + /**{@inheritDoc}*/
40.722 + @Override
40.723 + public int hashCode()
40.724 + {
40.725 + return
40.726 + getPartnerLinkType().hashCode() *
40.727 + getRole().hashCode() *
40.728 + getPortType().hashCode();
40.729 + }
40.730 +
40.731 + private Role myRole;
40.732 + private PortType myPortType;
40.733 + private PartnerLinkType myPartnerLinkType;
40.734 + }
40.735
40.736 private Project myProject;
40.737 private JPanel myComponent;
40.738 private FileObject myFolder;
40.739 -
40.740 -// private WizardDescriptor myWizard;
40.741 -// private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
40.742 -// todo r
40.743 -// private PortType mPortType = null;
40.744 -// private WSDLExtensibilityElements mElements;
40.745 -
40.746 - public static final String FILE = "file"; // NOI18N
40.747 -// public static final String WSDL = "wsdl"; // NOI18N
40.748 - public static final String OPERATION = "operation"; // NOI18N
40.749 -// public static final String INPUT = "input"; // NOI18N
40.750 -// public static final String OUTPUT = "output"; // NOI18N
40.751 + private Panel myParent;
40.752
40.753 private static final String NAME = "xsl"; // NOI18N
40.754 private static final String EXT = "xsl"; // NOI18N
40.755 private static final String DOT = "."; // NOI18N
40.756
40.757 - private static final String EMPTY = ""; // NOI18N
40.758 + protected static final String EMPTY = ""; // NOI18N
40.759 +
40.760 + protected static final String NAME_TYPE =
40.761 + org.netbeans.modules.print.api.PrintUI.i18n(Panel.class,
40.762 + "LBL_Service_Type"); // NOI18N
40.763 +
40.764 + protected static final String NAME_WSDL =
40.765 + org.netbeans.modules.print.api.PrintUI.i18n(Panel.class,
40.766 + "LBL_WSDL_File"); // NOI18N
40.767 +
40.768 + protected static final String NAME_XSLT =
40.769 + org.netbeans.modules.print.api.PrintUI.i18n(Panel.class,
40.770 + "LBL_XSLT_Configuration"); // NOI18N
40.771 +
40.772 + public static final String INPUT_FILE = "input.file"; // NOI18N
40.773 + public static final String INPUT_OPERATION = "input.operation"; // NOI18N
40.774 + public static final String INPUT_PARTNER_ROLE_PORT =
40.775 + "input.partner.role.port"; // NOI18N
40.776 + public static final String INPUT_TRANSFORM_JBI = "input.transform.jbi"; // NOI18N
40.777 +
40.778 + public static final String OUTPUT_FILE = "output.file"; // NOI18N
40.779 + public static final String OUTPUT_OPERATION = "output.operation"; // NOI18N
40.780 + public static final String OUTPUT_PARTNER_ROLE_PORT =
40.781 + "output.partner.role.port"; // NOI18N
40.782 + public static final String OUTPUT_TRANSFORM_JBI = "output.transform.jbi"; // NOI18N
40.783 +
40.784 + public static final String CHOICE = "choice"; // NOI18N
40.785 + public static final String CHOICE_REQUEST_REPLY = "choice.request.reply"; // NOI18N
40.786 + public static final String CHOICE_FILTER_ONE_WAY =
40.787 + "choice.filter.one.way"; // NOI18N
40.788 + public static final String CHOICE_FILTER_REQUEST_REPLY =
40.789 + "choice.filter.request.reply"; // NOI18N
40.790 }
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
41.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/PanelOperation.java Mon Feb 19 13:24:25 2007 +0000
41.3 @@ -0,0 +1,657 @@
41.4 +/*
41.5 + * The contents of this file are subject to the terms of the Common Development
41.6 + * and Distribution License (the License). You may not use this file except in
41.7 + * compliance with the License.
41.8 + *
41.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
41.10 + * or http://www.netbeans.org/cddl.txt.
41.11 + *
41.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
41.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
41.14 + * If applicable, add the following below the CDDL Header, with the fields
41.15 + * enclosed by brackets [] replaced by your own identifying information:
41.16 + * "Portions Copyrighted [year] [name of copyright owner]"
41.17 + *
41.18 + * The Original Software is NetBeans. The Initial Developer of the Original
41.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
41.20 + * Microsystems, Inc. All Rights Reserved.
41.21 + */
41.22 +package org.netbeans.modules.xslt.project.wizard.element;
41.23 +
41.24 +import java.awt.GridBagConstraints;
41.25 +import java.awt.GridBagLayout;
41.26 +import java.awt.Insets;
41.27 +import java.awt.event.ActionEvent;
41.28 +import java.awt.event.ActionListener;
41.29 +import java.util.ArrayList;
41.30 +import java.util.Collection;
41.31 +import java.util.List;
41.32 +import java.util.Map;
41.33 +
41.34 +import javax.swing.AbstractAction;
41.35 +import javax.swing.JButton;
41.36 +import javax.swing.JCheckBox;
41.37 +import javax.swing.JComboBox;
41.38 +import javax.swing.JLabel;
41.39 +import javax.swing.JPanel;
41.40 +import javax.swing.JTextField;
41.41 +
41.42 +import org.openide.WizardDescriptor;
41.43 +import org.openide.filesystems.FileObject;
41.44 +
41.45 +import org.netbeans.api.project.Project;
41.46 +import org.netbeans.modules.xml.xam.dom.AbstractDocumentComponent;
41.47 +import org.netbeans.modules.xml.xam.dom.NamedComponentReference;
41.48 +import org.netbeans.modules.xml.schema.model.Import;
41.49 +import org.netbeans.modules.xml.schema.model.GlobalElement;
41.50 +import org.netbeans.modules.xml.schema.model.GlobalType;
41.51 +import org.netbeans.modules.xml.schema.model.Schema;
41.52 +import org.netbeans.modules.xml.schema.model.SchemaComponent;
41.53 +import org.netbeans.modules.xml.schema.model.SchemaModel;
41.54 +
41.55 +import org.netbeans.modules.xml.wsdl.model.Definitions;
41.56 +import org.netbeans.modules.xml.wsdl.model.ExtensibilityElement;
41.57 +import org.netbeans.modules.xml.wsdl.model.Input;
41.58 +import org.netbeans.modules.xml.wsdl.model.Message;
41.59 +import org.netbeans.modules.xml.wsdl.model.Operation;
41.60 +import org.netbeans.modules.xml.wsdl.model.OperationParameter;
41.61 +import org.netbeans.modules.xml.wsdl.model.Output;
41.62 +import org.netbeans.modules.xml.wsdl.model.Part;
41.63 +import org.netbeans.modules.xml.wsdl.model.PortType;
41.64 +import org.netbeans.modules.xml.wsdl.model.Types;
41.65 +import org.netbeans.modules.xml.wsdl.model.WSDLComponentFactory;
41.66 +import org.netbeans.modules.xml.wsdl.model.WSDLModel;
41.67 +import org.netbeans.modules.xml.wsdl.model.extensions.bpel.PartnerLinkType;
41.68 +import org.netbeans.modules.xml.wsdl.model.extensions.bpel.Role;
41.69 +import org.netbeans.modules.xml.wsdl.model.extensions.xsd.WSDLSchema;
41.70 +import org.netbeans.modules.xml.wsdl.ui.view.ElementOrType;
41.71 +
41.72 +import static org.netbeans.modules.print.api.PrintUI.*;
41.73 +
41.74 +/**
41.75 + * @author Vladimir Yaroslavskiy
41.76 + * @version 2007.02.02
41.77 + */
41.78 +final class PanelOperation extends Panel {
41.79 +
41.80 + PanelOperation(
41.81 + Project project,
41.82 + Panel parent,
41.83 + WSDLModel model,
41.84 + String fileName,
41.85 + boolean isReadOnly,
41.86 + boolean isInput)
41.87 + {
41.88 + super(project, parent);
41.89 + myModel = model;
41.90 + myFileName = fileName;
41.91 + myIsReadOnly = isReadOnly;
41.92 + myIsInput = isInput;
41.93 + myIsInputRequired = true;
41.94 + myIsOutputRequired = true;
41.95 + }
41.96 +
41.97 + @Override
41.98 + protected Object getResult()
41.99 + {
41.100 + return getOperation();
41.101 + }
41.102 +
41.103 + @Override
41.104 + protected String getError()
41.105 + {
41.106 + String name = myFile.getText();
41.107 + FileObject file = getFolder().getFileObject(name);
41.108 +
41.109 + if (file != null) {
41.110 + return i18n("ERR_File_Already_Exists", name); // NOI18N
41.111 + }
41.112 + Operation operation = getOperation();
41.113 +
41.114 + if (operation == null) {
41.115 + return i18n("ERR_Operation_Is_Required"); // NOI18N
41.116 + }
41.117 + if (myIsInputRequired) {
41.118 + if ( !check(operation.getInput())) {
41.119 + return i18n("ERR_Operation_With_Input_Is_Required"); // NOI18N
41.120 + }
41.121 + }
41.122 + if (myIsOutputRequired) {
41.123 + if ( !check(operation.getOutput())) {
41.124 + return i18n("ERR_Operation_With_Output_Is_Required"); // NOI18N
41.125 + }
41.126 + }
41.127 + return null;
41.128 + }
41.129 +
41.130 + private boolean check(OperationParameter parameter) {
41.131 + return
41.132 + parameter != null &&
41.133 + parameter.getMessage() != null &&
41.134 + parameter.getMessage().get() != null;
41.135 + }
41.136 +
41.137 + public void storeSettings(Object object) {
41.138 + WizardDescriptor descriptor = (WizardDescriptor) object;
41.139 +
41.140 + if (myIsInput) {
41.141 + descriptor.putProperty(INPUT_FILE, myFile.getText());
41.142 + descriptor.putProperty(INPUT_OPERATION, getOperation());
41.143 + descriptor.putProperty(INPUT_PARTNER_ROLE_PORT, getPartnerRolePort());
41.144 + descriptor.putProperty(
41.145 + INPUT_TRANSFORM_JBI, new Boolean(myTransformJBI.isSelected()));
41.146 + }
41.147 + else {
41.148 + descriptor.putProperty(OUTPUT_FILE, myFile.getText());
41.149 + descriptor.putProperty(OUTPUT_OPERATION, getOperation());
41.150 + descriptor.putProperty(OUTPUT_PARTNER_ROLE_PORT, getPartnerRolePort());
41.151 + descriptor.putProperty(
41.152 + OUTPUT_TRANSFORM_JBI, new Boolean(myTransformJBI.isSelected()));
41.153 + }
41.154 + }
41.155 +
41.156 + void setRequirement(boolean isInputRequired, boolean isOutputRequired) {
41.157 + myIsInputRequired = isInputRequired;
41.158 + myIsOutputRequired = isOutputRequired;
41.159 + }
41.160 +
41.161 + @Override
41.162 + protected void createPanel(JPanel mainPanel, GridBagConstraints cc)
41.163 + {
41.164 + JPanel panel = new JPanel(new GridBagLayout());
41.165 + GridBagConstraints c = new GridBagConstraints();
41.166 + c.anchor = GridBagConstraints.WEST;
41.167 + JButton button;
41.168 + JLabel label;
41.169 +
41.170 + // file
41.171 + createFilePanel(panel, c);
41.172 +
41.173 + // operation
41.174 + c.gridy++;
41.175 + c.weightx = 0.0;
41.176 + c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
41.177 + label = createLabel(i18n("LBL_Operation")); // NOI18N
41.178 + panel.add(label, c);
41.179 +
41.180 + c.weightx = 1.0;
41.181 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.182 + myOperation = new JComboBox();
41.183 + myOperation.setRenderer(new Renderer());
41.184 + myOperation.addActionListener(
41.185 + new ActionListener() {
41.186 + public void actionPerformed(ActionEvent event) {
41.187 + updateTypes();
41.188 + }
41.189 + }
41.190 + );
41.191 + label.setLabelFor(myOperation);
41.192 + panel.add(myOperation, c);
41.193 +
41.194 + // [create]
41.195 + if ( !myIsReadOnly) {
41.196 + c.weightx = 0.0;
41.197 + button = createButton(
41.198 + i18n("TLT_Create_Operation"), // NOI18N
41.199 + new AbstractAction(i18n("LBL_Create_Operation")) { // NOI18N
41.200 + public void actionPerformed(ActionEvent event) {
41.201 + new DialogOperation(
41.202 + myModel, PanelOperation.this, getPartnerRolePort()).show();
41.203 + }
41.204 + }
41.205 + );
41.206 +// panel.add(button, c);
41.207 +
41.208 + // type
41.209 + createTypePanel(panel, c);
41.210 + }
41.211 +
41.212 + // transform JBI
41.213 + c.gridy++;
41.214 + c.weightx = 0.0;
41.215 + c.weighty = 1.0;
41.216 + c.insets = new Insets(0, 0, 0, 0);
41.217 + myTransformJBI = createCheckBox(
41.218 + i18n("LBL_Transform_JBI"), // NOI18N
41.219 + new AbstractAction(i18n("LBL_Transform_JBI")) { // NOI18N
41.220 + public void actionPerformed(ActionEvent event) {}
41.221 + }
41.222 + );
41.223 + panel.add(myTransformJBI, c);
41.224 +
41.225 + updatePartnerRolePorts(null);
41.226 + mainPanel.add(panel, cc);
41.227 + }
41.228 +
41.229 + private void createFilePanel(JPanel panel, GridBagConstraints c) {
41.230 + JLabel label;
41.231 +
41.232 + // xsl file
41.233 + c.gridy++;
41.234 + c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
41.235 + label = createLabel(i18n("LBL_XSL_File")); // NOI18N
41.236 + panel.add(label, c);
41.237 +
41.238 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.239 + c.fill = GridBagConstraints.HORIZONTAL;
41.240 + c.weightx = 1.0;
41.241 + myFile = new JTextField(myFileName);
41.242 + label.setLabelFor(myFile);
41.243 + panel.add(myFile, c);
41.244 +
41.245 + // Partner/Role/Port
41.246 + c.gridy++;
41.247 + c.weightx = 0.0;
41.248 + c.fill = GridBagConstraints.NONE;
41.249 + c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
41.250 + label = createLabel(i18n("LBL_Partner_Role_Port")); // NOI18N
41.251 + panel.add(label, c);
41.252 +
41.253 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.254 + c.fill = GridBagConstraints.HORIZONTAL;
41.255 + c.weightx = 1.0;
41.256 + myPartnerRolePort = new JComboBox();
41.257 + myPartnerRolePort.setRenderer(new Renderer());
41.258 + myPartnerRolePort.addActionListener(
41.259 + new ActionListener() {
41.260 + public void actionPerformed(ActionEvent event) {
41.261 + update();
41.262 + }
41.263 + }
41.264 + );
41.265 + label.setLabelFor(myPartnerRolePort);
41.266 + panel.add(myPartnerRolePort, c);
41.267 + }
41.268 +
41.269 + private void createTypePanel(JPanel panel, GridBagConstraints c) {
41.270 + JLabel label;
41.271 +
41.272 + // input type
41.273 + c.gridy++;
41.274 + c.weightx = 0.0;
41.275 + c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
41.276 + label = createLabel(i18n("LBL_Input_Type")); // NOI18N
41.277 + panel.add(label, c);
41.278 +
41.279 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.280 + c.fill = GridBagConstraints.HORIZONTAL;
41.281 + c.weightx = 1.0;
41.282 + myInput = new JTextField();
41.283 + myInput.setEditable(false);
41.284 + label.setLabelFor(myInput);
41.285 + panel.add(myInput, c);
41.286 +
41.287 + // [choose]
41.288 + c.weightx = 0.0;
41.289 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.290 + myInputChoose = createButton(
41.291 + i18n("TLT_Choose_Input_Type"), // NOI18N
41.292 + new AbstractAction(i18n("LBL_Choose_Input_Type")) { // NOI18N
41.293 + public void actionPerformed(ActionEvent event) {
41.294 + new DialogType(getProject(), myModel, PanelOperation.this, true).show();
41.295 + }
41.296 + }
41.297 + );
41.298 +// panel.add(myInputChoose, c);
41.299 +
41.300 + // output type
41.301 + c.gridy++;
41.302 + c.weightx = 0.0;
41.303 + c.weighty = 1.0;
41.304 + c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
41.305 + label = createLabel(i18n("LBL_Output_Type")); // NOI18N
41.306 + panel.add(label, c);
41.307 +
41.308 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.309 + c.fill = GridBagConstraints.HORIZONTAL;
41.310 + myOutput = new JTextField();
41.311 + myOutput.setEditable(false);
41.312 + label.setLabelFor(myOutput);
41.313 + panel.add(myOutput, c);
41.314 +
41.315 + // [choose]
41.316 + c.weightx = 0.0;
41.317 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
41.318 + myOutputChoose = createButton(
41.319 + i18n("TLT_Choose_Output_Type"), // NOI18N
41.320 + new AbstractAction(i18n("LBL_Choose_Output_Type")) { // NOI18N
41.321 + public void actionPerformed(ActionEvent event) {
41.322 + new DialogType(getProject(), myModel, PanelOperation.this, false).show();
41.323 + }
41.324 + }
41.325 + );
41.326 +// panel.add(myOutputChoose, c);
41.327 + }
41.328 +
41.329 + private void updatePartnerRolePorts(PartnerRolePort partnerRolePort) {
41.330 + myPartnerRolePort.removeAllItems();
41.331 + PartnerRolePort [] partnerRolePorts = getPartnerRolePorts();
41.332 +
41.333 + for (PartnerRolePort item : partnerRolePorts) {
41.334 + myPartnerRolePort.addItem(item);
41.335 + }
41.336 + if (partnerRolePort != null) {
41.337 + myPartnerRolePort.setSelectedItem(partnerRolePort);
41.338 + }
41.339 + update();
41.340 + }
41.341 +
41.342 + private PartnerRolePort [] getPartnerRolePorts() {
41.343 + List<PartnerRolePort> list = new ArrayList<PartnerRolePort>();
41.344 + Definitions definitions = myModel.getDefinitions();
41.345 + List<ExtensibilityElement> elements = definitions.getExtensibilityElements();
41.346 +
41.347 + for (ExtensibilityElement element : elements) {
41.348 + if (element instanceof PartnerLinkType) {
41.349 + PartnerLinkType partnerLinkType = (PartnerLinkType) element;
41.350 + processRole(partnerLinkType, partnerLinkType.getRole1(), list);
41.351 + processRole(partnerLinkType, partnerLinkType.getRole2(), list);
41.352 + }
41.353 + }
41.354 + return list.toArray(new PartnerRolePort [list.size()]);
41.355 + }
41.356 +
41.357 + private void processRole(
41.358 + PartnerLinkType partnerLinkType,
41.359 + Role role,
41.360 + List<PartnerRolePort> list)
41.361 + {
41.362 + if (role == null) {
41.363 + return;
41.364 + }
41.365 + NamedComponentReference<PortType> reference = role.getPortType();
41.366 +
41.367 + if (reference == null) {
41.368 + return;
41.369 + }
41.370 + PortType portType = reference.get();
41.371 +
41.372 + if (portType != null) {
41.373 + list.add(new PartnerRolePort(partnerLinkType, role, portType));
41.374 + }
41.375 + }
41.376 +
41.377 + @Override
41.378 + protected void update()
41.379 + {
41.380 + myOperation.removeAllItems();
41.381 + Operation [] operations = getOperations(getPartnerRolePort());
41.382 +
41.383 + for (Operation operation : operations) {
41.384 + myOperation.addItem(operation);
41.385 + }
41.386 + updateTypes();
41.387 + }
41.388 +
41.389 + void setOperation(Operation operation, PartnerRolePort partnerRolePort) {
41.390 + myOperation.removeAllItems();
41.391 + Operation [] operations = getOperations(getPartnerRolePort());
41.392 +
41.393 + for (Operation item : operations) {
41.394 + myOperation.addItem(item);
41.395 + }
41.396 + updatePartnerRolePorts(partnerRolePort);
41.397 + myOperation.setSelectedItem(operation);
41.398 + updateTypes();
41.399 + }
41.400 +
41.401 + private Operation [] getOperations(PartnerRolePort partnerRolePort) {
41.402 + List<Operation> list = new ArrayList<Operation>();
41.403 +
41.404 + if (partnerRolePort != null) {
41.405 + Collection<Operation> operations =
41.406 + partnerRolePort.getPortType().getOperations();
41.407 +
41.408 + for (Operation operation : operations) {
41.409 + list.add(operation);
41.410 + }
41.411 + }
41.412 + return list.toArray(new Operation [list.size()]);
41.413 + }
41.414 +
41.415 + void setElementOrType(ElementOrType elementOrType, boolean isInput) {
41.416 + try {
41.417 + myModel.startTransaction();
41.418 + updateOperation(getOperation(), elementOrType, isInput);
41.419 + }
41.420 + finally {
41.421 + if (myModel.isIntransaction()) {
41.422 + myModel.endTransaction();
41.423 + }
41.424 + }
41.425 + Util.saveModel(myModel);
41.426 + updateTypes();
41.427 + }
41.428 +
41.429 + private void updateOperation(
41.430 + Operation operation,
41.431 + ElementOrType elementOrType,
41.432 + boolean isInput)
41.433 + {
41.434 + Definitions definitions = myModel.getDefinitions();
41.435 + WSDLComponentFactory factory = myModel.getFactory();
41.436 +
41.437 + if (isInput) {
41.438 + updateInput(
41.439 + operation,
41.440 + definitions,
41.441 + factory,
41.442 + elementOrType
41.443 + );
41.444 + }
41.445 + else {
41.446 + updateOutput(
41.447 + operation,
41.448 + definitions,
41.449 + factory,
41.450 + elementOrType
41.451 + );
41.452 + }
41.453 + }
41.454 +
41.455 + private void updateInput(
41.456 + Operation operation,
41.457 + Definitions definitions,
41.458 + WSDLComponentFactory factory,
41.459 + ElementOrType elementOrType)
41.460 + {
41.461 + Part part = factory.createPart();
41.462 + part.setName(PART_IN_NAME + operation.getName());
41.463 + setElementOrType(part, elementOrType);
41.464 +
41.465 + String messageName = MESSAGE_IN_NAME + operation.getName();
41.466 + Message message = getMessage(definitions, messageName);
41.467 +
41.468 + if (message == null) {
41.469 + message = factory.createMessage();
41.470 + message.setName(messageName);
41.471 + message.addPart(part);
41.472 + definitions.addMessage(message);
41.473 + }
41.474 + Input input = factory.createInput();
41.475 + input.setMessage(input.createReferenceTo(message, Message.class));
41.476 + operation.setInput(input);
41.477 + }
41.478 +
41.479 + private void updateOutput(
41.480 + Operation operation,
41.481 + Definitions definitions,
41.482 + WSDLComponentFactory factory,
41.483 + ElementOrType elementOrType)
41.484 + {
41.485 + Part part = factory.createPart();
41.486 + part.setName(PART_OUT_NAME + operation.getName());
41.487 + setElementOrType(part, elementOrType);
41.488 +
41.489 + String messageName = MESSAGE_OUT_NAME + operation.getName();
41.490 + Message message = getMessage(definitions, messageName);
41.491 +
41.492 + if (message == null) {
41.493 + message = factory.createMessage();
41.494 + message.setName(MESSAGE_OUT_NAME + operation.getName());
41.495 + message.addPart(part);
41.496 + definitions.addMessage(message);
41.497 + }
41.498 + Output output = factory.createOutput();
41.499 + output.setMessage(output.createReferenceTo(message, Message.class));
41.500 + operation.setOutput(output);
41.501 + }
41.502 +
41.503 + private void setElementOrType(Part part, ElementOrType elementOrType) {
41.504 + GlobalElement element = elementOrType.getElement();
41.505 +
41.506 + if (element != null) {
41.507 + updateImports(element);
41.508 + part.setElement(part.createSchemaReference(element, GlobalElement.class));
41.509 + }
41.510 + GlobalType type = elementOrType.getType();
41.511 +
41.512 + if (type != null) {
41.513 + updateImports(type);
41.514 + part.setType(part.createSchemaReference(type, GlobalType.class));
41.515 + }
41.516 + }
41.517 +
41.518 + private void updateImports(SchemaComponent component) {
41.519 + Schema oSchema = component.getModel().getSchema();
41.520 + String location = getLocation(oSchema);
41.521 +
41.522 + if (location == null) { // built-in type
41.523 + return;
41.524 + }
41.525 + Definitions definitions = myModel.getDefinitions();
41.526 + Types types = getTypes(definitions);
41.527 + Schema wSchema = null;
41.528 + String tns = definitions.getTargetNamespace();
41.529 +
41.530 + if (tns != null) {
41.531 + Collection<Schema> schemas = types.getSchemas();
41.532 +
41.533 + if (schemas != null) {
41.534 + for (Schema s : schemas) {
41.535 + if (s.getTargetNamespace() != null && s.getTargetNamespace().equals(tns)) {
41.536 + wSchema = s;
41.537 + break;
41.538 + }
41.539 + }
41.540 + }
41.541 + }
41.542 + WSDLSchema wsdlSchema = null;
41.543 +
41.544 + if (wSchema == null) {
41.545 + wsdlSchema = myModel.getFactory().createWSDLSchema();
41.546 + SchemaModel schemaModel = wsdlSchema.getSchemaModel();
41.547 + wSchema = schemaModel.getSchema();
41.548 + wSchema.setTargetNamespace(myModel.getDefinitions().getTargetNamespace());
41.549 + }
41.550 + Import schemaImport = oSchema.getModel().getFactory().createImport();
41.551 + schemaImport.setSchemaLocation(location);
41.552 +
41.553 + String namespace = oSchema.getTargetNamespace();
41.554 + schemaImport.setNamespace(namespace);
41.555 +
41.556 + setPrefix(namespace);
41.557 + wSchema.addExternalReference(schemaImport);
41.558 +
41.559 + if (definitions.getTypes() == null) {
41.560 + definitions.setTypes(types);
41.561 + }
41.562 + if (wsdlSchema != null) {
41.563 + types.addExtensibilityElement(wsdlSchema);
41.564 + }
41.565 + }
41.566 +
41.567 + private Types getTypes(Definitions definitions) {
41.568 + Types types = definitions.getTypes();
41.569 +
41.570 + if (types == null) {
41.571 + types = myModel.getFactory().createTypes();
41.572 + }
41.573 + return types;
41.574 + }
41.575 +
41.576 + private void setPrefix(String namespace) {
41.577 + String prefix = Util.generatePrefix(myModel);
41.578 +
41.579 + if (prefix.length() > 0) {
41.580 + AbstractDocumentComponent def =
41.581 + (AbstractDocumentComponent) myModel.getDefinitions();
41.582 +
41.583 + Map prefixes = def.getPrefixes();
41.584 +
41.585 + if ( !prefixes.containsKey(prefix)) {
41.586 + def.addPrefix(prefix, namespace);
41.587 + }
41.588 + }
41.589 + }
41.590 +
41.591 + private String getLocation(Schema schema) {
41.592 + SchemaModel model = schema.getModel();
41.593 + return Util.calculateRelativeName(Util.getFileObject(model), getProject());
41.594 + }
41.595 +
41.596 + private Message getMessage(Definitions definitions, String name) {
41.597 + Collection<Message> messages = definitions.getMessages();
41.598 +
41.599 + for (Message message : messages) {
41.600 + if (message.getName().equals(name)) {
41.601 + return message;
41.602 + }
41.603 + }
41.604 + return null;
41.605 + }
41.606 +
41.607 + @Override
41.608 + protected void setEnabled(boolean enabled)
41.609 + {
41.610 + myFile.setEnabled(enabled);
41.611 + myTransformJBI.setEnabled(enabled);
41.612 + }
41.613 +
41.614 + private void updateTypes() {
41.615 + getParent().update();
41.616 +
41.617 + if (myIsReadOnly) {
41.618 + return;
41.619 + }
41.620 + Operation operation = getOperation();
41.621 + myInputChoose.setEnabled(operation != null);
41.622 + myOutputChoose.setEnabled(operation != null);
41.623 +
41.624 + if (operation == null) {
41.625 + myInput.setText(EMPTY);
41.626 + myOutput.setText(EMPTY);
41.627 + return;
41.628 + }
41.629 + myInput.setText(getType(operation.getInput()));
41.630 + myOutput.setText(getType(operation.getOutput()));
41.631 + }
41.632 +
41.633 + private Operation getOperation() {
41.634 + return (Operation) myOperation.getSelectedItem();
41.635 + }
41.636 +
41.637 + private PartnerRolePort getPartnerRolePort() {
41.638 + return (PartnerRolePort) myPartnerRolePort.getSelectedItem();
41.639 + }
41.640 +
41.641 + private JTextField myFile;
41.642 + private JCheckBox myTransformJBI;
41.643 + private JComboBox myPartnerRolePort;
41.644 + private JComboBox myOperation;
41.645 + private JTextField myInput;
41.646 + private JTextField myOutput;
41.647 + private JButton myInputChoose;
41.648 + private JButton myOutputChoose;
41.649 + private WSDLModel myModel;
41.650 + private String myFileName;
41.651 + private boolean myIsReadOnly;
41.652 + private boolean myIsInput;
41.653 + private boolean myIsInputRequired;
41.654 + private boolean myIsOutputRequired;
41.655 +
41.656 + private static final String PART_IN_NAME = "PartIn"; // NOI18N
41.657 + private static final String PART_OUT_NAME = "PartOut"; // NOI18N
41.658 + private static final String MESSAGE_IN_NAME = "MessageIn"; // NOI18N
41.659 + private static final String MESSAGE_OUT_NAME = "MessageOut"; // NOI18N
41.660 +}
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/PanelProxy.java Mon Feb 19 13:24:25 2007 +0000
42.3 @@ -0,0 +1,230 @@
42.4 +/*
42.5 + * The contents of this file are subject to the terms of the Common Development
42.6 + * and Distribution License (the License). You may not use this file except in
42.7 + * compliance with the License.
42.8 + *
42.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
42.10 + * or http://www.netbeans.org/cddl.txt.
42.11 + *
42.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
42.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
42.14 + * If applicable, add the following below the CDDL Header, with the fields
42.15 + * enclosed by brackets [] replaced by your own identifying information:
42.16 + * "Portions Copyrighted [year] [name of copyright owner]"
42.17 + *
42.18 + * The Original Software is NetBeans. The Initial Developer of the Original
42.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
42.20 + * Microsystems, Inc. All Rights Reserved.
42.21 + */
42.22 +package org.netbeans.modules.xslt.project.wizard.element;
42.23 +
42.24 +import java.awt.GridBagConstraints;
42.25 +import java.awt.GridBagLayout;
42.26 +import java.awt.Insets;
42.27 +import java.awt.event.ActionEvent;
42.28 +
42.29 +import javax.swing.AbstractAction;
42.30 +import javax.swing.JButton;
42.31 +import javax.swing.JCheckBox;
42.32 +import javax.swing.JLabel;
42.33 +import javax.swing.JPanel;
42.34 +import javax.swing.JTextField;
42.35 +
42.36 +import org.openide.WizardDescriptor;
42.37 +import org.netbeans.api.project.Project;
42.38 +import org.netbeans.modules.xml.wsdl.model.Operation;
42.39 +import org.netbeans.modules.xml.wsdl.model.WSDLModel;
42.40 +
42.41 +import static org.netbeans.modules.print.api.PrintUI.*;
42.42 +
42.43 +/**
42.44 + * @author Vladimir Yaroslavskiy
42.45 + * @version 2007.02.01
42.46 + */
42.47 +final class PanelProxy extends Panel {
42.48 +
42.49 + PanelProxy(
42.50 + Project project,
42.51 + Panel parent,
42.52 + WSDLModel modelImplement,
42.53 + WSDLModel modelCall)
42.54 + {
42.55 + super(project, parent);
42.56 + int numberImplement = getXslFileNumber(1);
42.57 + int numberCall = getXslFileNumber(numberImplement + 1);
42.58 +
42.59 + myOperationImplement = new PanelOperation(
42.60 + project, this, modelImplement, getXslFileName(numberImplement), true, true);
42.61 +
42.62 + myOperationCall = new PanelOperation(
42.63 + project, this, modelCall, getXslFileName(numberCall), true, false);
42.64 + }
42.65 +
42.66 + @Override
42.67 + protected String getComponentName()
42.68 + {
42.69 + return NAME_XSLT;
42.70 + }
42.71 +
42.72 + @Override
42.73 + protected String getError()
42.74 + {
42.75 + return getError(myOperationImplement.getError(), myOperationCall.getError());
42.76 + }
42.77 +
42.78 + public void storeSettings(Object object) {
42.79 + WizardDescriptor descriptor = (WizardDescriptor) object;
42.80 + myOperationImplement.storeSettings(object);
42.81 + myOperationCall.storeSettings(object);
42.82 +
42.83 + if (myReplyBox.isSelected()) {
42.84 + descriptor.putProperty(CHOICE, CHOICE_FILTER_REQUEST_REPLY);
42.85 + }
42.86 + else {
42.87 + descriptor.putProperty(CHOICE, CHOICE_FILTER_ONE_WAY);
42.88 + }
42.89 + }
42.90 +
42.91 + @Override
42.92 + protected void createPanel(JPanel mainPanel, GridBagConstraints cc)
42.93 + {
42.94 + JPanel panel = new JPanel(new GridBagLayout());
42.95 + GridBagConstraints c = new GridBagConstraints();
42.96 + c.anchor = GridBagConstraints.WEST;
42.97 + c.anchor = GridBagConstraints.NORTHWEST;
42.98 + c.fill = GridBagConstraints.HORIZONTAL;
42.99 + c.weightx = 1.0;
42.100 + c.gridx = 0;
42.101 +
42.102 + // we implement
42.103 + panel.add(createSeparator(i18n("LBL_We_Implement")), c); // NOI18N
42.104 + myOperationImplement.createPanel(panel, c);
42.105 +
42.106 + // we call
42.107 + panel.add(createSeparator(i18n("LBL_We_Call")), c); // NOI18N
42.108 + myOperationCall.createPanel(panel, c);
42.109 +
42.110 + // transform request
42.111 + panel.add(createTransformRequestPanel(), c);
42.112 +
42.113 + // transform reply
42.114 + panel.add(createTransformReplyPanel(), c);
42.115 +
42.116 + update();
42.117 + mainPanel.add(panel, cc);
42.118 + }
42.119 +
42.120 + @Override
42.121 + protected void update()
42.122 + {
42.123 + if (myRequestBox == null || myReplyBox == null) {
42.124 + return;
42.125 + }
42.126 + myOperationImplement.setEnabled(myRequestBox.isSelected());
42.127 + myOperationCall.setEnabled(myReplyBox.isSelected());
42.128 +
42.129 + myOperationImplement.setRequirement(
42.130 + myRequestBox.isSelected(), myReplyBox.isSelected());
42.131 +
42.132 + myOperationCall.setRequirement(
42.133 + myRequestBox.isSelected(), myReplyBox.isSelected());
42.134 +
42.135 + updateText(
42.136 + myRequestText,
42.137 + true,
42.138 + (Operation) myOperationImplement.getResult(),
42.139 + (Operation) myOperationCall.getResult());
42.140 +
42.141 + updateText(
42.142 + myReplyText,
42.143 + false,
42.144 + (Operation) myOperationCall.getResult(),
42.145 + (Operation) myOperationImplement.getResult());
42.146 + }
42.147 +
42.148 + private void updateText(
42.149 + JTextField text,
42.150 + boolean isInput,
42.151 + Operation operation1,
42.152 + Operation operation2)
42.153 + {
42.154 + String type1 = getType(operation1, isInput);
42.155 + String type2 = getType(operation2, isInput);
42.156 + text.setText(i18n("LBL_From_To", type1, type2)); // NOI18N
42.157 + }
42.158 +
42.159 + private String getType(Operation operation, boolean isInput) {
42.160 + if (operation == null) {
42.161 + return EMPTY;
42.162 + }
42.163 + if (isInput) {
42.164 + return getType(operation.getInput());
42.165 + }
42.166 + else {
42.167 + return getType(operation.getOutput());
42.168 + }
42.169 + }
42.170 +
42.171 + private JPanel createTransformRequestPanel() {
42.172 + myRequestBox = createCheckBox(
42.173 + i18n("LBL_Transform_Request"), // NOI18N
42.174 + new AbstractAction(i18n("LBL_Transform_Request")) { // NOI18N
42.175 + public void actionPerformed(ActionEvent event) {
42.176 + update();
42.177 + }
42.178 + }
42.179 + );
42.180 + myRequestBox.setEnabled(false);
42.181 + myRequestBox.setSelected(true);
42.182 + myRequestText = new JTextField();
42.183 +
42.184 + return createTransformPanel(myRequestBox, myRequestText);
42.185 + }
42.186 +
42.187 + private JPanel createTransformReplyPanel() {
42.188 + myReplyBox = createCheckBox(
42.189 + i18n("LBL_Transform_Reply"), // NOI18N
42.190 + new AbstractAction(i18n("LBL_Transform_Reply")) { // NOI18N
42.191 + public void actionPerformed(ActionEvent event) {
42.192 + update();
42.193 + }
42.194 + }
42.195 + );
42.196 + myReplyBox.setEnabled(true);
42.197 + myReplyBox.setSelected(false);
42.198 + myReplyText = new JTextField();
42.199 +
42.200 + return createTransformPanel(myReplyBox, myReplyText);
42.201 + }
42.202 +
42.203 + private JPanel createTransformPanel(JCheckBox checkBox, JTextField text) {
42.204 + JPanel panel = new JPanel(new GridBagLayout());
42.205 + GridBagConstraints c = new GridBagConstraints();
42.206 + c.anchor = GridBagConstraints.WEST;
42.207 + JButton button;
42.208 + JLabel label;
42.209 +
42.210 + // check box
42.211 + c.gridy++;
42.212 + c.insets = new Insets(SMALL_INSET, 0, 0, 0);
42.213 + panel.add(checkBox, c);
42.214 +
42.215 + // text
42.216 + c.gridy++;
42.217 + c.insets = new Insets(
42.218 + SMALL_INSET, MEDIUM_INSET + SMALL_INSET + TINY_INSET, TINY_INSET, 0);
42.219 + c.fill = GridBagConstraints.HORIZONTAL;
42.220 + c.weightx = 1.0;
42.221 + text.setEnabled(false);
42.222 + panel.add(text, c);
42.223 +
42.224 + return panel;
42.225 + }
42.226 +
42.227 + private PanelOperation myOperationImplement;
42.228 + private PanelOperation myOperationCall;
42.229 + private JCheckBox myRequestBox;
42.230 + private JCheckBox myReplyBox;
42.231 + private JTextField myRequestText;
42.232 + private JTextField myReplyText;
42.233 +}
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/PanelStartup.java Mon Feb 19 13:24:25 2007 +0000
43.3 @@ -0,0 +1,108 @@
43.4 +/*
43.5 + * The contents of this file are subject to the terms of the Common Development
43.6 + * and Distribution License (the License). You may not use this file except in
43.7 + * compliance with the License.
43.8 + *
43.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
43.10 + * or http://www.netbeans.org/cddl.txt.
43.11 + *
43.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
43.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
43.14 + * If applicable, add the following below the CDDL Header, with the fields
43.15 + * enclosed by brackets [] replaced by your own identifying information:
43.16 + * "Portions Copyrighted [year] [name of copyright owner]"
43.17 + *
43.18 + * The Original Software is NetBeans. The Initial Developer of the Original
43.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
43.20 + * Microsystems, Inc. All Rights Reserved.
43.21 + */
43.22 +package org.netbeans.modules.xslt.project.wizard.element;
43.23 +
43.24 +import java.awt.GridBagConstraints;
43.25 +import java.awt.GridBagLayout;
43.26 +import java.awt.Insets;
43.27 +
43.28 +import javax.swing.ButtonGroup;
43.29 +import javax.swing.JPanel;
43.30 +import javax.swing.JRadioButton;
43.31 +
43.32 +import org.netbeans.api.project.Project;
43.33 +import static org.netbeans.modules.print.api.PrintUI.*;
43.34 +
43.35 +/**
43.36 + * @author Vladimir Yaroslavskiy
43.37 + * @version 2006.12.25
43.38 + */
43.39 +final class PanelStartup extends Panel {
43.40 +
43.41 + PanelStartup(Project project, Panel parent) {
43.42 + super(project, parent);
43.43 + myTransformationPanel = new PanelWSDL(getProject(), this);
43.44 + myProxyPanel = new PanelWSDLs(getProject(), this);
43.45 + }
43.46 +
43.47 + @Override
43.48 + protected String getComponentName()
43.49 + {
43.50 + return NAME_TYPE;
43.51 + }
43.52 +
43.53 + @Override
43.54 + protected Panel getNext()
43.55 + {
43.56 + if (myTransformation != null && myTransformation.isSelected()) {
43.57 + return myTransformationPanel;
43.58 + }
43.59 + else {
43.60 + return myProxyPanel;
43.61 + }
43.62 + }
43.63 +
43.64 + @Override
43.65 + protected void createPanel(JPanel mainPanel, GridBagConstraints cc)
43.66 + {
43.67 + JPanel panel = new JPanel(new GridBagLayout());
43.68 + GridBagConstraints c = new GridBagConstraints();
43.69 + ButtonGroup group = new ButtonGroup();
43.70 + c.anchor = GridBagConstraints.NORTHWEST;
43.71 + c.weightx = 1.0;
43.72 + c.weighty = 1.0;
43.73 +
43.74 + // (o) Request-Reply Service
43.75 + c.gridy++;
43.76 + c.insets = new Insets(SMALL_INSET, 0, 0, 0);
43.77 + myTransformation = createRadioButton(i18n("LBL_Transformation")); // NOI18N
43.78 + myTransformation.setSelected(true);
43.79 + panel.add(myTransformation, c);
43.80 + group.add(myTransformation);
43.81 +
43.82 + // text
43.83 + c.gridy++;
43.84 + c.insets = new Insets(
43.85 + SMALL_INSET, MEDIUM_INSET + SMALL_INSET + TINY_INSET, TINY_INSET, 0);
43.86 + panel.add(createTextArea(TEXT_WIDTH, i18n("LBL_Transformation_Text")),c);//NOI18N
43.87 +
43.88 + // (o) Proxy Service
43.89 + c.gridy++;
43.90 + c.insets = new Insets(SMALL_INSET, 0, 0, 0);
43.91 + myProxy = createRadioButton(i18n("LBL_Proxy")); // NOI18N
43.92 + myProxy.setSelected(false);
43.93 + panel.add(myProxy, c);
43.94 + group.add(myProxy);
43.95 +
43.96 + // text
43.97 + c.gridy++;
43.98 + c.insets = new Insets(
43.99 + SMALL_INSET, MEDIUM_INSET + SMALL_INSET + TINY_INSET, TINY_INSET, 0);
43.100 + panel.add(createTextArea(TEXT_WIDTH, i18n("LBL_Proxy_Text")), c); // NOI18N
43.101 +
43.102 +// panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.blue));
43.103 + mainPanel.add(panel, cc);
43.104 + }
43.105 +
43.106 + private Panel myTransformationPanel;
43.107 + private JRadioButton myTransformation;
43.108 + private Panel myProxyPanel;
43.109 + private JRadioButton myProxy;
43.110 + private static final int TEXT_WIDTH = 40;
43.111 +}
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/PanelWSDL.java Mon Feb 19 13:24:25 2007 +0000
44.3 @@ -0,0 +1,245 @@
44.4 +/*
44.5 + * The contents of this file are subject to the terms of the Common Development
44.6 + * and Distribution License (the License). You may not use this file except in
44.7 + * compliance with the License.
44.8 + *
44.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
44.10 + * or http://www.netbeans.org/cddl.txt.
44.11 + *
44.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
44.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
44.14 + * If applicable, add the following below the CDDL Header, with the fields
44.15 + * enclosed by brackets [] replaced by your own identifying information:
44.16 + * "Portions Copyrighted [year] [name of copyright owner]"
44.17 + *
44.18 + * The Original Software is NetBeans. The Initial Developer of the Original
44.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
44.20 + * Microsystems, Inc. All Rights Reserved.
44.21 + */
44.22 +package org.netbeans.modules.xslt.project.wizard.element;
44.23 +
44.24 +import java.awt.GridBagConstraints;
44.25 +import java.awt.GridBagLayout;
44.26 +import java.awt.Insets;
44.27 +//import java.awt.event.ItemEvent;
44.28 +//import java.awt.event.ItemListener;
44.29 +//import java.io.IOException;
44.30 +
44.31 +import javax.swing.ButtonGroup;
44.32 +//import javax.swing.JLabel;
44.33 +import javax.swing.JPanel;
44.34 +//import javax.swing.JRadioButton;
44.35 +//import javax.swing.JTextField;
44.36 +
44.37 +//import org.openide.filesystems.FileObject;
44.38 +import org.netbeans.api.project.Project;
44.39 +
44.40 +//import org.netbeans.modules.xml.wsdl.model.Definitions;
44.41 +import org.netbeans.modules.xml.wsdl.model.WSDLModel;
44.42 +import static org.netbeans.modules.print.api.PrintUI.*;
44.43 +
44.44 +/**
44.45 + * @author Vladimir Yaroslavskiy
44.46 + * @version 2007.01.30
44.47 + */
44.48 +final class PanelWSDL extends Panel {
44.49 +
44.50 + PanelWSDL(Project project, Panel parent) {
44.51 + super(project, parent);
44.52 + myWebService = new PanelWebService(project, parent);
44.53 + }
44.54 +
44.55 + @Override
44.56 + protected String getComponentName()
44.57 + {
44.58 + return NAME_WSDL;
44.59 + }
44.60 +
44.61 + @Override
44.62 + protected Panel getNext()
44.63 + {
44.64 + return new PanelTransformation(getProject(), this, myModel);
44.65 + }
44.66 +
44.67 + @Override
44.68 + protected String getError()
44.69 + {
44.70 +// if (myExisting.isSelected()) {
44.71 + String error = myWebService.getError();
44.72 +
44.73 + if (error != null) {
44.74 + return error;
44.75 + }
44.76 + myModel = (WSDLModel) myWebService.getResult();
44.77 +// }
44.78 +// else {
44.79 +// String name = getName(myName.getText());
44.80 +//
44.81 +// if (name == null) {
44.82 +// return i18n("ERR_File_Name_Must_Be_Specified"); // NOI18N
44.83 +// }
44.84 +// FileObject file = getFolder().getFileObject(name);
44.85 +//
44.86 +// if (file != null) {
44.87 +// return i18n("ERR_File_Already_Exists", name); // NOI18N
44.88 +// }
44.89 +// try {
44.90 +// myModel = Util.getWSDLModel(createFile(name));
44.91 +// myWebService.update();
44.92 +// }
44.93 +// catch (IOException e) {
44.94 +// return i18n("ERR_Occurred", e.getMessage()); // NOI18N
44.95 +// }
44.96 +// }
44.97 + return null;
44.98 + }
44.99 +
44.100 + @Override
44.101 + protected void createPanel(JPanel mainPanel, GridBagConstraints cc)
44.102 + {
44.103 + JPanel panel = new JPanel(new GridBagLayout());
44.104 + GridBagConstraints c = new GridBagConstraints();
44.105 + ButtonGroup group = new ButtonGroup();
44.106 + c.anchor = GridBagConstraints.WEST;
44.107 + c.weighty = 1.0;
44.108 +/*
44.109 + // (o) Existing
44.110 + c.gridy++;
44.111 + c.weightx = 1.0;
44.112 + c.fill = GridBagConstraints.HORIZONTAL;
44.113 + c.insets = new Insets(SMALL_INSET, 0, 0, 0);
44.114 + myExisting = createRadioButton(i18n("LBL_Existing_WSDL")); // NOI18N
44.115 + myExisting.setSelected(true);
44.116 + myExisting.addItemListener(createItemListener(true));
44.117 + panel.add(myExisting, c);
44.118 + group.add(myExisting);
44.119 +*/
44.120 + c.gridy++;
44.121 + c.weightx = 1.0;
44.122 + c.insets = new Insets(0, 0, 0, 0);
44.123 + c.fill = GridBagConstraints.HORIZONTAL;
44.124 + myWebService.createPanel(panel, c);
44.125 +/*
44.126 + // (o) Create New
44.127 + c.gridy++;
44.128 + c.insets = new Insets(SMALL_INSET, 0, 0, 0);
44.129 + myCreate = createRadioButton(i18n("LBL_Create_New_WSDL")); // NOI18N
44.130 + myCreate.setSelected(false);
44.131 + myCreate.addItemListener(createItemListener(false));
44.132 + panel.add(myCreate, c);
44.133 + group.add(myCreate);
44.134 +
44.135 + c.gridy++;
44.136 + c.insets = new Insets(0, 0, 0, 0);
44.137 + panel.add(createNewPanel(), c);
44.138 +
44.139 + setEnabled(true);
44.140 +// panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.blue));
44.141 +*/
44.142 + mainPanel.add(panel, cc);
44.143 + }
44.144 +/*
44.145 + private JPanel createNewPanel() {
44.146 + JPanel panel = new JPanel(new GridBagLayout());
44.147 + GridBagConstraints c = new GridBagConstraints();
44.148 + c.anchor = GridBagConstraints.WEST;
44.149 +
44.150 + // lanel
44.151 + c.gridy++;
44.152 + c.weightx = 0.0;
44.153 + c.gridwidth = 1;
44.154 + c.fill = GridBagConstraints.NONE;
44.155 + c.insets = new Insets(
44.156 + TINY_INSET, MEDIUM_INSET + SMALL_INSET + TINY_INSET, TINY_INSET, 0);
44.157 + myNameLabel = createLabel(i18n("LBL_Name")); // NOI18N
44.158 + panel.add(myNameLabel, c);
44.159 +
44.160 + // text field
44.161 + c.weightx = 1.0;
44.162 + c.fill = GridBagConstraints.HORIZONTAL;
44.163 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
44.164 + myName = new JTextField();
44.165 + myNameLabel.setLabelFor(myName);
44.166 + panel.add(myName, c);
44.167 +
44.168 + return panel;
44.169 + }
44.170 +
44.171 + private ItemListener createItemListener(final boolean existing) {
44.172 + return new ItemListener() {
44.173 + public void itemStateChanged(ItemEvent event) {
44.174 + setEnabled(existing);
44.175 + }
44.176 + };
44.177 + }
44.178 +*/
44.179 + @Override
44.180 + protected void setEnabled(boolean enabled)
44.181 + {
44.182 + myWebService.setEnabled(enabled);
44.183 +// myName.setEnabled( !enabled);
44.184 +// myNameLabel.setEnabled( !enabled);
44.185 + }
44.186 +/*
44.187 + private String getName(String value) {
44.188 + String name = value.trim();
44.189 +
44.190 + if (name.equals(WSDL_EXT)) {
44.191 + return null;
44.192 + }
44.193 + if (name.length() == 0) {
44.194 + return null;
44.195 + }
44.196 + if (name.toLowerCase().endsWith(WSDL_EXT)) {
44.197 + return name;
44.198 + }
44.199 + return name + WSDL_EXT;
44.200 + }
44.201 +
44.202 + private FileObject createFile(String file) throws IOException {
44.203 + String text =
44.204 + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + LS + LS + // NOI18N
44.205 + "<definitions" + LS + // NOI18N
44.206 + " xmlns=\"http://schemas.xmlsoap.org/wsdl/\"" + LS + // NOI18N
44.207 + " xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"" + LS + // NOI18N
44.208 + " xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\"" + LS + // NOI18N
44.209 + " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + LS + // NOI18N
44.210 + "</definitions>" + LS; // NOI18N
44.211 +
44.212 + FileObject wsdl = Util.createFile(getFolder(), file, text);
44.213 + WSDLModel model = Util.getWSDLModel(wsdl);
44.214 + String name = file;
44.215 +
44.216 + if (file.toLowerCase().endsWith(WSDL_EXT)) {
44.217 + name = file.substring(0, file.length() - WSDL_EXT.length());
44.218 + }
44.219 + Definitions definitions = model.getDefinitions();
44.220 +
44.221 + if (definitions == null) {
44.222 + return null;
44.223 + }
44.224 + try {
44.225 + model.startTransaction();
44.226 + definitions.setName(name);
44.227 + definitions.setTargetNamespace(HOST + name);
44.228 + Util.saveModel(model);
44.229 + }
44.230 + finally {
44.231 + if (model.isIntransaction()) {
44.232 + model.endTransaction();
44.233 + }
44.234 + }
44.235 + return wsdl;
44.236 + }
44.237 +*/
44.238 +// private JTextField myName;
44.239 +// private JLabel myNameLabel;
44.240 +// private JRadioButton myExisting;
44.241 +// private JRadioButton myCreate;
44.242 + private WSDLModel myModel;
44.243 + private PanelWebService myWebService;
44.244 +
44.245 +// private static final String HOST =
44.246 +// "http://enterprise.netbeans.org/bpel/"; // NOI18N
44.247 +// private static final String WSDL_EXT = ".wsdl"; // NOI18N
44.248 +}
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
45.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/PanelWSDLs.java Mon Feb 19 13:24:25 2007 +0000
45.3 @@ -0,0 +1,97 @@
45.4 +/*
45.5 + * The contents of this file are subject to the terms of the Common Development
45.6 + * and Distribution License (the License). You may not use this file except in
45.7 + * compliance with the License.
45.8 + *
45.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
45.10 + * or http://www.netbeans.org/cddl.txt.
45.11 + *
45.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
45.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
45.14 + * If applicable, add the following below the CDDL Header, with the fields
45.15 + * enclosed by brackets [] replaced by your own identifying information:
45.16 + * "Portions Copyrighted [year] [name of copyright owner]"
45.17 + *
45.18 + * The Original Software is NetBeans. The Initial Developer of the Original
45.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
45.20 + * Microsystems, Inc. All Rights Reserved.
45.21 + */
45.22 +package org.netbeans.modules.xslt.project.wizard.element;
45.23 +
45.24 +import java.awt.GridBagConstraints;
45.25 +import java.awt.GridBagLayout;
45.26 +import java.awt.Insets;
45.27 +import javax.swing.JPanel;
45.28 +
45.29 +import org.netbeans.api.project.Project;
45.30 +import org.netbeans.modules.xml.wsdl.model.WSDLModel;
45.31 +
45.32 +import static org.netbeans.modules.print.api.PrintUI.*;
45.33 +
45.34 +/**
45.35 + * @author Vladimir Yaroslavskiy
45.36 + * @version 2007.02.02
45.37 + */
45.38 +final class PanelWSDLs extends Panel {
45.39 +
45.40 + PanelWSDLs(Project project, Panel parent) {
45.41 + super(project, parent);
45.42 + myWebServiceImplement = new PanelWebService(project, parent);
45.43 + myWebServiceCall = new PanelWebService(project, parent);
45.44 + }
45.45 +
45.46 + @Override
45.47 + protected String getComponentName()
45.48 + {
45.49 + return NAME_WSDL;
45.50 + }
45.51 +
45.52 + @Override
45.53 + protected Panel getNext()
45.54 + {
45.55 + return new PanelProxy(getProject(), this,
45.56 + (WSDLModel) myWebServiceImplement.getResult(),
45.57 + (WSDLModel) myWebServiceCall.getResult());
45.58 + }
45.59 +
45.60 + @Override
45.61 + protected String getError()
45.62 + {
45.63 + return getError(myWebServiceImplement.getError(), myWebServiceCall.getError());
45.64 + }
45.65 +
45.66 + @Override
45.67 + protected void createPanel(JPanel mainPanel, GridBagConstraints cc)
45.68 + {
45.69 + JPanel panel = new JPanel(new GridBagLayout());
45.70 + GridBagConstraints c = new GridBagConstraints();
45.71 + c.anchor = GridBagConstraints.WEST;
45.72 + c.fill = GridBagConstraints.HORIZONTAL;
45.73 + c.weightx = 1.0;
45.74 +
45.75 + // we implement
45.76 + c.gridy++;
45.77 + c.insets = new Insets(0, 0, 0, 0);
45.78 + panel.add(createSeparator(i18n("LBL_We_Implement")), c); // NOI18N
45.79 +
45.80 + c.gridy++;
45.81 + c.insets = new Insets(
45.82 + TINY_INSET, MEDIUM_INSET + SMALL_INSET + TINY_INSET, TINY_INSET, 0);
45.83 + myWebServiceImplement.createPanel(panel, c);
45.84 +
45.85 + // we call
45.86 + c.gridy++;
45.87 + c.insets = new Insets(0, 0, 0, 0);
45.88 + panel.add(createSeparator(i18n("LBL_We_Call")), c); // NOI18N
45.89 +
45.90 + c.gridy++;
45.91 + c.insets = new Insets(
45.92 + TINY_INSET, MEDIUM_INSET + SMALL_INSET + TINY_INSET, TINY_INSET, 0);
45.93 + myWebServiceCall.createPanel(panel, c);
45.94 +
45.95 + mainPanel.add(panel, cc);
45.96 + }
45.97 +
45.98 + private Panel myWebServiceImplement;
45.99 + private Panel myWebServiceCall;
45.100 +}
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/xslt.project/src/org/netbeans/modules/xslt/project/wizard/element/PanelWebService.java Mon Feb 19 13:24:25 2007 +0000
46.3 @@ -0,0 +1,144 @@
46.4 +/*
46.5 + * The contents of this file are subject to the terms of the Common Development
46.6 + * and Distribution License (the License). You may not use this file except in
46.7 + * compliance with the License.
46.8 + *
46.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
46.10 + * or http://www.netbeans.org/cddl.txt.
46.11 + *
46.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
46.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
46.14 + * If applicable, add the following below the CDDL Header, with the fields
46.15 + * enclosed by brackets [] replaced by your own identifying information:
46.16 + * "Portions Copyrighted [year] [name of copyright owner]"
46.17 + *
46.18 + * The Original Software is NetBeans. The Initial Developer of the Original
46.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
46.20 + * Microsystems, Inc. All Rights Reserved.
46.21 + */
46.22 +package org.netbeans.modules.xslt.project.wizard.element;
46.23 +
46.24 +import java.awt.GridBagConstraints;
46.25 +import java.awt.GridBagLayout;
46.26 +import java.awt.Insets;
46.27 +import java.awt.event.ActionEvent;
46.28 +import java.awt.event.ItemEvent;
46.29 +import java.awt.event.ItemListener;
46.30 +
46.31 +import javax.swing.AbstractAction;
46.32 +import javax.swing.JButton;
46.33 +import javax.swing.JComboBox;
46.34 +import javax.swing.JLabel;
46.35 +import javax.swing.JPanel;
46.36 +
46.37 +import org.openide.filesystems.FileObject;
46.38 +import org.netbeans.api.project.Project;
46.39 +
46.40 +import static org.netbeans.modules.print.api.PrintUI.*;
46.41 +
46.42 +/**
46.43 + * @author Vladimir Yaroslavskiy
46.44 + * @version 2007.01.30
46.45 + */
46.46 +final class PanelWebService extends Panel {
46.47 +
46.48 + PanelWebService(Project project, Panel parent) {
46.49 + super(project, parent);
46.50 + }
46.51 +
46.52 + @Override
46.53 + protected String getError()
46.54 + {
46.55 + myFile = getWSDL();
46.56 +
46.57 + if (myFile == null) {
46.58 + return i18n("ERR_Web_Service_Is_Required"); // NOI18N
46.59 + }
46.60 + return null;
46.61 + }
46.62 +
46.63 + @Override
46.64 + protected Object getResult()
46.65 + {
46.66 + return Util.getWSDLModel(myFile);
46.67 + }
46.68 +
46.69 + @Override
46.70 + protected void createPanel(JPanel mainPanel, GridBagConstraints cc)
46.71 + {
46.72 + JPanel panel = new JPanel(new GridBagLayout());
46.73 + GridBagConstraints c = new GridBagConstraints();
46.74 + c.anchor = GridBagConstraints.WEST;
46.75 +
46.76 + // label
46.77 + c.gridy++;
46.78 + c.weightx = 0.0;
46.79 + c.fill = GridBagConstraints.NONE;
46.80 + c.insets = new Insets(TINY_INSET, 0, TINY_INSET, 0);
46.81 + myFileLabel = createLabel(i18n("LBL_Web_Service_File")); // NOI18N
46.82 + panel.add(myFileLabel, c);
46.83 +
46.84 + // wsdl
46.85 + c.weightx = 1.0;
46.86 + c.fill = GridBagConstraints.HORIZONTAL;
46.87 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
46.88 + myWSDL = new JComboBox();
46.89 + myWSDL.setRenderer(new Renderer());
46.90 + myFileLabel.setLabelFor(myWSDL);
46.91 + panel.add(myWSDL, c);
46.92 +
46.93 + // [browse]
46.94 + c.weightx = 0.0;
46.95 + c.fill = GridBagConstraints.NONE;
46.96 + c.insets = new Insets(TINY_INSET, SMALL_INSET, TINY_INSET, 0);
46.97 + myBrowse = createButton(
46.98 + i18n("TLT_Browse_WSDL"), // NOI18N
46.99 + new AbstractAction(i18n("LBL_Browse_WSDL")) { // NOI18N
46.100 + public void actionPerformed(ActionEvent event) {
46.101 + printInformation( // todo m
46.102 + "Dialog will be implemented by xml team," + // NOI18N
46.103 + " see issue 93596."); // NOI18N
46.104 + }
46.105 + }
46.106 + );
46.107 +// panel.add(myBrowse, c);
46.108 + mainPanel.add(panel, cc);
46.109 + update();
46.110 + }
46.111 +
46.112 + private ItemListener createItemListener(final boolean existing) {
46.113 + return new ItemListener() {
46.114 + public void itemStateChanged(ItemEvent event) {
46.115 + setEnabled(existing);
46.116 + }
46.117 + };
46.118 + }
46.119 +
46.120 + @Override
46.121 + protected void setEnabled(boolean enabled)
46.122 + {
46.123 + myWSDL.setEnabled(enabled);
46.124 + myBrowse.setEnabled(enabled);
46.125 + myFileLabel.setEnabled(enabled);
46.126 + }
46.127 +
46.128 + @Override
46.129 + protected void update()
46.130 + {
46.131 + myWSDL.removeAllItems();
46.132 + FileObject [] files = Util.getWSDLFiles(getProject());
46.133 +
46.134 + for (FileObject file : files) {
46.135 + myWSDL.addItem(file);
46.136 + }
46.137 + }
46.138 +
46.139 + private FileObject getWSDL() {
46.140 + return (FileObject) myWSDL.getSelectedItem();
46.141 + }
46.142 +
46.143 + private JButton myBrowse;
46.144 + private JComboBox myWSDL;
46.145 + private JLabel myFileLabel;
46.146 + private FileObject myFile;
46.147 +}