You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by th...@apache.org on 2006/10/09 13:04:06 UTC

svn commit: r454339 - in /webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools: bean/SrcCompiler.java idea/OptionPane.java

Author: thilina
Date: Mon Oct  9 04:04:05 2006
New Revision: 454339

URL: http://svn.apache.org/viewvc?view=rev&rev=454339
Log:
Applying the second patch given at http://issues.apache.org/jira/browse/AXIS2-1303

Thanx keith...

Added:
    webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/SrcCompiler.java
    webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OptionPane.java

Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/SrcCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/SrcCompiler.java?view=auto&rev=454339
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/SrcCompiler.java (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/bean/SrcCompiler.java Mon Oct  9 04:04:05 2006
@@ -0,0 +1,70 @@
+package org.apache.axis2.tools.bean;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Javac;
+import org.apache.tools.ant.types.Path;
+
+import java.io.File;
+import java.net.URL;
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*
+*/
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: keith chapman
+ * Date: 28/09/2006
+ * Time: 16:35:06
+ */
+public class SrcCompiler extends Javac {
+
+    Project project;
+
+    public SrcCompiler() {
+        project = new Project();
+        this.setProject(project);
+        project.init();
+
+    }
+
+    public void compileSource(String tempPath) {
+
+        Path path;
+        File destDir = new File(tempPath + File.separator + "classes");
+        destDir.mkdir();
+
+        Path srcPath = new Path(project, tempPath + File.separator + "src");
+        this.setSrcdir(srcPath);
+        this.setDestdir(destDir);
+        this.setIncludes("**" + File.separator + "*.java, *.java");
+        URL url = getClass().getResource("/icons");
+        File lib = new File(url.getPath() + File.separator + ".." + File.separator + ".." + File.separator + "lib");
+        File[] files;
+        files = lib.listFiles();
+
+        Path classpath = new Path(project);
+        for (int count = 0; count < files.length; count++) {
+            path = new Path(project, files[count].getAbsolutePath());
+            classpath.add(path);
+        }
+        this.setClasspath(classpath);
+       this.setFork(false);
+        this.perform();
+
+    }
+}

Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OptionPane.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OptionPane.java?view=auto&rev=454339
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OptionPane.java (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OptionPane.java Mon Oct  9 04:04:05 2006
@@ -0,0 +1,196 @@
+package org.apache.axis2.tools.idea;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import javax.xml.namespace.QName;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.ArrayList;
+
+
+public class OptionPane extends JPanel implements ActionListener {
+
+
+    JLabel lblOption;
+    JRadioButton radDefaultClient;
+    JRadioButton radDefaultServer;
+    JRadioButton radDefaultBoth;
+
+    JRadioButton radCustom;
+    ButtonGroup buttonGroup;
+
+    CodegenBean codegenBean;
+
+    QName serviceName;
+    String portName;
+
+    public OptionPane() {
+        OptionPaneLayout customLayout = new OptionPaneLayout();
+
+
+        setLayout(customLayout);
+
+        lblOption = new JLabel("Please select your option");
+        add(lblOption);
+
+        buttonGroup = new ButtonGroup();
+
+        radDefaultBoth = new JRadioButton("Generate both client and server code with default configurations", true);
+        buttonGroup.add(radDefaultBoth);
+        radDefaultBoth.setActionCommand("radDefaultBoth");
+        add(radDefaultBoth);
+        radDefaultBoth.addActionListener(this);
+
+        radDefaultClient = new JRadioButton("Generate client code with default configurations");
+        radDefaultClient.setToolTipText("Generates the jar that contains the stub and places it in the lib folder under the project. The generated jar is added as a project dependancy ");
+        buttonGroup.add(radDefaultClient);
+        radDefaultClient.setActionCommand("radDefaultClient");
+        add(radDefaultClient);
+        radDefaultClient.addActionListener(this);
+
+        radDefaultServer = new JRadioButton("Generate Server code with default configurations");
+        buttonGroup.add(radDefaultServer);
+        radDefaultServer.setActionCommand("radDefaultServer");
+        radDefaultServer.setToolTipText("Generates the skeleton for the service and places it in a path specified by the user");
+        add(radDefaultServer);
+        radDefaultServer.addActionListener(this);
+
+        radCustom = new JRadioButton("Custom");
+        buttonGroup.add(radCustom);
+        radCustom.setActionCommand("radCustom");
+        radCustom.setToolTipText("Allows the user to choose custom settings for the generation process");
+        add(radCustom);
+        radCustom.addActionListener(this);
+
+
+        setSize(getPreferredSize());
+
+    }
+
+
+    public void actionPerformed(ActionEvent e) {
+
+        Object obj = e.getSource();
+
+        if (obj == radDefaultBoth) {
+            BottomPanel.setEnable(true, false, true);
+        } else if (obj == radDefaultClient) {
+            BottomPanel.setEnable(false, true, true);
+        } else if (obj == radDefaultServer) {
+            BottomPanel.setEnable(true, false, true);
+        } else if (obj == radCustom) {
+            BottomPanel.setEnable(true, false, true);
+        }
+
+    }
+
+    public void setDefaultBothConfigurations() {
+
+        setDefaultCommonConfigurations();
+    }
+
+    public void setDefaultCommonConfigurations() {
+
+        codegenBean.setLanguage("java");
+
+        codegenBean.setDatabindingName("adb");
+
+        codegenBean.setTestCase(false);
+
+        codegenBean.setServiceName(serviceName.getLocalPart());
+
+        codegenBean.setPortName(portName);
+
+        codegenBean.setPackageName("org.axis2");
+
+
+    }
+
+    public File setDefaultServerConfigurations() {
+        setDefaultCommonConfigurations();
+        codegenBean.setServerSide(true);
+        codegenBean.setServerXML(true);
+        File temp = codegenBean.getTemp();
+        codegenBean.setOutput(temp.getAbsolutePath());
+        return temp;
+
+    }
+
+    public File setDefaultClientConfigurations() {
+        setDefaultCommonConfigurations();
+        codegenBean.setServerSide(false);
+        codegenBean.setServerXML(false);
+        File temp = codegenBean.getTemp();
+        codegenBean.setOutput(temp.getAbsolutePath());
+
+        return temp;
+    }
+
+    public void setCodeGenBean(CodegenBean codegenBean) {
+        this.codegenBean = codegenBean;
+        codegenBean.readWSDL();
+        java.util.List serviceList = new ArrayList();
+        java.util.List portList = new ArrayList();
+
+        serviceList = codegenBean.getServiceList();
+        if (serviceList.size() > 0) {
+            serviceName = (QName) serviceList.get(0);
+            portList = codegenBean.getPortNameList(serviceName);
+        }
+        if (portList.size() > 0)
+            portName = (String) portList.get(0);
+    }
+
+
+    class OptionPaneLayout implements LayoutManager {
+        public void removeLayoutComponent(Component comp) {
+        }
+
+        public void layoutContainer(Container parent) {
+            Insets insets = parent.getInsets();
+
+            Component c;
+            c = parent.getComponent(0);
+            if (c.isVisible()) {
+                c.setBounds(insets.left + 8, insets.top + 8, 500, 24);
+            }
+            c = parent.getComponent(1);
+            if (c.isVisible()) {
+                c.setBounds(insets.left + 8, insets.top + 40, 500, 24);
+            }
+            c = parent.getComponent(2);
+            if (c.isVisible()) {
+                c.setBounds(insets.left + 8, insets.top + 70, 500, 24);
+            }
+            c = parent.getComponent(3);
+            if (c.isVisible()) {
+                c.setBounds(insets.left + 8, insets.top + 100, 500, 24);
+            }
+            c = parent.getComponent(4);
+            if (c.isVisible()) {
+                c.setBounds(insets.left + 8, insets.top + 130, 500, 24);
+            }
+
+        }
+
+        public void addLayoutComponent(String name, Component comp) {
+        }
+
+        public Dimension minimumLayoutSize(Container parent) {
+            return null;
+        }
+
+        public Dimension preferredLayoutSize(Container parent) {
+            Dimension dim = new Dimension(0, 0);
+
+            Insets insets = parent.getInsets();
+            dim.width = 565 + insets.left + insets.right;
+            dim.height = 300 + insets.top + insets.bottom;
+
+            return dim;
+        }
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org