axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r232943 - in /webservices/axis/trunk/archive/java/scratch/ideapluging_deepal: ./ codegen/ codegen/src/ codegen/src/META-INF/ codegen/src/icons/ codegen/src/org/ codegen/src/org/apache/ codegen/src/org/apache/axis2/ codegen/src/org/apache/ax...
Date Tue, 16 Aug 2005 05:43:47 GMT
Author: deepal
Date: Mon Aug 15 22:42:34 2005
New Revision: 232943

URL: http://svn.apache.org/viewcvs?rev=232943&view=rev
Log:
axis2 idea pluging , will be there in next release

Added:
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/META-INF/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/META-INF/plugin.xml
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.gif   (with props)
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.png   (with props)
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/garbage.png   (with props)
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/bean/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/bean/CodegenBean.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ActionsPlugin.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/BottomPanel.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/FirstPanel.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ImagePanel.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/OutPutPane.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/PlugingClassLoader.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/SecondPanel.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ServiceArchiveCreator.java
    webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/Window.java

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/META-INF/plugin.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/META-INF/plugin.xml?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/META-INF/plugin.xml (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/META-INF/plugin.xml Mon Aug 15 22:42:34 2005
@@ -0,0 +1,58 @@
+<!DOCTYPE idea-plugin PUBLIC "Plugin/DTD" "http://plugins.intellij.net/plugin.dtd">
+<!--<idea-plugin>-->
+<idea-plugin url="http://www.apache.org/~deepal">
+
+    <!-- Plugin name -->
+    <name>Axis Service Archive </name>
+
+    <!-- Description -->
+    <description> To generate Service archive file for a given class </description>
+
+    <!-- Plugin version -->
+    <version>1.0</version>
+
+    <!-- Plugin's vendor -->
+    <!--  <vendor logo="/general/ijLogo.png">IntelliJ</vendor>-->
+    <vendor email="deepal@apache.org">Deepal Jayasinghe </vendor>
+
+    <!-- the IDEA build number which works with plugin -->
+    <idea-version since-build="2000" />
+
+    <!-- Plugin's application components -->
+    <application-components>
+        <component>
+            <!-- Component's implementation class -->
+            <implementation-class>org.apache.axis2.tools.idea.ActionsPlugin</implementation-class>
+
+            <!-- Component's interface class -->
+            <interface-class>org.apache.axis2.tools.idea.ActionsPlugin</interface-class>
+        </component>
+    </application-components>
+    <!-- Component's actions -->
+    <actions>
+        <!-- We use "PluginName.ComponentName.ActionName" notation for "id" to avoid conflicts -->
+        <action id="ActionsSample.ActionsPlugin.ServiceArchiveCreator"
+            class="org.apache.axis2.tools.idea.ServiceArchiveCreator"
+            text="Axis2 Web service Creator" description="Create Service Archive">
+            <keyboard-shortcut first-keystroke="control alt G" second-keystroke="C" keymap="$default"/>
+            <mouse-shortcut keystroke="ctrl alt button2" keymap="$default"/>
+        </action>
+
+        <!--    <group id="Actions.ActionsPlugin.SampleGroup" text="S_ample" description="Sample group">-->
+        <group id="Actions.ActionsPlugin.SampleGroup" text="A_xis2" description="Axis2 Group">
+            <reference id="ActionsSample.ActionsPlugin.ServiceArchiveCreator"/>
+            <separator/>
+            <add-to-group group-id="MainMenu" anchor="last"/>
+            <add-to-group group-id="MainToolBar" anchor="before" relative-to-action="HelpTopics"/>
+        </group>
+
+        <!--the group below contains only the "Hello World" action defined above -->
+        <group>
+            <reference id="ActionsSample.ActionsPlugin.ServiceArchiveCreator"/>
+            <!--the group is added to the editor popup menu-->
+            <add-to-group group-id="EditorPopupMenu" anchor="after" relative-to-action="CutCopyPasteGroup"/>
+        </group>
+
+    </actions>
+
+</idea-plugin>

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.gif
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.gif?rev=232943&view=auto
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.png
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.png?rev=232943&view=auto
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/asf-feather.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/garbage.png
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/garbage.png?rev=232943&view=auto
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/icons/garbage.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/bean/CodegenBean.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/bean/CodegenBean.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/bean/CodegenBean.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/bean/CodegenBean.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,227 @@
+package org.apache.axis2.tools.bean;
+
+import org.apache.axis2.wsdl.util.URLProcessor;
+import org.apache.axis2.wsdl.codegen.*;
+import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
+import org.apache.wsdl.WSDLDescription;
+
+import javax.wsdl.WSDLException;
+import java.util.Map;
+import java.util.HashMap;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.File;
+
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 21, 2005
+ * Time: 2:41:26 PM
+ */
+public class CodegenBean {
+    private String WSDLFileName = null;
+    private String output = "E:/CD";
+    private String packageName = URLProcessor.DEFAULT_PACKAGE;
+    private String language = CommandLineOptionConstants.LanguageNames.JAVA;
+
+    private boolean asyncOnly = false;
+    private boolean syncOnly = false;
+    private boolean serverSide = false;
+    private boolean testcase = false;
+    private boolean generateServerXml = false;
+    /**
+     *
+     */
+    public Map fillOptionMap(boolean isAyncOnly,
+                             boolean isSyncOnly,
+                             boolean isServerSide,
+                             boolean isServerXML,
+                             boolean isTestCase,
+                             String WSDLFileName,
+                             String packageName,
+                             String selectedLanguage,
+                             String outputLocation) {
+        Map optionMap = new HashMap();
+        //WSDL file name
+        optionMap.put(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
+                new CommandLineOption(
+                        CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
+                        getStringArray(WSDLFileName)));
+
+        //Async only
+        if (isAyncOnly) {
+            optionMap.put(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
+                    new CommandLineOption(
+                            CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
+                            new String[0]));
+        }
+        //sync only
+        if (isSyncOnly) {
+            optionMap.put(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
+                    new CommandLineOption(
+                            CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
+                            new String[0]));
+        }
+        //serverside
+        if (isServerSide) {
+            optionMap.put(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
+                    new CommandLineOption(
+                            CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
+                            new String[0]));
+            //server xml
+            if (isServerXML) {
+                optionMap.put(
+                        CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
+                        new CommandLineOption(
+                                CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
+                                new String[0]));
+            }
+        }
+        //test case
+        if (isTestCase) {
+            optionMap.put(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
+                    new CommandLineOption(
+                            CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
+                            new String[0]));
+        }
+        //package name
+        optionMap.put(CommandLineOptionConstants.PACKAGE_OPTION,
+                new CommandLineOption(
+                        CommandLineOptionConstants.PACKAGE_OPTION,
+                        getStringArray(packageName)));
+        //selected language
+        optionMap.put(CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
+                new CommandLineOption(
+                        CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
+                        getStringArray(selectedLanguage)));
+        //output location
+        optionMap.put(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
+                new CommandLineOption(
+                        CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
+                        getStringArray(outputLocation)));
+
+        // System.out.println(page3.getOutputLocation());
+        return optionMap;
+    }
+
+
+    private String[] getStringArray(String value) {
+        String[] values = new String[1];
+        values[0] = value;
+        return values;
+    }
+
+    public WSDLDescription getWOM(String wsdlLocation) throws WSDLException,
+            IOException {
+        InputStream in = new FileInputStream(new File(wsdlLocation));
+        return WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in).getDescription();
+    }
+
+    public void execute() throws Exception {
+        Map optionsMap = fillOptionMap(
+                isAsyncOnly(),
+                isSyncOnly(),
+                isServerSide(),
+                isGenerateServerXml(),
+                isTestcase(),
+                getWSDLFileName(),
+                getPackageName(),
+                getLanguage(),
+                getOutput());
+        CommandLineOptionParser parser = new CommandLineOptionParser(optionsMap);
+        CodeGenerationEngine codegen = new CodeGenerationEngine(parser);
+        codegen.generate();
+    }
+
+    public String getWSDLFileName() {
+        return WSDLFileName;
+    }
+
+    public void setWSDLFileName(String WSDLFileName) {
+        this.WSDLFileName = WSDLFileName;
+    }
+
+    public boolean isSyncOnly() {
+        return syncOnly;
+    }
+
+    public void setSyncOnly(boolean syncOnly) {
+        this.syncOnly = syncOnly;
+    }
+
+    public boolean isAsyncOnly() {
+        return asyncOnly;
+    }
+
+    public void setAsyncOnly(boolean asyncOnly) {
+        this.asyncOnly = asyncOnly;
+    }
+
+    public String getLanguage() {
+        return language;
+    }
+
+    public void setLanguage(String language) {
+        this.language = language;
+    }
+
+    public String getPackageName() {
+        return packageName;
+    }
+
+    public void setPackageName(String packageName) {
+        this.packageName = packageName;
+    }
+
+    public String getOutput() {
+        return output;
+    }
+
+    public void setOutput(String output) {
+        this.output = output;
+    }
+
+    public boolean isServerSide() {
+        return serverSide;
+    }
+
+    public void setServerSide(boolean serverSide) {
+        this.serverSide = serverSide;
+    }
+
+    public boolean isGenerateServerXml() {
+        return generateServerXml;
+    }
+
+    public void setGenerateServerXml(boolean generateServerXml) {
+        this.generateServerXml = generateServerXml;
+    }
+
+    public boolean isTestcase() {
+        return testcase;
+    }
+
+    public void setTestcase(boolean testcase) {
+        this.testcase = testcase;
+    }
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ActionsPlugin.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ActionsPlugin.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ActionsPlugin.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ActionsPlugin.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,37 @@
+package org.apache.axis2.tools.idea;
+
+import com.intellij.openapi.components.ApplicationComponent;
+
+/**
+ * <h3>SampleApplicationPlugin</h3>
+ *
+ * Application level plugin sample showing IDEA <b>OpenAPI</b> basics.<br>
+ * Implements <code>ApplicationComponent</code> interface.
+ *
+ */
+public class ActionsPlugin implements ApplicationComponent {
+
+  /**
+   * Method is called after plugin is already created and configured. Plugin can start to communicate with
+   * other plugins only in this method.
+   */
+  public void initComponent() {
+      
+  }
+
+  /**
+   * This method is called on plugin disposal.
+   */
+  public void disposeComponent() {
+  }
+
+  /**
+   * Returns the name of component
+   *
+   * @return String representing component name. Use PluginName.ComponentName notation
+   *  to avoid conflicts.
+   */
+  public String getComponentName() {
+    return "ActionsSample.ActionsPlugin";
+  }
+}

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/BottomPanel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/BottomPanel.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/BottomPanel.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/BottomPanel.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,133 @@
+package org.apache.axis2.tools.idea;
+
+import com.intellij.openapi.ui.Messages;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.io.StringWriter;
+import java.io.PrintWriter;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 20, 2005
+ * Time: 3:38:12 PM
+ */
+public class BottomPanel extends JPanel implements ActionListener{
+    public static JButton btnNext;
+    public static JButton btnFinish;
+    public static JButton btnCancel;
+
+    private Window  window;
+
+    public BottomPanel(Window window) {
+        this.window = window;
+        setFont(new Font("Helvetica", Font.PLAIN, 12));
+        BottomLayout customLayout = new BottomLayout();
+
+        setLayout(customLayout);
+
+        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 next , boolean finish , boolean cancel){
+        btnNext.setEnabled(next);
+        btnFinish.setEnabled(finish);
+        btnCancel.setEnabled(cancel);
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        Object obj = e.getSource();
+        if(obj == btnCancel){
+            window.setVisible(false);
+            Thread.currentThread().setContextClassLoader(window.getClassLoader());
+        }   else if (obj == btnFinish){
+            try {
+                window.generatecode();
+                JOptionPane.showMessageDialog(window, "Code genaration successful!",
+                    "Axis2 codegeneration", JOptionPane.INFORMATION_MESSAGE);
+                window.setVisible(false);
+            } catch (Exception e1) {
+                StringWriter writer = new StringWriter();
+                e1.printStackTrace(new PrintWriter(writer));
+                JOptionPane.showMessageDialog(window, "Code genaration failed!" + writer.toString(),
+                    "Axis2 codegeneration", JOptionPane.ERROR_MESSAGE);
+                window.setVisible(false);
+            }
+        }   else if (obj == btnNext){
+            window.setPane();
+        }
+    }
+}
+
+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 = 541 + insets.left + insets.right;
+        dim.height = 87 + insets.top + insets.bottom;
+
+        return dim;
+    }
+
+    public Dimension minimumLayoutSize(Container parent) {
+        Dimension dim = new Dimension(0, 0);
+        return dim;
+    }
+
+    public void layoutContainer(Container parent) {
+        Insets insets = parent.getInsets();
+
+        Component c;
+        c = parent.getComponent(0);
+        if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+24,80,24);}
+        c = parent.getComponent(1);
+        if (c.isVisible()) {c.setBounds(insets.left+312,insets.top+24,80,24);}
+        c = parent.getComponent(2);
+        if (c.isVisible()) {c.setBounds(insets.left+392,insets.top+24,80,24);}
+    }
+}
+

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/FirstPanel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/FirstPanel.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/FirstPanel.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/FirstPanel.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,156 @@
+package org.apache.axis2.tools.idea;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import javax.swing.filechooser.FileFilter;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import org.apache.axis2.tools.idea.BottomPanel;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 20, 2005
+ * Time: 3:35:47 PM
+ */
+public class FirstPanel extends JPanel implements ActionListener {
+
+    JLabel lblWSDL;
+    JTextField txtWSDL;
+    JButton btnBrowse;
+    final JFileChooser fc = new JFileChooser();
+    private CodegenBean codegenBean;
+
+    public FirstPanel(CodegenBean codegenBean) {
+        this.codegenBean = codegenBean;
+        FirstPanelLayout customLayout = new FirstPanelLayout();
+        setLayout(customLayout);
+        setFont(new Font("Helvetica", Font.PLAIN, 12));
+        lblWSDL = new JLabel("WSDL File");
+        add(lblWSDL);
+
+        txtWSDL = new JTextField("");
+        add(txtWSDL);
+
+        btnBrowse = new JButton("Browse...");
+        add(btnBrowse);
+        btnBrowse.addActionListener(this);
+
+        setSize(getPreferredSize());
+
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        Object obj = e.getSource();
+        if(obj == btnBrowse){
+            fc.setFileFilter(new WSDLFileFilter());
+            int returnVal = fc.showOpenDialog(this);
+            if (returnVal == JFileChooser.APPROVE_OPTION) {
+                File file = fc.getSelectedFile();
+                txtWSDL.setText(file.getAbsolutePath());
+                BottomPanel.setEnable(true , false , true);
+                codegenBean.setWSDLFileName(file.getAbsolutePath());
+            } else {
+                System.out.println("no file");
+            }
+
+        }
+
+    }
+}
+
+class WSDLFileFilter extends FileFilter {
+
+    public boolean accept(File f) {
+        if (f.isDirectory()) {
+            return true;
+        }
+        String extension = getExtension(f);
+        if (extension != null) {
+            if (extension.equals("wsdl")) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+
+        return false;
+
+    }
+
+    public String getDescription() {
+        return ".wsdl";
+    }
+
+    private String getExtension(File f) {
+        String ext = null;
+        String s = f.getName();
+        int i = s.lastIndexOf('.');
+
+        if (i > 0 &&  i < s.length() - 1) {
+            ext = s.substring(i+1).toLowerCase();
+        }
+        return ext;
+    }
+
+}
+
+class FirstPanelLayout implements LayoutManager {
+
+    public FirstPanelLayout() {
+    }
+
+    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 = 541 + insets.left + insets.right;
+        dim.height = 204 + insets.top + insets.bottom;
+
+        return dim;
+    }
+
+    public Dimension minimumLayoutSize(Container parent) {
+        Dimension dim = new Dimension(0, 0);
+        return dim;
+    }
+
+    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,72,24);}
+        c = parent.getComponent(1);
+        if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+8,350,24);}
+        c = parent.getComponent(2);
+        if (c.isVisible()) {c.setBounds(insets.left+448,insets.top+8,90,24);}
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ImagePanel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ImagePanel.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ImagePanel.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ImagePanel.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,116 @@
+package org.apache.axis2.tools.idea;
+
+import javax.swing.*;
+import java.awt.*;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 20, 2005
+ * Time: 9:33:14 PM
+ */
+public class ImagePanel extends JPanel{
+    JLabel lblImage;
+    JLabel labTop;
+    JLabel lblBottom;
+    ImageIcon apachelogo ;
+
+    public ImagePanel() {
+        ImageLayout customLayout = new ImageLayout();
+        setLayout(customLayout);
+
+        java.net.URL resource = ImagePanel.class.getResource("/icons/asf-feather.png");
+        apachelogo = new ImageIcon(resource);
+
+        lblImage = new JLabel(apachelogo);
+        add(lblImage);
+        lblImage.setBackground(Color.white);
+
+        labTop = new JLabel();
+        labTop.setBackground(Color.white);
+        add(labTop);
+        labTop.setFont(new Font("Helvetica", Font.BOLD, 12));
+
+        lblBottom = new JLabel();
+        add(lblBottom);
+        lblBottom.setBackground(Color.white);
+        lblBottom.setFont(new Font("Helvetica", Font.PLAIN, 10));
+
+        setSize(getPreferredSize());
+        this.setBackground(Color.white);
+    }
+
+    public void setCaptions(String lbl1 , String lbl2){
+        labTop.setText(lbl1);
+        lblBottom.setText(lbl2);
+    }
+}
+
+class ImageLayout implements LayoutManager {
+
+    public ImageLayout() {
+    }
+
+    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 = 535 + insets.left + insets.right;
+        dim.height = 77 + insets.top + insets.bottom;
+
+        return dim;
+    }
+
+    public Dimension minimumLayoutSize(Container parent) {
+        Dimension dim = new Dimension(0, 0);
+        return dim;
+    }
+
+    public void layoutContainer(Container parent) {
+        Insets insets = parent.getInsets();
+
+        Component c;
+        c = parent.getComponent(0);
+        if (c.isVisible()) {c.setBounds(insets.left+368,insets.top+0,168,80);}
+        c = parent.getComponent(1);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+0,368,40);}
+        c = parent.getComponent(2);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+40,368,40);}
+    }
+}
+
+
+//
+//    public ImagePanel() {
+////        apachelogo = new ImageIcon("/icons/asf-feather.gif");
+//        java.net.URL resource = ImagePanel.class.getResource("/icons/asf-feather.png");
+//        apachelogo = new ImageIcon(resource);
+//        JLabel lblWSDL = new JLabel(apachelogo);
+//        add(lblWSDL);
+//        setSize(getPreferredSize());
+//
+//    }
+//}

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/OutPutPane.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/OutPutPane.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/OutPutPane.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/OutPutPane.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,116 @@
+package org.apache.axis2.tools.idea;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 22, 2005
+ * Time: 12:52:31 PM
+ */
+public class OutPutPane extends JPanel implements ActionListener{
+    JLabel lbloutput;
+    JTextField txtoutput;
+    JButton btwBrowse;
+    private CodegenBean cogenbean ;
+    final JFileChooser fc = new JFileChooser();
+
+    public OutPutPane(CodegenBean bean) {
+        this.cogenbean = bean;
+        OutPutPaneLayout customLayout = new OutPutPaneLayout();
+
+        setLayout(customLayout);
+
+        lbloutput = new JLabel("Output Path");
+        add(lbloutput);
+
+        txtoutput = new JTextField("");
+        add(txtoutput);
+
+        btwBrowse = new JButton("Browse..");
+        add(btwBrowse);
+        btwBrowse.addActionListener(this);
+
+        setSize(getPreferredSize());
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        Object obj = e.getSource();
+        if(obj == btwBrowse){
+            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+            int returnVal = fc.showOpenDialog(this);
+            if (returnVal == JFileChooser.APPROVE_OPTION) {
+                File file = fc.getSelectedFile();
+                cogenbean.setOutput(file.getAbsolutePath());
+                txtoutput.setText(file.getAbsolutePath());
+            } else {
+                System.out.println("no file");
+            }
+        }
+    }
+}
+
+class OutPutPaneLayout implements LayoutManager {
+
+    public OutPutPaneLayout() {
+    }
+
+    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 = 611 + insets.left + insets.right;
+        dim.height = 57 + insets.top + insets.bottom;
+
+        return dim;
+    }
+
+    public Dimension minimumLayoutSize(Container parent) {
+        Dimension dim = new Dimension(0, 0);
+        return dim;
+    }
+
+    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,72,24);}
+        c = parent.getComponent(1);
+        if (c.isVisible()) {c.setBounds(insets.left+88,insets.top+8,354,24);}
+        c = parent.getComponent(2);
+        if (c.isVisible()) {c.setBounds(insets.left+450,insets.top+8,80,24);}
+    }
+}
+

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/PlugingClassLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/PlugingClassLoader.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/PlugingClassLoader.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/PlugingClassLoader.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,185 @@
+package org.apache.axis2.tools.idea;
+
+import com.intellij.openapi.ui.Messages;
+
+import java.io.*;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 22, 2005
+ * Time: 2:25:59 PM
+ */
+public class PlugingClassLoader extends URLClassLoader {
+
+    //urls which gives to create the classLoader
+    private URL[] urls;
+
+    //To keep jar files inside /lib directory in the main jar
+    private ArrayList lib_jars_list;
+
+
+    /**
+     * PlugingClassLoader is exetend form URLClassLoader , and the constructor
+     * has not overide the super constroctor , but has done some stuff to find out
+     * jar fils inside /lib director
+     *
+     * @param urls   <code>URL</code>
+     * @param parent parent classloader <code>ClassLoader</code>
+     */
+    public PlugingClassLoader(URL[] urls, ClassLoader parent) {
+        super(urls, parent);
+        this.urls = urls;
+        lib_jars_list = new ArrayList();
+        findLibJars();
+    }
+
+    /**
+     * This just search for jar files inside /lib dirctory and if there are any then those
+     * will be added to the arraylit (only the name of the jar file)
+     */
+    private void findLibJars() {
+        /**
+         * though the URL array can contains one or more urls , I have only consider the
+         * first one , that is this classLoader is only for Axis2 stuff and the classloader
+         * is created by Deployment , so there wont be any chance to have more the one urls for
+         * the URL array list
+         */
+        File file = new File(urls[0].getFile());
+        try {
+            ZipInputStream zin = new ZipInputStream(new FileInputStream(file));
+            ZipEntry entry;
+            String entryName = "";
+            while ((entry = zin.getNextEntry()) != null) {
+                entryName = entry.getName();
+                /**
+                 * id the entry name start with /lib and end with .jar
+                 * then those entry name will be added to the arraylist
+                 */
+                if (entryName != null && (entryName.startsWith("lib/") ||
+                        entryName.startsWith("Lib/")) &&
+                        entryName.endsWith(".jar")) {
+                    lib_jars_list.add(entryName);
+                }
+            }
+            zin.close();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * @param name <code>String</code>  Name of the file to be loaded
+     * @return <code>Class</code> return a class object if it found else
+     *         will return null or classNotfoun exeption
+     *         <p/>
+     *         The method has ovride in the following way
+     *         1. called the super class and check to see wether the class is there
+     *         if the class is found then return that , else if super returns ClassNotfoundExeption
+     *         2. Check wether the entry corresponding to the class name exsit in one of jar files
+     *         in /lib director
+     *         3. If it is there get the byte array out of that and creat a Class object out of that
+     *         by calling "defineClass()" , if it sucssed then return that else
+     *         4. Throw classNotfound exeption
+     * @throws ClassNotFoundException
+     */
+    protected Class findClass(final String name)
+            throws ClassNotFoundException {
+        Class cla = null;
+        try {
+            boolean foundClass = false;
+            try {
+                cla = super.findClass(name);
+                foundClass = true;
+                return cla;
+            } catch (ClassNotFoundException e) {
+                foundClass = false;
+            }
+            if (!foundClass) {
+                byte raw[] = getBytes(name);
+                cla = defineClass(name, raw, 0, raw.length);
+                foundClass = true;
+                return cla;
+            }
+            if (!foundClass) {
+                throw new ClassNotFoundException("Class Not found : " + name);
+            }
+
+        } catch (Exception e) {
+
+        }
+        return null;
+    }
+
+    /**
+     * Read jar file (/lib) one by one , then for each file craete <code>ZipInputStream</code>
+     * that and check to see wether there is any entry eith given name if it found then
+     * Creat ByteArrayOutPutStream and get the class bytes to that .
+     * after goning throgh each and evry jar file if there is no entry with given name
+     * will throug a ClassNotFound execption
+     *
+     * @param filename <code>String</code>  Name of the file to be loaded (Class Name)
+     * @return bytt[]
+     * @throws java.io.IOException <code>Exception</code>
+     */
+    private byte[] getBytes(String filename) throws Exception {
+        String completeFileName = filename;
+        /**
+         * Replacing org.apache. -> org/apache/...
+         */
+        completeFileName = completeFileName.replace('.', '/').concat(".class");
+        byte raw[] = null;
+        for (int i = 0; i < lib_jars_list.size(); i++) {
+            String libjar_name = (String) lib_jars_list.get(i);
+            InputStream in = this.getResourceAsStream(libjar_name);
+            try {
+                ZipInputStream zin = new ZipInputStream(in);
+                ZipEntry entry;
+                String entryName = "";
+                while ((entry = zin.getNextEntry()) != null) {
+                    entryName = entry.getName();
+                    if (entryName != null &&
+                            entryName.endsWith(completeFileName)) {
+                        byte data[] = new byte[2048];
+                        ByteArrayOutputStream out = new ByteArrayOutputStream();
+                        int count;
+                        while ((count = zin.read(data, 0, 2048)) != -1) {
+                            out.write(data, 0, count);
+                        }
+                        raw = out.toByteArray();
+                        out.close();
+                        zin.close();
+                        return raw;
+                    }
+                }
+            } catch (IOException e) {
+                throw e;
+            }
+
+        }
+        throw new ClassNotFoundException("Class Not found : " + filename);
+    }
+}
+

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/SecondPanel.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/SecondPanel.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/SecondPanel.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/SecondPanel.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,155 @@
+package org.apache.axis2.tools.idea;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import java.awt.*;
+
+import org.apache.axis2.wsdl.codegen.CommandLineOptionConstants;
+import org.apache.axis2.tools.bean.CodegenBean;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 20, 2005
+ * Time: 10:52:36 PM
+ */
+public class SecondPanel extends JPanel {
+    JLabel lblol;
+    JComboBox comlanguage;
+    ButtonGroup cbg;
+    JRadioButton rdsynasyn;
+    JRadioButton rdsyn;
+    JRadioButton rdasync;
+    JLabel lblpakage;
+    JTextField txtpackage;
+    private CodegenBean codegenBean;
+
+    public SecondPanel(CodegenBean codegenBean) {
+        this.codegenBean = codegenBean;
+        SecondPanelLayout customLayout = new SecondPanelLayout();
+        setFont(new Font("Helvetica", Font.PLAIN, 12));
+        setLayout(customLayout);
+
+        lblol = new JLabel("   Select the output language");
+        add(lblol);
+
+        comlanguage = new JComboBox();
+        comlanguage.addItem("Java");
+        comlanguage.addItem("C#");
+        comlanguage.addItem("C++");
+        add(comlanguage);
+
+        cbg = new ButtonGroup();
+        rdsynasyn = new JRadioButton(" Generate both sync and async", true);
+        cbg.add(rdsynasyn);
+        add(rdsynasyn);
+
+        rdsyn = new JRadioButton(" Generate sync only", false);
+        cbg.add(rdsyn);
+        add(rdsyn);
+
+        rdasync = new JRadioButton(" Generate async only", false);
+        cbg.add(rdasync);
+        add(rdasync);
+
+        lblpakage = new JLabel("Set the package name");
+        add(lblpakage);
+
+        txtpackage = new JTextField("org.axis2");
+        add(txtpackage);
+
+        setSize(getPreferredSize());
+
+    }
+
+    public void fillBean(){
+        int index =comlanguage.getSelectedIndex();
+        switch(index ){
+            case 0: {
+                codegenBean.setLanguage(CommandLineOptionConstants.LanguageNames.JAVA);
+                break;
+            } case 1: {
+                codegenBean.setLanguage(CommandLineOptionConstants.LanguageNames.C_SHARP);
+                break;
+            } case 2 : {
+                codegenBean.setLanguage(CommandLineOptionConstants.LanguageNames.C_PLUS_PLUS);
+                break;
+            }
+        }
+        if(rdasync.isSelected()) {
+            codegenBean.setAsyncOnly(true);
+        } else if (rdsyn.isSelected()){
+            codegenBean.setSyncOnly(true);
+        } else {
+            codegenBean.setSyncOnly(false);
+            codegenBean.setAsyncOnly(false);
+        }
+        codegenBean.setPackageName(txtpackage.getText());
+    }
+}
+
+class SecondPanelLayout implements LayoutManager {
+
+    public SecondPanelLayout() {
+    }
+
+    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 = 565 + insets.left + insets.right;
+        dim.height = 235 + insets.top + insets.bottom;
+
+        return dim;
+    }
+
+    public Dimension minimumLayoutSize(Container parent) {
+        Dimension dim = new Dimension(0, 0);
+        return dim;
+    }
+
+    public void layoutContainer(Container parent) {
+        Insets insets = parent.getInsets();
+
+        Component c;
+        c = parent.getComponent(0);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+5,200,20);}
+        c = parent.getComponent(1);
+        if (c.isVisible()) {c.setBounds(insets.left+210,insets.top+5,160,20);}
+        c = parent.getComponent(2);
+        if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+30,250,24);}
+        c = parent.getComponent(3);
+        if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+55,150,24);}
+        c = parent.getComponent(4);
+        if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+80,150,24);}
+        c = parent.getComponent(5);
+        if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+110,200,24);}
+        c = parent.getComponent(6);
+        if (c.isVisible()) {c.setBounds(insets.left+210,insets.top+110,200,24);}
+    }
+}
+

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ServiceArchiveCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ServiceArchiveCreator.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ServiceArchiveCreator.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/ServiceArchiveCreator.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,55 @@
+package org.apache.axis2.tools.idea;
+
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+
+import javax.swing.*;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.io.File;
+
+public class ServiceArchiveCreator extends AnAction {
+    private ImageIcon myIcon;
+
+    public ServiceArchiveCreator() {
+        super("GC", "Create Service Archive File", null);
+    }
+
+    public void actionPerformed(AnActionEvent event) {
+//        Project project = (Project)event.getDataContext().getData(DataConstants.PROJECT);
+//        java.net.URL resource = ServiceArchiveCreator.class.getResource("/icons/garbage.png");
+//        String fileName = resource.toString();
+//        fileName =  fileName.replaceAll("%20"," ");
+//        fileName = fileName.replaceAll("jar:file:/","");
+//        int end_index = fileName.indexOf("!");
+//        fileName = fileName.substring(0,end_index);
+//        ClassLoader contextClasLoader =
+//        URL[] urlsToLoadFrom = new URL[0];
+//        try {
+//            File file = new File(fileName);
+//            urlsToLoadFrom = new URL[]{file.toURL()};
+//            PlugingClassLoader clasloader = new PlugingClassLoader(
+//                    urlsToLoadFrom,contextClasLoader);
+//            contextClasLoader = clasloader;
+//        } catch (MalformedURLException e) {
+//
+//        }
+        Window win = new Window();
+    //    win.setClassLoader(contextClasLoader);
+        win.showUI();
+//        System.gc();
+    }
+
+    public void update(AnActionEvent event) {
+        super.update(event);
+        Presentation presentation = event.getPresentation();
+        if (ActionPlaces.MAIN_TOOLBAR.equals(event.getPlace())) {
+            if (myIcon == null) {
+                java.net.URL resource = ServiceArchiveCreator.class.getResource("/icons/garbage.png");
+                myIcon = new ImageIcon(resource);
+            }
+            presentation.setIcon(myIcon);
+        }
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/Window.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/Window.java?rev=232943&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/Window.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ideapluging_deepal/codegen/src/org/apache/axis2/tools/idea/Window.java Mon Aug 15 22:42:34 2005
@@ -0,0 +1,190 @@
+package org.apache.axis2.tools.idea;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+
+import org.apache.axis2.tools.idea.*;
+
+/*
+* 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.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 19, 2005
+ * Time: 2:26:15 PM
+ */
+public class Window extends JFrame {
+    ImagePanel panel_3;
+    JPanel plMiddle;
+    BottomPanel lblBottom;
+    SecondPanel secondPanel;
+    OutPutPane outputpane;
+    private int panleID = 0;
+    private ClassLoader classLoader ;
+
+    // To keep the value of wsdl wizzard
+    private CodegenBean codegenBean;
+
+    public Window() {
+        windowLayout  customLayout = new windowLayout(1);
+
+        getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
+        getContentPane().setLayout(customLayout);
+
+        codegenBean = new CodegenBean();
+
+        panel_3 = new ImagePanel();
+        panel_3.setCaptions("  WSDL selection page"
+                ,"  Welcome to the Axis2 code generation wizard. Select the WSDL file");
+
+        getContentPane().add(panel_3);
+
+        plMiddle = new FirstPanel(codegenBean);
+        getContentPane().add(plMiddle);
+
+        lblBottom = new BottomPanel(this);
+        BottomPanel.setEnable(false , false , true);
+        getContentPane().add(lblBottom);
+
+        secondPanel = new SecondPanel(codegenBean);
+        secondPanel.setVisible(false);
+        getContentPane().add(secondPanel);
+
+        outputpane = new OutPutPane(codegenBean);
+        outputpane.setVisible(false);
+        getContentPane().add(outputpane);
+
+        Dimension dim = getPreferredSize();
+        setSize(dim);
+        setBounds(200,200,dim.width ,dim.height);
+        this.setResizable(false);
+    }
+
+    public ClassLoader getClassLoader() {
+        return classLoader;
+    }
+
+    public void setClassLoader(ClassLoader classLoader) {
+        this.classLoader = classLoader;
+    }
+
+    public void showUI(){
+        Window window = new Window();
+        window.setTitle("Axis2 Code generation");
+        window.pack();
+        window.show();
+    }
+
+    public void generatecode() throws Exception{
+        secondPanel.fillBean();
+        codegenBean.execute();
+    }
+
+
+    public void setPane(){
+        panleID ++;
+        switch(panleID){
+            case 1 : {
+                panel_3.setCaptions("  Options"
+                        ,"  Set the options for the code generation");
+                this.secondPanel.setVisible(true);
+                this.plMiddle.setVisible(false);
+                BottomPanel.setEnable(true , false , true);
+                break;
+            }
+            case 2 : {
+                panel_3.setCaptions("  Output"
+                        ,"  set the output project for the generated code");
+                this.secondPanel.setVisible(false);
+                this.plMiddle.setVisible(false);
+                this.outputpane.setVisible(true);
+                BottomPanel.setEnable(true , true , true);
+                break;
+            }
+        }
+    }
+
+    public void setMiddlerPanel(int panel){
+        this.panleID = panel;
+        if(panleID == 2){
+            panel_3.setCaptions("  Options"
+                    ,"  Set the options for the code generation");
+            this.secondPanel.setVisible(true);
+            this.plMiddle.setVisible(false);
+            BottomPanel.setEnable(true , true , true);
+        }
+        this.pack();
+        this.show();
+    }
+
+
+    public static void main(String[] args) {
+        Window window = new Window();
+        window.setTitle("Axis2 Code generation");
+        window.pack();
+        window.show();
+    }
+}
+
+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 = 541 + insets.left + insets.right;
+        dim.height = 300 + insets.top + insets.bottom;
+
+        return dim;
+    }
+
+    public Dimension minimumLayoutSize(Container parent) {
+        Dimension dim = new Dimension(0, 0);
+        return dim;
+    }
+
+    public void layoutContainer(Container parent) {
+        Insets insets = parent.getInsets();
+
+        Component c;
+        c = parent.getComponent(0);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+0,544,80);}
+        c = parent.getComponent(1);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+80,544,140);}
+        c = parent.getComponent(3);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+80,544,140);}
+        c = parent.getComponent(4);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+80,544,140);}
+        c = parent.getComponent(2);
+        if (c.isVisible()) {c.setBounds(insets.left+0,insets.top+220,544,50);}
+    }
+}



Mime
View raw message