You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2007/03/26 08:21:47 UTC
svn commit: r522437 - in
/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache:
axis2/tools/bean/ axis2/tools/java2wsdl/ ideaplugin/frames/
Author: sandakith
Date: Sun Mar 25 23:21:46 2007
New Revision: 522437
URL: http://svn.apache.org/viewvc?view=rev&rev=522437
Log:
review and commit the code for Axis2-2386
java2wsdl functionality for idea plugin
Thanks Shivantha
Added:
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/ClassLoadingTestBean.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/NamespaceFinder.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/WsdlgenBean.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/BottomPanel.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/JarFileFilter.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/Java2WSDLFrame.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OptionPanel.java
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OutputPanel.java
Modified:
webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/ClassLoadingTestBean.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/ClassLoadingTestBean.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/ClassLoadingTestBean.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/ClassLoadingTestBean.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,60 @@
+package org.apache.axis2.tools.bean;
+
+import java.util.List;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.MalformedURLException;
+import java.io.File;
+
+public class ClassLoadingTestBean {
+
+ public static boolean tryLoadingClass(String className,
+ String[] classPathEntries, List errorListener) {
+
+ //make a URL class loader from the entries
+ ClassLoader classLoader;
+
+ if (classPathEntries.length > 0) {
+ URL[] urls = new URL[classPathEntries.length];
+
+ try {
+ for (int i = 0; i < classPathEntries.length; i++) {
+ String classPathEntry = classPathEntries[i];
+ //this should be a file(or a URL)
+ if (classPathEntry.startsWith("http://")) {
+ urls[i] = new URL(classPathEntry);
+ } else {
+ urls[i] = new File(classPathEntry).toURL();
+ }
+ }
+ } catch (MalformedURLException e) {
+ if (errorListener!=null){
+ errorListener.add(e);
+ }
+ return false;
+ }
+
+ classLoader = new URLClassLoader(urls);
+
+ } else {
+ classLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ //try to load the class with the given name
+
+ try {
+ Class clazz=classLoader.loadClass(className);
+ clazz.getMethods();
+
+
+ } catch (Throwable t) {
+ if (errorListener!=null){
+ errorListener.add(t);
+ }
+ return false;
+ }
+
+ return true;
+
+ }
+}
\ No newline at end of file
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/NamespaceFinder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/NamespaceFinder.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/NamespaceFinder.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/NamespaceFinder.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,41 @@
+package org.apache.axis2.tools.bean;
+
+
+public class NamespaceFinder {
+ private static String NS_PREFIX = "http://";
+ private static String SCHEMA_NS_SUFFIX = "/xsd";
+ private static String SCHEMA_NS_DEFAULT_PREFIX = "xsd";
+ private static String NS_DEFAULT_PREFIX = "ns";
+
+
+ public static String getTargetNamespaceFromClass(String fullyQualifiedClassName){
+ //tokenize the className
+ String[] classNameParts = fullyQualifiedClassName.split("\\.");
+ //add the strings in reverse order to make the namespace
+ String nsUri = "";
+ for(int i=classNameParts.length-1;i>=0;i--){
+ nsUri = nsUri + classNameParts[i] + (i==0?"":".");
+ }
+
+ return NS_PREFIX + nsUri;
+
+ }
+
+ public static String getSchemaTargetNamespaceFromClass(String fullyQualifiedClassName){
+ return getTargetNamespaceFromClass(fullyQualifiedClassName) +SCHEMA_NS_SUFFIX;
+ }
+
+ public static String getDefaultSchemaNamespacePrefix(){
+ return SCHEMA_NS_DEFAULT_PREFIX;
+ }
+
+ public static String getDefaultNamespacePrefix(){
+ return NS_DEFAULT_PREFIX;
+ }
+
+ public static String getServiceNameText(String fullyQualifiedClassName){
+ //tokenize the className
+ String[] classNameParts = fullyQualifiedClassName.split("\\.");
+ return classNameParts[classNameParts.length-1];
+ }
+}
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/WsdlgenBean.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/WsdlgenBean.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/WsdlgenBean.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/WsdlgenBean.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,160 @@
+package org.apache.axis2.tools.bean;
+
+import org.apache.axis2.util.CommandLineOptionConstants;
+import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption;
+import org.apache.ws.java2wsdl.Java2WSDLCodegenEngine;
+import java.util.HashMap;
+import java.util.Map;
+
+public class WsdlgenBean {
+
+ private String ClassName;
+ private String[] ClassPathList;
+ private String TargetNamespace;
+ private String TargetNamespacePrefix;
+ private String SchemaTargetNamespace;
+ private String ServiceName;
+ private String SchemaTargetNamespacePrefix;
+ private String OutputLocation ;
+ private String OutputWSDLName ;
+
+
+ public String getClassName() {
+ return ClassName ;
+ }
+
+ public void setClassName(String className){
+ this.ClassName=className ;
+ }
+
+ public String[] getClassPathList(){
+ return ClassPathList ;
+ }
+
+ public void setClassPathList(String[] classPathList) {
+ this.ClassPathList = classPathList;
+ }
+
+ public String getTargetNamespace() {
+ return TargetNamespace ;
+ }
+
+ public void setTargetNamespace(String targetNamespace) {
+ this.TargetNamespace = targetNamespace;
+ }
+
+ public String getTargetNamespacePrefix() {
+ return TargetNamespacePrefix ;
+ }
+
+ public void setTargetNamespacePrefix(String targetNamespacePrefix) {
+ this.TargetNamespacePrefix = targetNamespacePrefix;
+ }
+
+ public String getSchemaTargetNamespace() {
+ return SchemaTargetNamespace ;
+ }
+
+ public void setSchemaTargetNamespace (String schemaTargetNameSpace) {
+ this.SchemaTargetNamespace = schemaTargetNameSpace ;
+ }
+
+ public String getSchemaTargetNamespacePrefix () {
+ return SchemaTargetNamespacePrefix ;
+ }
+
+ public void setSchemaTargetNamespacePrefix (String schemaTargetNameSpacePrefix) {
+ this.SchemaTargetNamespacePrefix = schemaTargetNameSpacePrefix ;
+ }
+
+ public String getOutputLocation(){
+ return OutputLocation ;
+ }
+
+ public void setOutputLocation(String outputLoaction){
+ this.OutputLocation =outputLoaction ;
+ }
+
+ public String getOutputWSDLName(){
+ return OutputWSDLName ;
+ }
+
+ public void setOutputWSDLName(String outputWSDLName){
+ this.OutputWSDLName =outputWSDLName ;
+ }
+
+ public String getServiceName(){
+ return ServiceName ;
+ }
+
+ public void setServiceName(String serviceName){
+ this.ServiceName =serviceName ;
+ }
+
+ public Map fillOptionMap() {
+
+ Map optionMap = new HashMap();
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .CLASSNAME_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants.Java2WSDLConstants.CLASSNAME_OPTION ,
+ new String[]{getClassName() })
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .CLASSPATH_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .CLASSPATH_OPTION ,
+ getClassPathList())
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .TARGET_NAMESPACE_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .TARGET_NAMESPACE_OPTION ,
+ new String[]{getTargetNamespace() })
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .TARGET_NAMESPACE_PREFIX_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .TARGET_NAMESPACE_PREFIX_OPTION ,
+ new String[]{getTargetNamespacePrefix()})
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_OPTION ,
+ new String[]{getSchemaTargetNamespace() })
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .SERVICE_NAME_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .SERVICE_NAME_OPTION ,
+ new String[]{getServiceName() })
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION ,
+ new String[]{getSchemaTargetNamespacePrefix() })
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .OUTPUT_LOCATION_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .OUTPUT_LOCATION_OPTION ,
+ new String[]{getOutputLocation()})
+ );
+
+ optionMap.put(CommandLineOptionConstants.Java2WSDLConstants .OUTPUT_FILENAME_OPTION ,
+ new Java2WSDLCommandLineOption(CommandLineOptionConstants .Java2WSDLConstants .OUTPUT_FILENAME_OPTION ,
+ new String[]{getOutputWSDLName()})
+ );
+
+ return optionMap;
+
+ }
+
+ public void generate() throws Exception {
+
+ try {
+
+ Java2WSDLCodegenEngine java2WSDL=new Java2WSDLCodegenEngine(fillOptionMap());
+ java2WSDL.generate();
+
+ } catch (Throwable e) {
+
+ throw new Exception("Code generation failed due to " + e.getLocalizedMessage());
+ }
+
+ }
+}
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/BottomPanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/BottomPanel.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/BottomPanel.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/BottomPanel.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,154 @@
+package org.apache.axis2.tools.java2wsdl;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.StringWriter;
+
+
+public class BottomPanel extends JPanel implements ActionListener {
+ public static JButton btnBack;
+ public static JButton btnNext;
+ public static JButton btnFinish;
+ public static JButton btnCancel;
+ // public static
+
+ private Java2WSDLFrame java2WSDLFrame;
+ final JFileChooser fc=new JFileChooser();
+
+ public BottomPanel(Java2WSDLFrame java2WSDLFrame) {
+
+ this.java2WSDLFrame = java2WSDLFrame;
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+ BottomLayout customLayout = new BottomLayout();
+ setLayout(customLayout);
+
+ btnBack = new JButton("< Back");
+ btnBack.setEnabled(true);
+ btnBack.addActionListener(this);
+ add(btnBack);
+
+ btnNext = new JButton("Next >");
+ btnNext.addActionListener(this);
+ add(btnNext);
+
+ btnFinish = new JButton("Finish");
+ btnFinish.addActionListener(this);
+ add(btnFinish);
+
+ btnCancel = new JButton("Cancel");
+ btnCancel.addActionListener(this);
+ add(btnCancel);
+
+ setSize(getPreferredSize());
+
+ }
+
+
+ public static void setEnable(boolean back,boolean next, boolean finish, boolean cancel) {
+
+ btnBack.setEnabled(back);
+ btnNext.setEnabled(next);
+ btnFinish.setEnabled(finish);
+ btnCancel.setEnabled(cancel);
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ Object obj = e.getSource();
+ if (obj == btnNext) {
+ if (java2WSDLFrame.plMiddle .isVisible() ) {
+
+ if(java2WSDLFrame.plMiddle.testLoading()){
+ java2WSDLFrame.increasePanelID();
+ java2WSDLFrame.setPanel();
+ }else
+ setEnable(false,false,false,true);
+
+ }else if(java2WSDLFrame.opPanel.isVisible()){
+
+ java2WSDLFrame.increasePanelID();
+ java2WSDLFrame.setPanel();
+
+ }
+
+ } else if(obj == btnBack){
+
+ java2WSDLFrame.backButtonImpl();
+
+ } else if (obj == btnCancel) {
+
+ java2WSDLFrame.dispose();
+ Thread.currentThread().setContextClassLoader(java2WSDLFrame.getClassLoader());
+
+ } else if(obj ==btnFinish ){
+ try {
+
+ java2WSDLFrame.generatecode();
+ StringWriter writer = new StringWriter();
+ JOptionPane.showMessageDialog(java2WSDLFrame, "Code genaration Successful !" + writer.toString(),
+ "Axis2 code generation", JOptionPane.INFORMATION_MESSAGE );
+
+ java2WSDLFrame.dispose();
+
+ } catch (Exception e1) {
+
+ StringWriter writer = new StringWriter();
+ JOptionPane.showMessageDialog(java2WSDLFrame, "Code genaration failed!" + writer.toString(),
+ "Axis2 code generation", JOptionPane.ERROR_MESSAGE);
+ java2WSDLFrame.dispose();
+
+ }
+ }
+
+ }
+}
+
+class BottomLayout implements LayoutManager {
+ public BottomLayout() {
+ }
+
+ public void addLayoutComponent(String name, Component comp) {
+ }
+
+ public void removeLayoutComponent(Component comp) {
+ }
+
+ public Dimension preferredLayoutSize(Container parent) {
+ Dimension dim = new Dimension(0, 0);
+
+ Insets insets = parent.getInsets();
+ dim.width = 475 + insets.left + insets.right;
+ dim.height = 60 + insets.top + insets.bottom;
+
+ return dim;
+ }
+
+ public Dimension minimumLayoutSize(Container parent) {
+ return new Dimension(0, 0);
+ }
+
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+
+ Component c;
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 152, insets.top + 10, 80, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 232, insets.top + 10, 80, 24);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 312, insets.top + 10, 80, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 395, insets.top + 10, 80, 24);
+ }
+ }
+}
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/JarFileFilter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/JarFileFilter.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/JarFileFilter.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/JarFileFilter.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,35 @@
+package org.apache.axis2.tools.java2wsdl;
+
+import javax.swing.filechooser.FileFilter;
+import java.io.File;
+
+public class JarFileFilter extends FileFilter {
+
+ public boolean accept(File file) {
+ if(file.isDirectory() ){
+ return true;
+ }
+ String extension = getExtension(file);
+ if(extension != null){
+ return extension .equals("jar");
+ }
+ return false;
+
+ }
+
+ public String getDescription() {
+ return ".jar" ;
+ }
+
+ private String getExtension(File file){
+ String ext = null;
+ String s = file.getName();
+ int i = s.lastIndexOf('.');
+
+ if (i > 0 && i < s.length() - 1) {
+ ext = s.substring(i + 1).toLowerCase();
+ }
+ return ext;
+ }
+}
+
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/Java2WSDLFrame.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/Java2WSDLFrame.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/Java2WSDLFrame.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/Java2WSDLFrame.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,238 @@
+package org.apache.axis2.tools.java2wsdl;
+
+import org.apache.axis2.tools.idea.*;
+import org.apache.axis2.tools.bean.WsdlgenBean;
+import com.intellij.openapi.project.Project;
+import javax.swing.*;
+import java.awt.*;
+
+
+public class Java2WSDLFrame extends JFrame {
+
+ // first panel
+ ImagePanel imgPanel;
+ MiddlePanel plMiddle;
+ BottomPanel plBottom;
+ OptionPanel opPanel;
+ OutputPanel outPanel;
+
+
+ private int panleID = 0;
+ private ClassLoader classLoader;
+ Project project;
+
+ private WsdlgenBean wsdlgenBean;
+
+ public Java2WSDLFrame (){
+
+ windowLayout customLayout = new windowLayout(1);
+
+ setTitle("Axis2 Codegen Wizard ");
+
+ getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
+ getContentPane().setLayout(customLayout);
+
+ wsdlgenBean=new WsdlgenBean();
+ //add image panel
+
+ imgPanel = new ImagePanel();
+ imgPanel.setCaptions(" Java source/classpath selection"
+ , " Welcome to the Axis2 Java source code generation wizard.");
+ getContentPane().add(imgPanel);
+
+ //add bottom panel
+
+ plBottom = new BottomPanel(this);
+ BottomPanel.setEnable(false,false, false, true);
+ getContentPane().add(plBottom);
+
+ //add middle panel
+
+ plMiddle = new MiddlePanel(this,wsdlgenBean);
+ getContentPane().add(plMiddle);
+
+ //add option panel
+
+ opPanel =new OptionPanel(this,wsdlgenBean);
+ opPanel.setVisible(false);
+ getContentPane().add(opPanel);
+
+ //add option panel
+
+ outPanel=new OutputPanel(wsdlgenBean);
+ outPanel .setVisible(false);
+ getContentPane() .add(outPanel);
+
+ //add progress panel
+
+
+
+ Dimension dim = new Dimension(550, 550);
+ setSize(dim);
+ setBounds(200, 200, dim.width, dim.height);
+
+
+ }
+ public void setProject(Project project) {
+ this.project = project;
+ }
+ public ClassLoader getClassLoader() {
+ return classLoader;
+ }
+ public void setClassLoader(ClassLoader classLoader) {
+ this.classLoader = classLoader;
+ }
+ public void increasePanelID() {
+ panleID++;
+ }
+
+ public void generatecode() throws Exception {
+
+ wsdlgenBean.generate();
+ }
+
+
+ public void setPanel(){
+
+ panleID++;
+
+ switch (panleID) {
+ case 1:{
+ this.imgPanel .setCaptions(" Java source/classpath selection" ,
+ " Welcome to the Axis2 Java source code generation wizard.");
+
+ this.plMiddle .setVisible(true);
+
+ this.opPanel.setVisible(false);
+
+ this.outPanel .setVisible(false);
+
+ plBottom.setEnable(false,false,false, true);
+
+ break;
+ }
+ case 2: {
+ this.imgPanel .setCaptions(" Options"
+ , " Select from custom or default");
+
+ this.plMiddle .setVisible(false);
+
+ this.opPanel.setVisible(true);
+
+ this.outPanel .setVisible(false);
+
+ plBottom.setEnable(true,true, false, true);
+
+ break;
+ }
+ case 3: {
+ this.imgPanel .setCaptions(" Options"
+ , " Select from custom or default");
+
+ this.plMiddle .setVisible(false);
+
+ this.opPanel.setVisible(false);
+
+ this.outPanel .setVisible(true);
+
+ plBottom.setEnable(true,false, true, true);
+
+ break;
+ }
+ }
+
+ }
+ public void backButtonImpl(){
+ panleID--;
+ switch (panleID) {
+ case 1: {
+
+ this.imgPanel .setCaptions(" Java source/classpath selection" ,
+ " Welcome to the Axis2 Java source code generation wizard.");
+ this.opPanel.setVisible(false);
+ this.plMiddle.setVisible(true);
+ this.outPanel.setVisible(false);
+ BottomPanel.setEnable(false,true, false, true);
+ break;
+ }
+
+ case 2: {
+
+ this.imgPanel .setCaptions(" Options"
+ , " Select from custom or default");
+ this.plMiddle .setVisible(false);
+ this.outPanel.setVisible(false);
+ this.opPanel.setVisible(true);
+ BottomPanel.setEnable(true,true, false, true);
+ break;
+ }
+
+ case 3: {
+
+ this.imgPanel .setCaptions(" Options"
+ , " Select from custom or default");
+ this.plMiddle .setVisible(false);
+ this.outPanel.setVisible(true);
+ this.opPanel.setVisible(false);
+ BottomPanel.setEnable(true,false, true, true);
+ break;
+
+ }
+
+ }
+
+ }
+
+}
+
+class windowLayout implements LayoutManager{
+
+ int paneID;
+
+ public windowLayout(int panelid) {
+ paneID = panelid;
+ }
+ public void addLayoutComponent(String name, Component comp) {
+ }
+ public void removeLayoutComponent(Component comp) {
+ }
+ public Dimension preferredLayoutSize(Container parent) {
+ Dimension dim = new Dimension(0, 0);
+
+ Insets insets = parent.getInsets();
+ dim.width = 550+ insets.left + insets.right;
+ dim.height = 600 + insets.top + insets.bottom;
+
+ return dim;
+ }
+ public Dimension minimumLayoutSize(Container parent) {
+ return new Dimension(0, 0);
+ }
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+
+ Component c;
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left, insets.top, 550, 80);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left, insets.top + 80, 500, 450);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left, insets.top + 80, 500, 450);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left, insets.top + 80, 500, 450);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left, insets.top + 525, 500, 50);
+ }
+
+ }
+
+}
\ No newline at end of file
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,346 @@
+package org.apache.axis2.tools.java2wsdl;
+
+import org.apache.axis2.tools.bean.ClassLoadingTestBean;
+import org.apache.axis2.tools.bean.WsdlgenBean;
+
+import javax.swing.*;
+import javax.swing.border.EtchedBorder;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import com.intellij.openapi.ui.MultiLineLabelUI;
+
+
+public class MiddlePanel extends JPanel implements ActionListener, MouseListener {
+
+ JLabel lblClass;
+ JLabel lblPath;
+ JLabel lblTest;
+ JLabel lblHint;
+
+ JTextField txtClass;
+
+ JButton btnFolder;
+ JButton btnJar;
+ JButton btnRemove;
+ JButton btnTest;
+
+ JList listPathDisply;
+ DefaultListModel listModel;
+
+ private String hint ="Hint : Please give the fully qualified class name, example :com.foo.BarService\n" +
+ " Then add the folder or the jar file which contains that class file.\n" +
+ " Finally check whether the class file can be loaded from the plugin.\n\n" +
+ " If the class that you are going to load contains any dependencies\n" +
+ " on other axis2 libraries ( for example like axiom*.jar), please add those\n" +
+ " libraries as well and try to load the class.";
+
+ final JFileChooser FileChooser =new JFileChooser();
+ final JFileChooser DirChooser=new JFileChooser();
+
+ private WsdlgenBean wsdlgenBean;
+ private Java2WSDLFrame java2WSDLFrame;
+
+ public MiddlePanel (Java2WSDLFrame java2WSDLFrame,WsdlgenBean wsdlgenBean){
+ this.wsdlgenBean = wsdlgenBean;
+ this.java2WSDLFrame =java2WSDLFrame;
+
+ MiddleLayout customLayout=new MiddleLayout();
+ setLayout(customLayout);
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+
+ //add class lable and comboBox
+
+ lblClass=new JLabel("Fully Qualified Class Name : ");
+ add(lblClass);
+
+ txtClass=new JTextField();
+ txtClass.addActionListener(this);
+ txtClass.addMouseListener(this);
+ add(txtClass);
+
+ //add folder and jar display
+
+ lblPath =new JLabel("Java class path entries.Select either folders or jar files ");
+ add(lblPath);
+
+ btnFolder=new JButton("Add Folder");
+ btnFolder .addActionListener(this);
+ add(btnFolder);
+
+ btnJar=new JButton("Add Jar");
+ btnJar.addActionListener(this);
+ add(btnJar);
+
+ btnRemove=new JButton("Remove");
+ btnRemove.addActionListener(this);
+ add(btnRemove);
+
+ listModel = new DefaultListModel();
+ listPathDisply =new JList(listModel);
+ add(listPathDisply);
+
+ //testting class loading
+
+ btnTest=new JButton("Test Class Loading");
+ btnTest .addActionListener(this);
+ add(btnTest);
+
+ lblTest=new JLabel(" ");
+ add(lblTest);
+
+ //Hint Area
+
+
+
+ lblHint =new JLabel(hint);
+ lblHint .setHorizontalTextPosition( SwingConstants.LEFT );
+ lblHint .setUI( new MultiLineLabelUI() );
+ add(lblHint );
+
+
+ setSize(getPreferredSize());
+
+ }
+
+
+
+ public void actionPerformed(ActionEvent e) {
+ Object obj=e.getSource();
+ if(obj == btnFolder ) {
+ DirChooser .setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ int returnVal = DirChooser.showOpenDialog(this);
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ DirChooser.setFileSelectionMode(JFileChooser .FILES_ONLY );
+ File newfile = DirChooser.getSelectedFile();
+ listModel.addElement(newfile.getAbsolutePath() );
+ BottomPanel.setEnable(false,true, false, true);
+ setDefaultPathAndName(newfile );
+ updateStatusTextField( false,"");
+
+ }
+
+ }else if(obj == btnJar ) {
+
+ FileChooser.setFileFilter(new JarFileFilter() );
+ int returnVal= FileChooser.showOpenDialog(this);
+ if(returnVal == JFileChooser .APPROVE_OPTION ){
+ File file = FileChooser.getSelectedFile();
+ listModel.addElement(file.getAbsolutePath() );
+ BottomPanel.setEnable(false,true, false, true);
+ setDefaultPathAndName(file );
+ updateStatusTextField(false,"");
+ }
+
+ } else if( obj == btnRemove){
+
+ handleRemove();
+
+ }else if(obj == btnTest ){
+ if(!testLoading()){
+ BottomPanel.setEnable(false,false,false,true);
+
+ }else {
+ BottomPanel.setEnable(false,true,true,true);
+ wsdlgenBean.setClassPathList(getClassPathlist());
+ wsdlgenBean.setClassName(txtClass.getText().trim() );
+ }
+
+ }else if(obj ==txtClass ){
+ if (txtClass.getText() != null && !txtClass.getText().trim().equals("")) {
+ BottomPanel.setEnable(false,true, false, true);
+ wsdlgenBean.setClassName(txtClass.getText().trim());
+ }
+ }
+ }
+ private void setDefaultPathAndName(File file) {
+ String defualtOutPutPath=file.getParent();
+ System.out.println(defualtOutPutPath );
+ wsdlgenBean.setOutputLocation(defualtOutPutPath );
+ wsdlgenBean.setOutputWSDLName("services.wsdl");
+
+ }
+
+ public void mouseClicked(MouseEvent e) {
+ Object obj = e.getSource();
+ if (obj == txtClass) {
+ if (txtClass.getText() != null && !txtClass.getText().trim().equals("")) {
+ BottomPanel.setEnable(false,true, false, true);
+ // set wsdlgen FileName
+ wsdlgenBean.setClassName(txtClass.getText().trim());
+ }
+ }
+
+ }
+
+ public void mouseEntered(MouseEvent e){
+ }
+
+ public void mouseExited(MouseEvent e) {
+ Object obj = e.getSource();
+ if (obj == txtClass) {
+ if (txtClass.getText() != null && !txtClass.getText().trim().equals("")) {
+ BottomPanel.setEnable(false,true, false, true);
+ // set wsdlgen FileName
+ wsdlgenBean.setClassName(txtClass.getText().trim());
+ }
+ }
+ }
+
+ public void mousePressed(MouseEvent e) {
+ Object obj = e.getSource();
+ if (obj == txtClass) {
+ if (txtClass.getText() != null && !txtClass.getText().trim().equals("")) {
+ BottomPanel.setEnable(false,true, false, true);
+ // set wsdlgen FileName
+ wsdlgenBean.setClassName(txtClass.getText().trim());
+ }
+ }
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ Object obj = e.getSource();
+ if (obj == txtClass) {
+ if (txtClass.getText() != null && !txtClass.getText().trim().equals("")) {
+ BottomPanel.setEnable(false,true, false, true);
+
+ // set wsdlgen FileName
+ wsdlgenBean.setClassName(txtClass.getText().trim());
+ }
+ }
+ }
+
+ public void updateStatusTextField(boolean success,String text){
+ if (success){
+ java2WSDLFrame.opPanel.setDefaultNamespaces(txtClass.getText());
+ // java2WSDLFrame.outPanel.setNamespaceDefaults();
+ }
+ lblTest.setText(text);
+ }
+
+
+ // Pops up the file browse dialog box
+
+ private void handleRemove() {
+ int[] selectionIndices = listPathDisply .getSelectedIndices() ;
+ for (int i=0;i<selectionIndices.length;i++){
+ listModel .remove(selectionIndices[i]);
+ }
+ updateStatusTextField(false,"");
+ }
+
+ public String[] getClassPathlist(){
+ Object [] listObject = listModel.toArray() ;
+ String [] listString =new String[listObject.length];
+ for(int i=0 ;i<listObject.length ;i++){
+ listString[i]=listObject[i].toString() ;
+ }
+ return listString ;
+ }
+
+ public boolean testLoading(){
+ java.util.List errorListener = new ArrayList();
+ String [] listString =getClassPathlist() ;
+ if (!ClassLoadingTestBean.tryLoadingClass(txtClass.getText(),listString,errorListener)){
+ Iterator it = errorListener.iterator();
+ while(it.hasNext()){
+ Object nextObject = it.next();
+ String errorMessage = nextObject==null? "Unknown error!" :nextObject.toString();
+ lblTest .setText(errorMessage );
+ updateStatusTextField(false,errorMessage);
+ }
+ return false;
+ }else{
+
+ java2WSDLFrame.opPanel.setDefaultNamespaces(txtClass.getText().trim() );
+ updateStatusTextField(true,"Class file loaded successfully");
+ return true;
+ }
+
+ }
+
+
+}
+class MiddleLayout implements LayoutManager{
+
+ public MiddleLayout (){
+
+ }
+ public void addLayoutComponent(String name, Component comp) {
+ }
+ public void removeLayoutComponent(Component comp) {
+ }
+ public Dimension preferredLayoutSize(Container parent) {
+ Dimension dim = new Dimension(0, 0);
+
+ Insets insets = parent.getInsets();
+ dim.width = 450 + insets.left + insets.right;
+ dim.height = 500 + insets.top + insets.bottom;
+
+ return dim;
+ }
+ public Dimension minimumLayoutSize(Container parent) {
+ return new Dimension(0, 0);
+ }
+
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+
+ Component c;
+ //class
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 20, 180, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 200, insets.top + 20, 300, 24);
+ }
+ //folders and jar
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 54, 500, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 88, 144, 24);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 190, insets.top + 88,144, 24);
+ }
+ c = parent.getComponent(5);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 355, insets.top + 88, 144, 24);
+ }
+ c = parent.getComponent(6);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 130 , 475, 150);
+ }
+ //test class loading
+ c= parent.getComponent(7);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 300 , 144 , 24);
+ }
+ c= parent.getComponent(8);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 180, insets.top + 300 , 475 , 24);
+ }
+ //hint Area
+ c= parent.getComponent(9);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 330 , 500 ,100);
+ }
+
+ }
+
+
+
+}
\ No newline at end of file
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OptionPanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OptionPanel.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OptionPanel.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OptionPanel.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,192 @@
+package org.apache.axis2.tools.java2wsdl;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+import org.apache.axis2.tools.bean.NamespaceFinder ;
+import org.apache.axis2.tools.bean.WsdlgenBean;
+
+
+public class OptionPanel extends JPanel implements ActionListener {
+
+ private JLabel lblNsp;
+ private JLabel lblNspPrefix;
+ private JLabel lblSchemaTargetNsp;
+ private JLabel lblSchemaTargetNspPrefix;
+ private JLabel lblService;
+
+ private JTextField txtNsp;
+ private JTextField txtNspPrefix;
+ private JTextField txtSchemaTargetNsp;
+ private JTextField txtSchemaTargetNspPrefix;
+ private JTextField txtService;
+
+ Java2WSDLFrame java2WSDLFrame;
+ WsdlgenBean wsdlgenBean;
+
+ public OptionPanel(Java2WSDLFrame java2WSDLFrame,WsdlgenBean wsdlgenBean){
+
+ this.java2WSDLFrame =java2WSDLFrame ;
+ this.wsdlgenBean=wsdlgenBean;
+
+ OptionLayout customLayout=new OptionLayout();
+ setLayout(customLayout);
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+
+ //add lable and textfield
+
+ lblNsp =new JLabel("Target Namespace");
+ add(lblNsp);
+
+ txtNsp=new JTextField();
+ add(txtNsp);
+
+ lblNspPrefix =new JLabel("Target Namespace Prefix");
+ add(lblNspPrefix );
+
+ txtNspPrefix =new JTextField();
+ add(txtNspPrefix);
+
+ lblSchemaTargetNsp=new JLabel("Schema Target Namespace");
+ add(lblSchemaTargetNsp);
+
+ txtSchemaTargetNsp =new JTextField();
+ add(txtSchemaTargetNsp);
+
+ lblSchemaTargetNspPrefix =new JLabel("Schema Target Namespace Prefix");
+ add(lblSchemaTargetNspPrefix);
+
+ txtSchemaTargetNspPrefix =new JTextField();
+ add(txtSchemaTargetNspPrefix);
+
+ lblService =new JLabel("Service Name");
+ add(lblService );
+
+ txtService =new JTextField();
+ add(txtService );
+
+ setSize(getPreferredSize());
+
+ }
+
+ public String getTargetNamespace() {
+ return txtNsp.getText() ;
+ }
+
+ public String getTargetNamespacePrefix() {
+ return txtNspPrefix .getText() ;
+ }
+
+
+ public String getSchemaTargetNamespace() {
+ return txtSchemaTargetNsp.getText() ;
+ }
+
+ public String getSchemaTargetNamespacePrefix () {
+ return txtSchemaTargetNspPrefix .getText() ;
+ }
+ public String getServiceName(){
+ return txtService .getText() ;
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+
+ }
+
+
+ public void setDefaultNamespaces(String fullyQualifiedClassName){
+ this.txtNsp.setText(NamespaceFinder.getTargetNamespaceFromClass(fullyQualifiedClassName));
+ this.txtSchemaTargetNsp .setText(NamespaceFinder.getSchemaTargetNamespaceFromClass(fullyQualifiedClassName) );
+ this.txtNspPrefix .setText(NamespaceFinder.getDefaultNamespacePrefix() );
+ this.txtSchemaTargetNspPrefix .setText(NamespaceFinder.getDefaultSchemaNamespacePrefix() );
+ this.txtService .setText(NamespaceFinder.getServiceNameText(fullyQualifiedClassName) );
+ setNamespaceDefaults();
+ }
+
+ private void setNamespaceDefaults(){
+ wsdlgenBean.setTargetNamespace(txtNsp.getText() );
+ wsdlgenBean.setTargetNamespacePrefix(txtNspPrefix .getText() );
+ wsdlgenBean.setSchemaTargetNamespace(txtSchemaTargetNsp .getText() );
+ wsdlgenBean.setSchemaTargetNamespacePrefix(txtSchemaTargetNspPrefix .getText() );
+ wsdlgenBean.setServiceName(txtService .getText() );
+ }
+}
+
+
+class OptionLayout implements LayoutManager {
+
+ public OptionLayout (){
+
+ }
+ public void addLayoutComponent(String name, Component comp){
+
+ }
+
+ public void removeLayoutComponent(Component comp){
+
+ }
+ public Dimension preferredLayoutSize(Container parent) {
+ Dimension dim = new Dimension(0, 0);
+
+ Insets insets = parent.getInsets();
+ dim.width = 500 + insets.left + insets.right;
+ dim.height =500 + insets.top + insets.bottom;
+
+ return dim;
+ }
+ public Dimension minimumLayoutSize(Container parent) {
+ return new Dimension(0, 0);
+ }
+
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+
+ Component c;
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top +20,200, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 225, insets.top + 20, 275, 24);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 60, 200, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 225, insets.top + 60, 275, 24);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 100, 200, 24);
+ }
+ c = parent.getComponent(5);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 225, insets.top + 100, 275, 24);
+ }
+ c = parent.getComponent(6);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 140, 200, 24);
+ }
+ c = parent.getComponent(7);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 225, insets.top + 140, 275, 24);
+ }
+ /*c = parent.getComponent(8);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 150, 200, 24);
+ }
+ c = parent.getComponent(9);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 225, insets.top + 150, 275, 24);
+ } */
+
+
+ }
+}
Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OutputPanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OutputPanel.java?view=auto&rev=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OutputPanel.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/OutputPanel.java Sun Mar 25 23:21:46 2007
@@ -0,0 +1,147 @@
+package org.apache.axis2.tools.java2wsdl;
+
+import org.apache.axis2.tools.bean.WsdlgenBean;
+
+import javax.swing.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.awt.*;
+
+
+public class OutputPanel extends JPanel implements ActionListener {
+
+ JLabel lblTitle;
+ JLabel lblLocation;
+ JLabel lblFileName;
+
+ JRadioButton rbtnAdd;
+ JRadioButton rbtnSave;
+
+ JTextField txtLocation;
+ JTextField txtFileName;
+
+ JButton btnBrowes;
+
+ final JFileChooser fc = new JFileChooser();
+ private WsdlgenBean wsdlgenBean;
+
+ public OutputPanel(WsdlgenBean wsdlgenBean){
+
+ this.wsdlgenBean=wsdlgenBean;
+
+ OptionLayout customLayout=new OptionLayout();
+ setLayout(customLayout);
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+
+ // Add label and textfield
+ lblTitle =new JLabel("Select the location where to put the output");
+ add(lblTitle );
+
+ rbtnAdd =new JRadioButton("Browes and Add the WSDL to a project on current workspace");
+ add(rbtnAdd );
+
+ rbtnSave =new JRadioButton("Browes and Save the WSDL file on local filesystem ");
+ add(rbtnSave );
+
+ lblLocation =new JLabel("OutPut Location");
+ add(lblLocation );
+
+ txtLocation =new JTextField();
+ add(txtLocation );
+
+ btnBrowes=new JButton("Browse...");
+ add(btnBrowes);
+
+ lblFileName =new JLabel("OutPut File Name");
+ add(lblFileName );
+
+ txtFileName =new JTextField();
+ add(txtFileName );
+
+ setSize(getPreferredSize());
+
+ initializeDefaultSettings();
+
+
+ }
+ protected void initializeDefaultSettings() {
+
+ txtLocation.setText(wsdlgenBean.getOutputLocation() );
+ txtFileName.setText(wsdlgenBean.getOutputWSDLName());
+
+ }
+ public void setNamespace(){
+ wsdlgenBean.setTargetNamespace(txtLocation .getText() );
+ wsdlgenBean.setTargetNamespacePrefix(txtFileName .getText() );
+
+ }
+
+
+
+ public void actionPerformed(ActionEvent e){
+
+ }
+}
+
+class OutputLayout implements LayoutManager{
+
+ public OutputLayout (){
+
+ }
+
+ public void addLayoutComponent(String name, Component comp) {
+ }
+ public void removeLayoutComponent(Component comp) {
+ }
+ public Dimension preferredLayoutSize(Container parent) {
+ Dimension dim = new Dimension(0, 0);
+
+ Insets insets = parent.getInsets();
+ dim.width = 400 + insets.left + insets.right;
+ dim.height = 400 + insets.top + insets.bottom;
+
+ return dim;
+ }
+ public Dimension minimumLayoutSize(Container parent) {
+ return new Dimension(0, 0);
+ }
+
+ public void layoutContainer(Container parent){
+ Insets insets = parent.getInsets();
+
+ Component c;
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 30, 400, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 80, 400, 24);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 110, 400, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 140, 100, 24);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 200, insets.top + 140, 200, 24);
+ }
+ c = parent.getComponent(5);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 350, insets.top + 140, 80, 24);
+ }
+ c = parent.getComponent(6);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 170, 100, 24);
+ }
+ c = parent.getComponent(6);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 200, insets.top + 170, 200, 24);
+ }
+ }
+}
\ No newline at end of file
Modified: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java?view=diff&rev=522437&r1=522436&r2=522437
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java (original)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java Sun Mar 25 23:21:46 2007
@@ -2,6 +2,8 @@
import com.intellij.openapi.project.Project;
import org.apache.axis2.tools.idea.Java2CodeFrame;
+import org.apache.axis2.tools.java2wsdl.Java2WSDLFrame;
+
import javax.swing.*;
import java.awt.*;
@@ -33,12 +35,16 @@
public class Axi2PluginPage extends JFrame implements ActionListener {
ButtonGroup cbg;
JRadioButton service;
- JRadioButton javawsdl;
+ JRadioButton wsdlGen;
+ JRadioButton sourceGen;
JButton butOK;
JButton butCancle;
JPanel imglbl;
Project project;
- Java2CodeFrame win;
+ Java2CodeFrame winj2c;
+ Java2WSDLFrame winj2w;
+
+
public Axi2PluginPage() {
setBackground(Color.white);
@@ -52,15 +58,26 @@
getContentPane().setLayout(customLayout);
setTitle("Axis2 Plugin");
cbg = new ButtonGroup();
+
+ /*Create a service archive Radio Button */
+
service = new JRadioButton("Create a service archive", true);
service.setToolTipText("Hepls package classes, libs and WSDLs to create a archive that can be deployed in Axis2");
cbg.add(service);
getContentPane().add(service);
- javawsdl = new JRadioButton("WSDL2Code code generation", false);
- javawsdl.setToolTipText("Helps generate skeletons and stubs for a given WSDL");
- cbg.add(javawsdl);
- getContentPane().add(javawsdl);
+ /*Create a Code code generation Radio Button */
+
+ wsdlGen = new JRadioButton("Generate a WSDL from a java source file", false);
+ wsdlGen.setToolTipText("you can generate a WSDL from a java source file ");
+ cbg.add(wsdlGen);
+ getContentPane().add(wsdlGen);
+
+ sourceGen =new JRadioButton("Generate java source code from a WSDL file",true);
+ sourceGen.setToolTipText("you can generate java code from a WSDL");
+ cbg.add(sourceGen);
+ getContentPane().add(sourceGen);
+
butOK = new JButton("OK");
butOK.addActionListener(this);
@@ -95,16 +112,25 @@
} else if (obj == butOK) {
this.hide();
setVisible(false);
- if (javawsdl.isSelected()) {
+ if (wsdlGen.isSelected()) {
- win = new Java2CodeFrame();
- win.setResizable(false);
- win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- win.setProject(project);
- win.pack();
- win.show();
+ winj2c = new Java2CodeFrame();
+ winj2c.setResizable(false);
+ winj2c.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ winj2c.setProject(project);
+ winj2c.pack();
+ winj2c.show();
- } else {
+ } else if (sourceGen.isSelected() ) {
+
+ winj2w = new Java2WSDLFrame();
+ winj2w.setResizable(false);
+ winj2w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ winj2w.setProject(project);
+ winj2w.pack();
+ winj2w.show();
+
+ }else{
ServiceArciveFrame window = new ServiceArciveFrame();
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setResizable(false);
@@ -136,7 +162,7 @@
Insets insets = parent.getInsets();
dim.width = 320 + insets.left + insets.right;
- dim.height = 240 + insets.top + insets.bottom;
+ dim.height = 264 + insets.top + insets.bottom;
return dim;
}
@@ -150,21 +176,25 @@
Component c;
c = parent.getComponent(0);
if (c.isVisible()) {
- c.setBounds(insets.left + 24, insets.top + 104, 208, 24);
+ c.setBounds(insets.left + 24, insets.top + 104, 296, 24);
}
c = parent.getComponent(1);
if (c.isVisible()) {
- c.setBounds(insets.left + 24, insets.top + 136, 208, 24);
+ c.setBounds(insets.left + 24, insets.top + 136, 296, 24);
}
- c = parent.getComponent(2);
+ c = parent.getComponent(2);
if (c.isVisible()) {
- c.setBounds(insets.left + 130, insets.top + 200, 80, 24);
+ c.setBounds(insets.left + 24, insets.top + 168, 296, 24);
}
c = parent.getComponent(3);
if (c.isVisible()) {
- c.setBounds(insets.left + 215, insets.top + 200, 80, 24);
+ c.setBounds(insets.left + 130, insets.top + 210, 80, 24);
}
c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 215, insets.top + 210, 80, 24);
+ }
+ c = parent.getComponent(5);
if (c.isVisible()) {
c.setBounds(insets.left, insets.top, 320, 80);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org