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/19 13:47:52 UTC
svn commit: r465584 [2/3] - in
/webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache:
axis2/tools/bean/ axis2/tools/idea/ ideaplugin/frames/
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OutPutPane.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/OutPutPane.java?view=diff&rev=465584&r1=465583&r2=465584
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OutPutPane.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/OutPutPane.java Thu Oct 19 04:47:51 2006
@@ -1,232 +1,252 @@
-package org.apache.axis2.tools.idea;
-
-import com.intellij.openapi.module.Module;
-import org.apache.axis2.tools.bean.CodegenBean;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-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 22, 2005
- * Time: 12:52:31 PM
- */
-public class OutPutPane extends JPanel implements ActionListener {
- JTextField txtoutput;
- JButton btwBrowse;
-
- JRadioButton radCurrentProject;
- JLabel lblCurrentProject;
- JComboBox cmbCurrentProject;
- JRadioButton radCustomLocation;
-
- ButtonGroup buttonGroup;
-
- JLabel lblModuleSrc;
- JComboBox cmbModuleSrc;
- private CodegenBean cogenbean;
- final JFileChooser fc = new JFileChooser();
-
- public OutPutPane(CodegenBean bean) {
- this.cogenbean = bean;
- OutPutPaneLayout customLayout = new OutPutPaneLayout();
-
- setLayout(customLayout);
-
- buttonGroup = new ButtonGroup();
-
- txtoutput = new JTextField("");
- txtoutput.setEnabled(false);
- add(txtoutput);
-
- btwBrowse = new JButton("Browse..");
- add(btwBrowse);
- btwBrowse.setEnabled(false);
- btwBrowse.addActionListener(this);
-
-
- radCurrentProject = new JRadioButton("Add sources to current project", true);
- buttonGroup.add(radCurrentProject);
- radCurrentProject.setActionCommand("radCurrentProject");
- add(radCurrentProject);
- radCurrentProject.addActionListener(this);
-
- lblCurrentProject = new JLabel("Select Module");
- lblCurrentProject.setEnabled(true);
- add(lblCurrentProject);
-
- radCustomLocation = new JRadioButton("Select custom output location");
- buttonGroup.add(radCustomLocation);
- radCustomLocation.setActionCommand("radCustomLocation");
- add(radCustomLocation);
- radCustomLocation.addActionListener(this);
-
- cmbCurrentProject = new JComboBox();
- loadCmbCurrentProject();
- cmbCurrentProject.setEnabled(true);
- add(cmbCurrentProject);
-
- lblModuleSrc = new JLabel("Select Source Directory");
- lblModuleSrc.setEnabled(true);
- add(lblModuleSrc);
-
- cmbModuleSrc = new JComboBox();
- loadcmbModuleSrcProject();
- cmbModuleSrc.setEnabled(true);
- add(cmbModuleSrc);
-
-
- setSize(getPreferredSize());
- }
-
- public void loadCmbCurrentProject() {
- Module modules[] = cogenbean.getModules();
- int count =-1;
- if (modules != null) {
- for (count = 0; count < modules.length; count++) {
- cmbCurrentProject.addItem(modules[count].getName());
- }
- }
-
- if (count == -1) {
- radCurrentProject.setEnabled(false);
- radCustomLocation.setSelected(true);
- txtoutput.setEnabled(true);
- btwBrowse.setEnabled(true);
- }
- else{
- radCurrentProject.setEnabled(true);
- radCurrentProject.setSelected(true);
- txtoutput.setEnabled(false);
- btwBrowse.setEnabled(false);
- }
- }
-
- public void loadcmbModuleSrcProject() {
- String module = null;
- module = (String) cmbCurrentProject.getSelectedItem();
- if (module != null) {
- String src[] = cogenbean.getModuleSrc(module);
- for (int count = 0; count < src.length; count++) {
- cmbModuleSrc.addItem(src[count]);
- }
- }
- }
-
-
- 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");
- }
- } else if (obj == radCurrentProject) {
- lblCurrentProject.setEnabled(true);
- cmbCurrentProject.setEnabled(true);
- lblModuleSrc.setEnabled(true);
- cmbModuleSrc.setEnabled(true);
- txtoutput.setEnabled(false);
- btwBrowse.setEnabled(false);
-
- } else if (obj == radCustomLocation) {
- lblCurrentProject.setEnabled(false);
- cmbCurrentProject.setEnabled(false);
- lblModuleSrc.setEnabled(false);
- cmbModuleSrc.setEnabled(false);
- txtoutput.setEnabled(true);
- btwBrowse.setEnabled(true);
- }
- }
-}
-
-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) {
- return new Dimension(0, 0);
- }
-
- public void layoutContainer(Container parent) {
- Insets insets = parent.getInsets();
-
- Component c;
- c = parent.getComponent(2);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 8, 350, 24);
- }
- c = parent.getComponent(3);
- if (c.isVisible()) {
- c.setBounds(insets.left + 30, insets.top + 40, 150, 24);
- }
- c = parent.getComponent(5);
- if (c.isVisible()) {
- c.setBounds(insets.left + 200, insets.top + 40, 250, 24);
- }
- c = parent.getComponent(6);
- if (c.isVisible()) {
- c.setBounds(insets.left + 30, insets.top + 70, 150, 24);
- }
- c = parent.getComponent(7);
- if (c.isVisible()) {
- c.setBounds(insets.left + 200, insets.top + 70, 250, 24);
- }
- c = parent.getComponent(4);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 100, 350, 24);
- }
- c = parent.getComponent(0);
- if (c.isVisible()) {
- c.setBounds(insets.left + 30, insets.top + 130, 150, 24);
- }
- c = parent.getComponent(1);
- if (c.isVisible()) {
- c.setBounds(insets.left + 200, insets.top + 130, 150, 24);
- }
- }
-}
-
+package org.apache.axis2.tools.idea;
+
+import com.intellij.openapi.module.Module;
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+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 22, 2005
+ * Time: 12:52:31 PM
+ */
+public class OutPutPane extends JPanel implements ActionListener {
+ JTextField txtoutput;
+ JButton btwBrowse;
+
+ JRadioButton radCurrentProject;
+ JLabel lblCurrentProject;
+ JComboBox cmbCurrentProject;
+ JRadioButton radCustomLocation;
+
+ ButtonGroup buttonGroup;
+
+ JLabel lblModuleSrc;
+ JComboBox cmbModuleSrc;
+ boolean flag = true;
+ private CodegenBean cogenbean;
+ final JFileChooser fc = new JFileChooser();
+
+ public OutPutPane(CodegenBean bean) {
+ this.cogenbean = bean;
+ OutPutPaneLayout customLayout = new OutPutPaneLayout();
+
+ setLayout(customLayout);
+
+ buttonGroup = new ButtonGroup();
+
+ txtoutput = new JTextField("");
+ txtoutput.setEnabled(false);
+ add(txtoutput);
+
+ btwBrowse = new JButton("Browse..");
+ add(btwBrowse);
+ btwBrowse.setEnabled(false);
+ btwBrowse.addActionListener(this);
+
+
+ radCurrentProject = new JRadioButton("Add sources to current project", true);
+ buttonGroup.add(radCurrentProject);
+ radCurrentProject.setActionCommand("radCurrentProject");
+ add(radCurrentProject);
+ radCurrentProject.addActionListener(this);
+
+ lblCurrentProject = new JLabel("Select Module");
+ lblCurrentProject.setEnabled(true);
+ add(lblCurrentProject);
+
+ radCustomLocation = new JRadioButton("Select custom output location");
+ buttonGroup.add(radCustomLocation);
+ radCustomLocation.setActionCommand("radCustomLocation");
+ add(radCustomLocation);
+ radCustomLocation.addActionListener(this);
+
+ cmbCurrentProject = new JComboBox();
+ cmbCurrentProject.setEnabled(true);
+ add(cmbCurrentProject);
+
+ lblModuleSrc = new JLabel("Select Source Directory");
+ lblModuleSrc.setEnabled(true);
+ add(lblModuleSrc);
+
+ cmbModuleSrc = new JComboBox();
+ cmbModuleSrc.setEnabled(true);
+ add(cmbModuleSrc);
+
+
+// loadCmbCurrentProject();
+// loadcmbModuleSrcProject();
+
+
+ setSize(getPreferredSize());
+ }
+
+ public void loadCmbCurrentProject() {
+ Module modules[] = cogenbean.getModules();
+
+ if (modules != null) {
+ for (int count = 0; count < modules.length; count++) {
+ cmbCurrentProject.addItem(modules[count].getName());
+ }
+ }
+
+ }
+
+ public void loadcmbModuleSrcProject() {
+ String module = null;
+ module = (String) cmbCurrentProject.getSelectedItem();
+ int count = 0;
+ if (module != null) {
+ String src[] = cogenbean.getModuleSrc(module);
+ for ( count = 0; count < src.length; count++) {
+ cmbModuleSrc.addItem(src[count]);
+ }
+
+ count = src.length;
+ }
+
+ if (flag)
+ {
+ flag = false;
+
+ if (count == 0) {
+ radCurrentProject.setEnabled(false);
+ cmbCurrentProject.setEnabled(false);
+ cmbModuleSrc.setEnabled(false);
+ lblCurrentProject.setEnabled(false);
+ lblModuleSrc.setEnabled(false);
+ radCustomLocation.setSelected(true);
+ txtoutput.setEnabled(true);
+ btwBrowse.setEnabled(true);
+ }
+ else{
+ radCurrentProject.setEnabled(true);
+ cmbCurrentProject.setEnabled(true);
+ cmbModuleSrc.setEnabled(true);
+ lblCurrentProject.setEnabled(true);
+ lblModuleSrc.setEnabled(true);
+ radCurrentProject.setSelected(true);
+ txtoutput.setEnabled(false);
+ btwBrowse.setEnabled(false);
+ }
+ }
+ }
+
+
+ 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");
+ }
+ } else if (obj == radCurrentProject) {
+ lblCurrentProject.setEnabled(true);
+ cmbCurrentProject.setEnabled(true);
+ lblModuleSrc.setEnabled(true);
+ cmbModuleSrc.setEnabled(true);
+ txtoutput.setEnabled(false);
+ btwBrowse.setEnabled(false);
+
+ } else if (obj == radCustomLocation) {
+ lblCurrentProject.setEnabled(false);
+ cmbCurrentProject.setEnabled(false);
+ lblModuleSrc.setEnabled(false);
+ cmbModuleSrc.setEnabled(false);
+ txtoutput.setEnabled(true);
+ btwBrowse.setEnabled(true);
+ }
+ }
+}
+
+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) {
+ return new Dimension(0, 0);
+ }
+
+ public void layoutContainer(Container parent) {
+ Insets insets = parent.getInsets();
+
+ Component c;
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 8, 350, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 30, insets.top + 40, 150, 24);
+ }
+ c = parent.getComponent(5);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 200, insets.top + 40, 250, 24);
+ }
+ c = parent.getComponent(6);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 30, insets.top + 70, 150, 24);
+ }
+ c = parent.getComponent(7);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 200, insets.top + 70, 250, 24);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 100, 350, 24);
+ }
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 30, insets.top + 130, 150, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 200, insets.top + 130, 150, 24);
+ }
+ }
+}
+
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/SecondFrame.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/SecondFrame.java?view=diff&rev=465584&r1=465583&r2=465584
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/SecondFrame.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/SecondFrame.java Thu Oct 19 04:47:51 2006
@@ -1,343 +1,479 @@
-package org.apache.axis2.tools.idea;
-
-import org.apache.axis2.tools.bean.CodegenBean;
-
-import javax.swing.*;
-import javax.swing.border.BevelBorder;
-import javax.xml.namespace.QName;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-/*
-* 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.
-*
-*
-*/
-
-public class SecondFrame extends JPanel implements ActionListener {
-
- JLabel lblLangauge;
- JComboBox cmbLan;
-
- JLabel lblServiceName;
- JComboBox cmbServiceName;
-
- JLabel lblportName;
- JComboBox cmbPortName;
-
- JLabel lblpackgeName;
- JTextField txtPacakgeName;
-
- JLabel lbldbtype;
- JComboBox cmbdbtype;
-
- JCheckBox chkTestCase;
-
- JLabel lblClient;
-
- JRadioButton rdBoth;
- JRadioButton rdsyn;
- JRadioButton rdasync;
-
- JLabel lblServer;
-
- JCheckBox serverside;
- JCheckBox serviceXML;
-
- ButtonGroup buttonGroup;
-
- private CodegenBean codegenBean;
- java.util.List serviceNameList;
-
- public SecondFrame() {
- SecondFrameLayout customLayout = new SecondFrameLayout();
-
- setFont(new Font("Helvetica", Font.PLAIN, 12));
- setLayout(customLayout);
-
- BevelBorder b = new BevelBorder(BevelBorder.LOWERED);
- setBorder(b);
-
- lblLangauge = new JLabel("Select the output language");
- add(lblLangauge);
-
- cmbLan = new JComboBox();
- cmbLan.addItem("java");
- cmbLan.addItem("C#");
- cmbLan.setToolTipText("Select the language of the generated code");
- add(cmbLan);
-
- lblServiceName = new JLabel("Select ServiceName");
- add(lblServiceName);
-
- cmbServiceName = new JComboBox();
- add(cmbServiceName);
- cmbServiceName.setToolTipText("Select the name of the service that the code should be generated for");
- cmbServiceName.addActionListener(this);
-
- lblportName = new JLabel("Select Port Name");
- add(lblportName);
-
- cmbPortName = new JComboBox();
- cmbPortName.setToolTipText("Select the port name that the code should be generated for");
- add(cmbPortName);
-
- lblpackgeName = new JLabel("Select the package name");
- add(lblpackgeName);
-
- txtPacakgeName = new JTextField("org.axis2");
- txtPacakgeName.setToolTipText("Set the package name of the generated code");
- add(txtPacakgeName);
-
- lbldbtype = new JLabel("Select Databinding type");
- add(lbldbtype);
-
- cmbdbtype = new JComboBox();
- cmbdbtype.addItem("adb");
- cmbdbtype.addItem("xmlbeans");
- cmbdbtype.addItem("none");
- cmbdbtype.setToolTipText("Select the databinding framework to be used in the generation process");
- add(cmbdbtype);
-
- chkTestCase = new JCheckBox("Generate Test Case", true);
- chkTestCase.setToolTipText("A test case will be generated if this is checked");
- add(chkTestCase);
-
- lblClient = new JLabel("Client Side Options");
- add(lblClient);
-
- buttonGroup = new ButtonGroup();
-
- rdBoth = new JRadioButton("Generate both sync and async", true);
- buttonGroup.add(rdBoth);
- add(rdBoth);
-
- rdsyn = new JRadioButton("Generate sync only", false);
- buttonGroup.add(rdsyn);
- add(rdsyn);
-
- rdasync = new JRadioButton("Generate async only", false);
- buttonGroup.add(rdasync);
- add(rdasync);
-
- lblServer = new JLabel("Server Side Options");
- add(lblServer);
-
- serverside = new JCheckBox("Generate server side ", true);
- add(serverside);
-
- serviceXML = new JCheckBox("Generate default service.xml", true);
- add(serviceXML);
-
- Dimension dim = new Dimension(450, 300);
- setSize(dim);
- }
-
- public void setCodeGenBean(CodegenBean codegenBean) {
- this.codegenBean = codegenBean;
- codegenBean.readWSDL();
- serviceNameList = codegenBean.getServiceList();
- for (int i = 0; i < serviceNameList.size(); i++) {
- QName name = (QName) serviceNameList.get(i);
- cmbServiceName.addItem(name.getLocalPart());
- }
- }
-
- public void fillBean() {
- int index = cmbLan.getSelectedIndex();
- switch (index) {
- case 0: {
- codegenBean.setLanguage("java");
- break;
- }
- case 1: {
- codegenBean.setLanguage("c-sharp");
- break;
- }
- }
-
- index = cmbdbtype.getSelectedIndex();
- switch (index) {
- case 0: {
- codegenBean.setDatabindingName("adb");
- break;
- }
- case 1: {
- codegenBean.setDatabindingName("xmlbeans");
- break;
- }
- case 2: {
- codegenBean.setDatabindingName("none");
- break;
- }
- }
-
- if (rdasync.isSelected()) {
- codegenBean.setAsyncOnly(true);
- }
- if (rdsyn.isSelected()) {
- codegenBean.setSyncOnly(true);
- }
- if (serverside.isSelected()) {
- codegenBean.setServerSide(true);
- }
- if (chkTestCase.isSelected()) {
- codegenBean.setTestCase(true);
- }
- codegenBean.setPackageName(txtPacakgeName.getText());
- codegenBean.setServiceName(cmbServiceName.getSelectedItem().toString());
- codegenBean.setServiceName(cmbPortName.getSelectedItem().toString());
- }
-
- public void actionPerformed(ActionEvent e) {
- Object obj = e.getSource();
- if (obj == cmbServiceName) {
- int selindex = cmbServiceName.getSelectedIndex();
- java.util.List ports = codegenBean.getPortNameList((QName) serviceNameList.get(selindex));
- cmbPortName.removeAllItems();
- for (int i = 0; i < ports.size(); i++) {
- String portName = (String) ports.get(i);
- cmbPortName.addItem(portName);
- }
- }
- }
-}
-
-class SecondFrameLayout implements LayoutManager {
-
- public SecondFrameLayout() {
- }
-
- 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 = 575 + insets.left + insets.right;
- dim.height = 450 + 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;
-
- // Language selection
- c = parent.getComponent(0);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 10, 192, 24);
- }
- c = parent.getComponent(1);
- if (c.isVisible()) {
- c.setBounds(insets.left + 272, insets.top + 10, 176, 24);
- }
-
- // Service Name selection
- c = parent.getComponent(2);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 40, 192, 24);
- }
- c = parent.getComponent(3);
- if (c.isVisible()) {
- c.setBounds(insets.left + 272, insets.top + 40, 176, 24);
- }
-
- // Port Name Selection
- c = parent.getComponent(4);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 70, 192, 24);
- }
- c = parent.getComponent(5);
- if (c.isVisible()) {
- c.setBounds(insets.left + 272, insets.top + 70, 176, 24);
- }
-
- //Package NAme Selection
- c = parent.getComponent(6);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 100, 192, 24);
- }
- c = parent.getComponent(7);
- if (c.isVisible()) {
- c.setBounds(insets.left + 272, insets.top + 100, 176, 24);
- }
-
- // Data Binding Selection
- c = parent.getComponent(8);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 130, 192, 24);
- }
- c = parent.getComponent(9);
- if (c.isVisible()) {
- c.setBounds(insets.left + 272, insets.top + 130, 176, 24);
- }
-
- // Test Case Selection
- c = parent.getComponent(10);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 160, 208, 24);
- }
-
- // Client side options
- c = parent.getComponent(11);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 190, 168, 24);
- }
-
- // Service invocation both,sync,async
- c = parent.getComponent(12);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 220, 220, 24);
- }
- c = parent.getComponent(13);
- if (c.isVisible()) {
- c.setBounds(insets.left + 230, insets.top + 220, 140, 24);
- }
- c = parent.getComponent(14);
- if (c.isVisible()) {
- c.setBounds(insets.left + 380, insets.top + 220, 160, 24);
- }
-
- // Server side options
- c = parent.getComponent(15);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 250, 168, 24);
- }
-
- // Generate serverside, generate service XML
- c = parent.getComponent(16);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 280, 200, 24);
- }
- c = parent.getComponent(17);
- if (c.isVisible()) {
- c.setBounds(insets.left + 228, insets.top + 280, 200, 24);
- }
-
-
- }
-}
-
+package org.apache.axis2.tools.idea;
+
+import org.apache.axis2.tools.bean.CodegenBean;
+
+import javax.swing.*;
+import javax.swing.border.BevelBorder;
+import javax.xml.namespace.QName;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import com.intellij.openapi.module.Module;
+/*
+* 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.
+*
+*
+*/
+
+public class SecondFrame extends JPanel implements ActionListener {
+
+ JLabel lblLangauge;
+ JComboBox cmbLan;
+
+ JLabel lblServiceName;
+ JComboBox cmbServiceName;
+
+ JLabel lblportName;
+ JComboBox cmbPortName;
+
+ JLabel lblpackgeName;
+ JTextField txtPacakgeName;
+
+ JLabel lbldbtype;
+ JComboBox cmbdbtype;
+
+ JCheckBox chkTestCase;
+
+ JRadioButton clientSide;
+
+
+ JRadioButton rdBoth;
+ JRadioButton rdsyn;
+ JRadioButton rdasync;
+
+ JRadioButton serverSide;
+ JCheckBox serviceXML;
+
+ JCheckBox serverSideInterface;
+
+ JRadioButton all;
+
+ ButtonGroup buttonGroup;
+
+ ButtonGroup generationType;
+
+ CodegenBean codegenBean;
+ java.util.List serviceNameList;
+
+ public SecondFrame() {
+ SecondFrameLayout customLayout = new SecondFrameLayout();
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+ setLayout(customLayout);
+
+
+
+ lblLangauge = new JLabel("Select the output language");
+ add(lblLangauge);
+
+ cmbLan = new JComboBox();
+ cmbLan.addItem("java");
+ cmbLan.addItem("C#");
+ cmbLan.setToolTipText("Select the language of the generated code");
+ add(cmbLan);
+
+ lblServiceName = new JLabel("Select Service Name");
+ add(lblServiceName);
+
+ cmbServiceName = new JComboBox();
+ add(cmbServiceName);
+ cmbServiceName.setToolTipText("Select the name of the service that the code should be generated for");
+ cmbServiceName.addActionListener(this);
+
+ lblportName = new JLabel("Select Port Name");
+ add(lblportName);
+
+ cmbPortName = new JComboBox();
+ cmbPortName.setToolTipText("Select the port name that the code should be generated for");
+ add(cmbPortName);
+
+ lblpackgeName = new JLabel("Select the package name");
+ add(lblpackgeName);
+
+ txtPacakgeName = new JTextField("org.axis2");
+ txtPacakgeName.setToolTipText("Set the package name of the generated code");
+ add(txtPacakgeName);
+
+ lbldbtype = new JLabel("Select Databinding type");
+ add(lbldbtype);
+
+ cmbdbtype = new JComboBox();
+ cmbdbtype.addItem("adb");
+ cmbdbtype.addItem("xmlbeans");
+ cmbdbtype.addItem("none");
+ cmbdbtype.setToolTipText("Select the databinding framework to be used in the generation process");
+ add(cmbdbtype);
+
+ chkTestCase = new JCheckBox("Generate Test Case", true);
+ chkTestCase.setVisible(false);
+ chkTestCase.setToolTipText("A test case will be generated if this is checked");
+ add(chkTestCase);
+
+ generationType = new ButtonGroup();
+
+ JSeparator clintSep = new JSeparator(JSeparator.HORIZONTAL);
+ add(clintSep);
+
+ clientSide = new JRadioButton("Generate Client Side",true);
+ generationType.add(clientSide);
+ clientSide.addActionListener(this);
+ add(clientSide);
+
+ buttonGroup = new ButtonGroup();
+
+ rdBoth = new JRadioButton("Generate both sync and async", true);
+ buttonGroup.add(rdBoth);
+ add(rdBoth);
+
+ rdsyn = new JRadioButton("Generate sync only", false);
+ buttonGroup.add(rdsyn);
+ add(rdsyn);
+
+ rdasync = new JRadioButton("Generate async only", false);
+ buttonGroup.add(rdasync);
+ add(rdasync);
+
+ JSeparator serverSep = new JSeparator(JSeparator.HORIZONTAL);
+ add(serverSep);
+
+ serverSide = new JRadioButton("Generate Server Side");
+ generationType.add(serverSide);
+ serverSide.addActionListener(this);
+ add(serverSide);
+
+ serviceXML = new JCheckBox("Generate default service.xml", true);
+ serviceXML.setEnabled(false);
+ add(serviceXML);
+
+ serverSideInterface = new JCheckBox("Generate an interface for skeleton", true);
+ serverSideInterface.setEnabled(false);
+ add(serverSideInterface);
+
+ JSeparator allSep = new JSeparator(JSeparator.HORIZONTAL);
+ add(allSep);
+
+ all = new JRadioButton("Generate All");
+ generationType.add(all);
+ all.addActionListener(this);
+ add(all);
+
+ Dimension dim = new Dimension(450, 350);
+ setSize(dim);
+ }
+
+ public void setCodeGenBean(CodegenBean codegenBean) {
+ this.codegenBean = codegenBean;
+ setStatus();
+
+ }
+
+ public void setStatus(){
+ txtPacakgeName.setText(codegenBean.packageFromTargetNamespace());
+ cmbServiceName.removeAllItems();
+ serviceNameList = codegenBean.getServiceList();
+ for (int i = 0; i < serviceNameList.size(); i++) {
+ QName name = (QName) serviceNameList.get(i);
+ cmbServiceName.addItem(name.getLocalPart());
+ }
+ cmbServiceName.setSelectedIndex(0);
+ }
+
+ public void fillBean() {
+ int index = cmbLan.getSelectedIndex();
+ switch (index) {
+ case 0: {
+ codegenBean.setLanguage("java");
+ break;
+ }
+ case 1: {
+ codegenBean.setLanguage("c-sharp");
+ break;
+ }
+ }
+
+ index = cmbdbtype.getSelectedIndex();
+ switch (index) {
+ case 0: {
+ codegenBean.setDatabindingName("adb");
+ break;
+ }
+ case 1: {
+ codegenBean.setDatabindingName("xmlbeans");
+ break;
+ }
+ case 2: {
+ codegenBean.setDatabindingName("none");
+ break;
+ }
+ }
+
+ if (clientSide.isSelected()){
+
+ if (rdasync.isSelected()) {
+ codegenBean.setAsyncOnly(true);
+ }
+ else if (rdsyn.isSelected()) {
+ codegenBean.setSyncOnly(true);
+ }
+ }
+ else if (serverSide.isSelected()) {
+
+ if (serviceXML.isSelected())
+ codegenBean.setServerSide(true);
+ else
+ codegenBean.setServerSide(false);
+ if (serverSideInterface.isSelected())
+ codegenBean.setServerSideInterface(true);
+ else
+ codegenBean.setServerSideInterface(false);
+ }
+ else {
+ codegenBean.setGenerateAll(true);
+
+
+}
+ if (chkTestCase.isSelected()) {
+ codegenBean.setTestCase(true);
+ }
+ else
+ codegenBean.setTestCase(false);
+ codegenBean.setPackageName(txtPacakgeName.getText());
+ codegenBean.setServiceName(cmbServiceName.getSelectedItem().toString());
+ codegenBean.setServiceName(cmbPortName.getSelectedItem().toString());
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ Object obj = e.getSource();
+ if (obj == cmbServiceName) {
+ int selindex = cmbServiceName.getSelectedIndex();
+ if (selindex>=0)
+ {
+ java.util.List ports = codegenBean.getPortNameList((QName) serviceNameList.get(selindex));
+ cmbPortName.removeAllItems();
+ for (int i = 0; i < ports.size(); i++) {
+ String portName = (String) ports.get(i);
+ cmbPortName.addItem(portName);
+ }
+ }
+ }
+ else if (obj == serverSide){
+ if(clientSide.isSelected()){
+ rdasync.setEnabled(true);
+ rdBoth.setEnabled(true);
+ rdsyn.setEnabled(true);
+ chkTestCase.setEnabled(true);
+ serviceXML.setEnabled(false);
+ serverSideInterface.setEnabled(false);
+ }
+ else
+ {
+ rdasync.setEnabled(false);
+ rdBoth.setEnabled(false);
+ rdsyn.setEnabled(false);
+ chkTestCase.setEnabled(false);
+ serviceXML.setEnabled(true);
+ serverSideInterface.setEnabled(true);
+ }
+ }
+ else if (obj == clientSide){
+ if(serverSide.isSelected()){
+ rdasync.setEnabled(false);
+ rdBoth.setEnabled(false);
+ rdsyn.setEnabled(false);
+ serviceXML.setEnabled(true);
+ chkTestCase.setEnabled(false);
+ serverSideInterface.setEnabled(true);
+ }
+ else
+ {
+ rdasync.setEnabled(true);
+ rdBoth.setEnabled(true);
+ rdsyn.setEnabled(true);
+ chkTestCase.setEnabled(true);
+ serviceXML.setEnabled(false);
+ serverSideInterface.setEnabled(false);
+ }
+ }
+ else if (obj == all){
+ if(all.isSelected()){
+ rdasync.setEnabled(false);
+ rdBoth.setEnabled(false);
+ rdsyn.setEnabled(false);
+ serviceXML.setEnabled(false);
+ serverSideInterface.setEnabled(false);
+ chkTestCase.setEnabled(true);
+ }
+
+
+ }
+ }
+}
+
+class SecondFrameLayout implements LayoutManager {
+
+ public SecondFrameLayout() {
+ }
+
+ 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 = 575 + 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;
+
+ // Language selection
+ c = parent.getComponent(0);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 10, 192, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 272, insets.top + 10, 250, 24);
+ }
+
+ // Service Name selection
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 40, 192, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 272, insets.top + 40, 250, 24);
+ }
+
+ // Port Name Selection
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 70, 192, 24);
+ }
+ c = parent.getComponent(5);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 272, insets.top + 70, 250, 24);
+ }
+
+ // Data Binding Selection
+ c = parent.getComponent(6);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 130, 192, 24);
+ }
+ c = parent.getComponent(7);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 272, insets.top + 130, 250, 24);
+ }
+
+ //Package NAme Selection
+ c = parent.getComponent(8);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 100, 192, 24);
+ }
+ c = parent.getComponent(9);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 272, insets.top + 100, 250, 24);
+ }
+
+
+
+ // Test Case Selection
+ c = parent.getComponent(10);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 160, 208, 24);
+ }
+
+ // JSeperator
+
+ c = parent.getComponent(11);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 187, 530, 2);
+ }
+
+ // Client side options
+ c = parent.getComponent(12);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 190, 168, 24);
+ }
+
+ // Service invocation both,sync,async
+ c = parent.getComponent(13);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 48, insets.top + 220, 210, 24);
+ }
+ c = parent.getComponent(14);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 260, insets.top + 220, 140, 24);
+ }
+ c = parent.getComponent(15);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 400, insets.top + 220, 145, 24);
+ }
+
+ // JSeperator
+
+ c = parent.getComponent(16);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 247, 530, 2);
+ }
+
+ // Server side options
+ c = parent.getComponent(17);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 250, 168, 24);
+ }
+
+ // Generate serverside, generate service XML
+ c = parent.getComponent(18);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 48, insets.top + 280, 200, 24);
+ }
+
+ c = parent.getComponent(19);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 248, insets.top + 280, 250, 24);
+ }
+
+ // JSeperator
+
+ c = parent.getComponent(20);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 307, 530, 2);
+ }
+
+ c = parent.getComponent(21);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 310, 200, 24);
+ }
+
+
+ }
+}
+
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/ServiceArchiveCreator.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/ServiceArchiveCreator.java?view=diff&rev=465584&r1=465583&r2=465584
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/ServiceArchiveCreator.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/ServiceArchiveCreator.java Thu Oct 19 04:47:51 2006
@@ -1,49 +1,49 @@
-/*
-* 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.
-*/
-
-package org.apache.axis2.tools.idea;
-
-import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.project.Project;
-
-import javax.swing.*;
-
-public class ServiceArchiveCreator extends AnAction {
- private ImageIcon myIcon;
-
- public ServiceArchiveCreator() {
- super("GC", "Create Service Archive File", null);
- }
-
- public void actionPerformed(AnActionEvent event) {
- Java2CodeFrame win = new Java2CodeFrame();
- win.setProject((Project) event.getDataContext().getData(DataConstants.PROJECT));
- win.pack();
- win.show();
- }
-
- 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);
- }
- }
-}
+/*
+* 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.
+*/
+
+package org.apache.axis2.tools.idea;
+
+import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.project.Project;
+
+import javax.swing.*;
+
+public class ServiceArchiveCreator extends AnAction {
+ private ImageIcon myIcon;
+
+ public ServiceArchiveCreator() {
+ super("GC", "Create Service Archive File", null);
+ }
+
+ public void actionPerformed(AnActionEvent event) {
+// Java2CodeFrame win = new Java2CodeFrame();
+// win.setProject((Project) event.getDataContext().getData(DataConstants.PROJECT));
+// win.pack();
+// win.show();
+ }
+
+ 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);
+ }
+ }
+}
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java?view=diff&rev=465584&r1=465583&r2=465584
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/Axi2PluginPage.java Thu Oct 19 04:47:51 2006
@@ -1,166 +1,169 @@
-package org.apache.ideaplugin.frames;
-
-import com.intellij.openapi.project.Project;
-import org.apache.axis2.tools.idea.Java2CodeFrame;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-/*
-* 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: Sep 24, 2005
- * Time: 10:41:41 AM
- */
-public class Axi2PluginPage extends JFrame implements ActionListener {
- ButtonGroup cbg;
- JRadioButton service;
- JRadioButton javawsdl;
- JButton butOK;
- JButton butCancle;
- JPanel imglbl;
- Project project;
-
- public Axi2PluginPage() {
- setBackground(Color.white);
- Dimension dim = getPreferredSize();
- setSize(dim);
- setBounds(200, 200, dim.width, dim.height);
- setBounds(200, 200, dim.width, dim.height);
- Axi2PluginPageLayout customLayout = new Axi2PluginPageLayout();
-
- setFont(new Font("Helvetica", Font.PLAIN, 12));
- setLayout(customLayout);
- setTitle("Axis2 Plugin");
- cbg = new ButtonGroup();
- service = new JRadioButton("Create a service archive", false);
- service.setToolTipText("Hepls package classes, libs and WSDLs to create a archive that can be deployed in Axis2");
- cbg.add(service);
- add(service);
-
- javawsdl = new JRadioButton("WSDL2Code codegenaration", false);
- javawsdl.setToolTipText("Helps generate skeletons and stubs for a given WSDL");
- cbg.add(javawsdl);
- add(javawsdl);
-
- butOK = new JButton("OK");
- butOK.addActionListener(this);
- //setResizable(false);
- add(butOK);
-
- butCancle = new JButton("Cancel");
- butCancle.addActionListener(this);
- add(butCancle);
-
- imglbl = new LogoPage();
- add(imglbl);
-
- }
-
- public void showUI() {
- pack();
- this.setVisible(true);
- show();
- }
-
- public void setProject(Project project) {
-
- this.project = project;
- }
-
-
- public void actionPerformed(ActionEvent e) {
- Object obj = e.getSource();
- if (obj == butCancle) {
- this.hide();
- setVisible(false);
- } else if (obj == butOK) {
- this.hide();
- setVisible(false);
- if (javawsdl.isSelected()) {
- Java2CodeFrame win = new Java2CodeFrame();
- win.setProject(project);
- win.pack();
- win.show();
- } else {
- ServiceArciveFrame window = new ServiceArciveFrame();
- window.setTitle("Service Archive creation");
- window.show();
- }
- }
-
- }
-
- public JComponent getRootComponent() {
- return this.getRootPane();
- }
-}
-
-class Axi2PluginPageLayout implements LayoutManager {
-
- public Axi2PluginPageLayout() {
- }
-
- 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 = 320 + insets.left + insets.right;
- dim.height = 240 + 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 + 104, 208, 24);
- }
- c = parent.getComponent(1);
- if (c.isVisible()) {
- c.setBounds(insets.left + 24, insets.top + 136, 208, 24);
- }
- c = parent.getComponent(2);
- if (c.isVisible()) {
- c.setBounds(insets.left + 130, insets.top + 200, 80, 24);
- }
- c = parent.getComponent(3);
- if (c.isVisible()) {
- c.setBounds(insets.left + 215, insets.top + 200, 80, 24);
- }
- c = parent.getComponent(4);
- if (c.isVisible()) {
- c.setBounds(insets.left, insets.top, 320, 80);
- }
- }
-}
+package org.apache.ideaplugin.frames;
+
+import com.intellij.openapi.project.Project;
+import org.apache.axis2.tools.idea.Java2CodeFrame;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+/*
+* 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: Sep 24, 2005
+ * Time: 10:41:41 AM
+ */
+public class Axi2PluginPage extends JFrame implements ActionListener {
+ ButtonGroup cbg;
+ JRadioButton service;
+ JRadioButton javawsdl;
+ JButton butOK;
+ JButton butCancle;
+ JPanel imglbl;
+ Project project;
+ Java2CodeFrame win;
+
+ public Axi2PluginPage() {
+ setBackground(Color.white);
+ Dimension dim = getPreferredSize();
+ setSize(dim);
+ setBounds(200, 200, dim.width, dim.height);
+ setBounds(200, 200, dim.width, dim.height);
+ Axi2PluginPageLayout customLayout = new Axi2PluginPageLayout();
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+ setLayout(customLayout);
+ setTitle("Axis2 Plugin");
+ cbg = new ButtonGroup();
+ 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);
+ add(service);
+
+ javawsdl = new JRadioButton("WSDL2Code codegenaration", false);
+ javawsdl.setToolTipText("Helps generate skeletons and stubs for a given WSDL");
+ cbg.add(javawsdl);
+ add(javawsdl);
+
+ butOK = new JButton("OK");
+ butOK.addActionListener(this);
+ //setResizable(false);
+ add(butOK);
+
+ butCancle = new JButton("Cancel");
+ butCancle.addActionListener(this);
+ add(butCancle);
+
+ imglbl = new LogoPage();
+ add(imglbl);
+
+ }
+
+ public void showUI() {
+ pack();
+ this.setVisible(true);
+ show();
+ }
+
+ public void setProject(Project project) {
+
+ this.project = project;
+ }
+
+
+ public void actionPerformed(ActionEvent e) {
+ Object obj = e.getSource();
+ if (obj == butCancle) {
+ this.hide();
+ setVisible(false);
+ } else if (obj == butOK) {
+ this.hide();
+ setVisible(false);
+ if (javawsdl.isSelected()) {
+
+ win = new Java2CodeFrame();
+ win.setProject(project);
+ win.pack();
+ win.show();
+
+ } else {
+ ServiceArciveFrame window = new ServiceArciveFrame();
+ window.setTitle("Service Archive creation");
+ window.show();
+ }
+ }
+
+ }
+
+ public JComponent getRootComponent() {
+ return this.getRootPane();
+ }
+}
+
+class Axi2PluginPageLayout implements LayoutManager {
+
+ public Axi2PluginPageLayout() {
+ }
+
+ 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 = 320 + insets.left + insets.right;
+ dim.height = 240 + 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 + 104, 208, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 24, insets.top + 136, 208, 24);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 130, insets.top + 200, 80, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 215, insets.top + 200, 80, 24);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left, insets.top, 320, 80);
+ }
+ }
+}
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/BottomPanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/BottomPanel.java?view=diff&rev=465584&r1=465583&r2=465584
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/BottomPanel.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/BottomPanel.java Thu Oct 19 04:47:51 2006
@@ -1,158 +1,161 @@
-package org.apache.ideaplugin.frames;
-
-import org.apache.ideaplugin.bean.ArchiveBean;
-import org.apache.ideaplugin.bean.ObjectKeeper;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-/*
-* 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: Sep 18, 2005
- * Time: 12:01:58 PM
- */
-public class BottomPanel extends JPanel implements ActionListener {
- JButton butBack;
- JButton butNext;
- JButton btnFinsh;
- JButton btnCanclel;
- ServiceArciveFrame parent;
- private ArchiveBean bean;
-
- private JPanel currentPanel = null;
-
- public BottomPanel(JPanel currPanel, ServiceArciveFrame parent, ArchiveBean bean) {
- BottomPanelLayout customLayout = new BottomPanelLayout();
-
- setFont(new Font("Helvetica", Font.PLAIN, 12));
- setLayout(customLayout);
- this.parent = parent;
- this.bean = bean;
-
- butBack = new JButton("< Back");
- add(butBack);
- butBack.addActionListener(this);
-
- butNext = new JButton("Next >");
- butNext.setEnabled(false);
- add(butNext);
- butNext.addActionListener(this);
-
- btnFinsh = new JButton("Finish");
- btnFinsh.setEnabled(false);
- add(btnFinsh);
- btnFinsh.addActionListener(this);
-
- btnCanclel = new JButton("Cancel");
- add(btnCanclel);
- btnCanclel.addActionListener(this);
-
- this.currentPanel = currPanel;
-
- if (((ObjectKeeper) currentPanel).getPrivious() == null) {
- butBack.setEnabled(false);
- }
- setSize(getPreferredSize());
- }
-
- public void setEnable(boolean back, boolean next, boolean finish, boolean cancel) {
- butBack.setEnabled(back);
- butNext.setEnabled(next);
- btnFinsh.setEnabled(finish);
- btnCanclel.setEnabled(cancel);
- }
-
- public void actionPerformed(ActionEvent e) {
- Object obj = e.getSource();
- if (obj == btnCanclel) {
- parent.setVisible(false);
- }
- if (obj == butNext) {
- ((ObjectKeeper) currentPanel).fillBean(bean);
- currentPanel = ((ObjectKeeper) currentPanel).getNext();
- parent.Next(currentPanel);
- if (currentPanel instanceof DescriptorFile) {
- parent.setEnable(false, true, false, true);
- }
- } else if (obj == btnFinsh) {
- ((ObjectKeeper) currentPanel).fillBean(bean);
- bean.finsh();
-
- JOptionPane.showMessageDialog(parent, "Service creation successful!",
- "Axis2 Service creation", JOptionPane.INFORMATION_MESSAGE);
- parent.setVisible(false);
-
- } else if (obj == butBack) {
- currentPanel = ((ObjectKeeper) currentPanel).getPrivious();
- parent.Back(currentPanel);
- }
- }
-}
-
-class BottomPanelLayout implements LayoutManager {
-
- public BottomPanelLayout() {
- }
-
- 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 = 606 + insets.left + insets.right;
- dim.height = 64 + 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 + 176, insets.top + 24, 80, 24);
- }
- c = parent.getComponent(1);
- if (c.isVisible()) {
- c.setBounds(insets.left + 260, insets.top + 24, 80, 24);
- }
- c = parent.getComponent(2);
- if (c.isVisible()) {
- c.setBounds(insets.left + 344, insets.top + 24, 80, 24);
- }
- c = parent.getComponent(3);
- if (c.isVisible()) {
- c.setBounds(insets.left + 426, insets.top + 24, 80, 24);
- }
- }
-}
-
+package org.apache.ideaplugin.frames;
+
+import org.apache.ideaplugin.bean.ArchiveBean;
+import org.apache.ideaplugin.bean.ObjectKeeper;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+/*
+* 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: Sep 18, 2005
+ * Time: 12:01:58 PM
+ */
+public class BottomPanel extends JPanel implements ActionListener {
+ JButton butBack;
+ JButton butNext;
+ JButton btnFinsh;
+ JButton btnCanclel;
+ ServiceArciveFrame parent;
+ private ArchiveBean bean;
+
+ private JPanel currentPanel = null;
+
+ public BottomPanel(JPanel currPanel, ServiceArciveFrame parent, ArchiveBean bean) {
+ BottomPanelLayout customLayout = new BottomPanelLayout();
+
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+ setLayout(customLayout);
+ this.parent = parent;
+ this.bean = bean;
+
+ butBack = new JButton("< Back");
+ add(butBack);
+ butBack.addActionListener(this);
+
+ butNext = new JButton("Next >");
+ butNext.setEnabled(false);
+ add(butNext);
+ butNext.addActionListener(this);
+
+ btnFinsh = new JButton("Finish");
+ btnFinsh.setEnabled(false);
+ add(btnFinsh);
+ btnFinsh.addActionListener(this);
+
+ btnCanclel = new JButton("Cancel");
+ add(btnCanclel);
+ btnCanclel.addActionListener(this);
+
+ this.currentPanel = currPanel;
+
+ if (((ObjectKeeper) currentPanel).getPrivious() == null) {
+ butBack.setEnabled(false);
+ }
+ setSize(getPreferredSize());
+ }
+
+ public void setEnable(boolean back, boolean next, boolean finish, boolean cancel) {
+ butBack.setEnabled(back);
+ butNext.setEnabled(next);
+ btnFinsh.setEnabled(finish);
+ btnCanclel.setEnabled(cancel);
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ Object obj = e.getSource();
+ if (obj == btnCanclel) {
+ parent.setVisible(false);
+ }
+ if (obj == butNext) {
+ ((ObjectKeeper) currentPanel).fillBean(bean);
+ currentPanel = ((ObjectKeeper) currentPanel).getNext();
+ parent.Next(currentPanel);
+ if (currentPanel instanceof DescriptorFile) {
+ parent.setEnable(false, true, false, true);
+ }
+ } else if (obj == btnFinsh) {
+ ((ObjectKeeper) currentPanel).fillBean(bean);
+ bean.finsh();
+
+ JOptionPane.showMessageDialog(parent, "Service creation successful!",
+ "Axis2 Service creation", JOptionPane.INFORMATION_MESSAGE);
+ parent.setVisible(false);
+
+ } else if (obj == butBack) {
+ currentPanel = ((ObjectKeeper) currentPanel).getPrivious();
+ parent.Back(currentPanel);
+ if (currentPanel instanceof FirstFrame) {
+ parent.setEnable(false, true, false, true);
+ }
+ }
+ }
+}
+
+class BottomPanelLayout implements LayoutManager {
+
+ public BottomPanelLayout() {
+ }
+
+ 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 = 606 + insets.left + insets.right;
+ dim.height = 64 + 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 + 176, insets.top + 24, 80, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 260, insets.top + 24, 80, 24);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 344, insets.top + 24, 80, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 426, insets.top + 24, 80, 24);
+ }
+ }
+}
+
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/FirstFrame.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/FirstFrame.java?view=diff&rev=465584&r1=465583&r2=465584
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/FirstFrame.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-idea-plugin/src/main/java/org/apache/ideaplugin/frames/FirstFrame.java Thu Oct 19 04:47:51 2006
@@ -1,187 +1,187 @@
-package org.apache.ideaplugin.frames;
-
-import org.apache.ideaplugin.bean.ArchiveBean;
-import org.apache.ideaplugin.bean.ObjectKeeper;
-
-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: Sep 17, 2005
- * Time: 10:09:08 PM
- */
-public class FirstFrame extends JPanel implements ObjectKeeper {
- JLabel lblArchivetype;
- ButtonGroup cbgservoceType;
- ButtonGroup cbggenerateserviceDesc;
- JRadioButton radioSingle;
- JRadioButton serviGroup;
- JLabel label_1;
- JRadioButton radioGenerate;
- JRadioButton radihaveService;
-
- private JPanel previous;
- protected ClassSelctionPage classPage;
- ServiceArciveFrame parent;
-
- public FirstFrame(ServiceArciveFrame parent) {
- this.parent = parent;
- FirstFrameLayout customLayout = new FirstFrameLayout();
- setFont(new Font("Helvetica", Font.PLAIN, 12));
- setLayout(customLayout);
-
- lblArchivetype = new JLabel("Select Archive Type");
- add(lblArchivetype);
-
- cbgservoceType = new ButtonGroup();
- radioSingle = new JRadioButton("Single service Archive", true);
- cbgservoceType.add(radioSingle);
- add(radioSingle);
-
- serviGroup = new JRadioButton("Service Group Archive", false);
- cbgservoceType.add(serviGroup);
- add(serviGroup);
-
- label_1 = new JLabel("Do you want to generate services.xml");
- add(label_1);
-
- cbggenerateserviceDesc = new ButtonGroup();
- radioGenerate = new JRadioButton("Generate services.xml", true);
- cbggenerateserviceDesc.add(radioGenerate);
- add(radioGenerate);
-
- radihaveService = new JRadioButton("I already have services.xml", false);
- cbggenerateserviceDesc.add(radihaveService);
- add(radihaveService);
-
- //creating next page
-// classPage = new ClassSelctionPage(parent);
-// classPage.setPrivious(this);
- setSize(getPreferredSize());
- }
-
- public void fillBean(ArchiveBean bean) {
- bean.setGeneretServiceDesc(radioGenerate.isSelected());
- bean.setSingleService(radioSingle.isSelected());
- }
-
- //to keep a refernce to next panel
- public void setNext(JPanel next) {
-// this.next = next;
- }
-
- public JPanel getNext() {
- boolean singleservice = radioSingle.isSelected();
- boolean generateXML = radioGenerate.isSelected();
- if (singleservice && generateXML) {
- parent.singleService = true;
- parent.generateServiceXML = true;
- ClassSelctionPage classPage = new ClassSelctionPage(parent);
- classPage.setPrivious(this);
- return classPage;
- } else if (!generateXML) {
- parent.generateServiceXML = false;
- XMLSelectionPage xml = new XMLSelectionPage(parent);
- xml.setPrivious(this);
- return xml;
- } else {
- parent.generateServiceXML = true;
- parent.singleService = false;
- ClassSelctionPage classPage = new ClassSelctionPage(parent);
- classPage.setPrivious(this);
- return classPage;
- }
- }
-
- //to keep a refernce to previous panel
- public void setPrivious(JPanel privious) {
- this.previous = privious;
- }
-
- public JPanel getPrivious() {
- return this.previous;
- }
-
- public String getTopLable() {
- return "Service Type selection";
- }
-
- public String getLable() {
- return "Welcome to Axis2 service archive generation" +
- "select service type";
- }
-}
-
-class FirstFrameLayout implements LayoutManager {
-
- public FirstFrameLayout() {
- }
-
- 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 = 494 + insets.left + insets.right;
- dim.height = 281 + 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 + 8, insets.top + 24, 208, 24);
- }
- c = parent.getComponent(1);
- if (c.isVisible()) {
- c.setBounds(insets.left + 32, insets.top + 56, 184, 24);
- }
- c = parent.getComponent(2);
- if (c.isVisible()) {
- c.setBounds(insets.left + 32, insets.top + 88, 184, 24);
- }
- c = parent.getComponent(3);
- if (c.isVisible()) {
- c.setBounds(insets.left + 8, insets.top + 136, 250, 24);
- }
- c = parent.getComponent(4);
- if (c.isVisible()) {
- c.setBounds(insets.left + 32, insets.top + 168, 224, 24);
- }
- c = parent.getComponent(5);
- if (c.isVisible()) {
- c.setBounds(insets.left + 32, insets.top + 200, 224, 16);
- }
- }
-}
+package org.apache.ideaplugin.frames;
+
+import org.apache.ideaplugin.bean.ArchiveBean;
+import org.apache.ideaplugin.bean.ObjectKeeper;
+
+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: Sep 17, 2005
+ * Time: 10:09:08 PM
+ */
+public class FirstFrame extends JPanel implements ObjectKeeper {
+ JLabel lblArchivetype;
+ ButtonGroup cbgservoceType;
+ ButtonGroup cbggenerateserviceDesc;
+ JRadioButton radioSingle;
+ JRadioButton serviGroup;
+ JLabel label_1;
+ JRadioButton radioGenerate;
+ JRadioButton radihaveService;
+
+ private JPanel previous;
+ protected ClassSelctionPage classPage;
+ ServiceArciveFrame parent;
+
+ public FirstFrame(ServiceArciveFrame parent) {
+ this.parent = parent;
+ FirstFrameLayout customLayout = new FirstFrameLayout();
+ setFont(new Font("Helvetica", Font.PLAIN, 12));
+ setLayout(customLayout);
+
+ lblArchivetype = new JLabel("Select Archive Type");
+ add(lblArchivetype);
+
+ cbgservoceType = new ButtonGroup();
+ radioSingle = new JRadioButton("Single service Archive", true);
+ cbgservoceType.add(radioSingle);
+ add(radioSingle);
+
+ serviGroup = new JRadioButton("Service Group Archive", false);
+ cbgservoceType.add(serviGroup);
+ add(serviGroup);
+
+ label_1 = new JLabel("Do you want to generate services.xml");
+ add(label_1);
+
+ cbggenerateserviceDesc = new ButtonGroup();
+ radioGenerate = new JRadioButton("Generate services.xml", true);
+ cbggenerateserviceDesc.add(radioGenerate);
+ add(radioGenerate);
+
+ radihaveService = new JRadioButton("I already have services.xml", false);
+ cbggenerateserviceDesc.add(radihaveService);
+ add(radihaveService);
+
+ //creating next page
+// classPage = new ClassSelctionPage(parent);
+// classPage.setPrivious(this);
+ setSize(getPreferredSize());
+ }
+
+ public void fillBean(ArchiveBean bean) {
+ bean.setGeneretServiceDesc(radioGenerate.isSelected());
+ bean.setSingleService(radioSingle.isSelected());
+ }
+
+ //to keep a refernce to next panel
+ public void setNext(JPanel next) {
+// this.next = next;
+ }
+
+ public JPanel getNext() {
+ boolean singleservice = radioSingle.isSelected();
+ boolean generateXML = radioGenerate.isSelected();
+ if (singleservice && generateXML) {
+ parent.singleService = true;
+ parent.generateServiceXML = true;
+ ClassSelctionPage classPage = new ClassSelctionPage(parent);
+ classPage.setPrivious(this);
+ return classPage;
+ } else if (!generateXML) {
+ parent.generateServiceXML = false;
+ XMLSelectionPage xml = new XMLSelectionPage(parent);
+ xml.setPrivious(this);
+ return xml;
+ } else {
+ parent.generateServiceXML = true;
+ parent.singleService = false;
+ ClassSelctionPage classPage = new ClassSelctionPage(parent);
+ classPage.setPrivious(this);
+ return classPage;
+ }
+ }
+
+ //to keep a refernce to previous panel
+ public void setPrivious(JPanel privious) {
+ this.previous = privious;
+ }
+
+ public JPanel getPrivious() {
+ return this.previous;
+ }
+
+ public String getTopLable() {
+ return "Service Type selection";
+ }
+
+ public String getLable() {
+ return "Welcome to Axis2 service archive generation. " +
+ "Select service type";
+ }
+}
+
+class FirstFrameLayout implements LayoutManager {
+
+ public FirstFrameLayout() {
+ }
+
+ 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 = 494 + insets.left + insets.right;
+ dim.height = 281 + 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 + 8, insets.top + 24, 208, 24);
+ }
+ c = parent.getComponent(1);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 32, insets.top + 56, 184, 24);
+ }
+ c = parent.getComponent(2);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 32, insets.top + 88, 184, 24);
+ }
+ c = parent.getComponent(3);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 8, insets.top + 136, 250, 24);
+ }
+ c = parent.getComponent(4);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 32, insets.top + 168, 224, 24);
+ }
+ c = parent.getComponent(5);
+ if (c.isVisible()) {
+ c.setBounds(insets.left + 32, insets.top + 200, 224, 16);
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org