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 sa...@apache.org on 2007/06/28 08:56:35 UTC

svn commit: r551476 - in /webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools: component/ wizardframe/

Author: sandakith
Date: Wed Jun 27 23:56:34 2007
New Revision: 551476

URL: http://svn.apache.org/viewvc?view=rev&rev=551476
Log:
Applying the patch By Shivantha
This improvement to the Axis2 Idea Plugin is to remove the fixed component sizes 
So the plugin will be now able to resizable 
Thanks Sivantha, 
Patch reviewed and it was very neatly done 

Added:
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Action.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/CancelAction.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/DefaultWizardComponents.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/FinishAction.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Utilities.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Wizard.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardComponents.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardPanel.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/CodegenFrame.java
    webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/WizardFrame.java

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Action.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Action.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Action.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Action.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,8 @@
+package org.apache.axis2.tools.component;
+
+/**
+ * interface for Action
+ */
+public interface Action {
+    public void performAction();
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/CancelAction.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/CancelAction.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/CancelAction.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/CancelAction.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,12 @@
+package org.apache.axis2.tools.component;
+
+/**
+ * abstract class for CanselAction
+ */
+public abstract class CancelAction  implements Action{
+  WizardComponents wizardComponents;
+
+  public CancelAction(WizardComponents wizardComponents) {
+    this.wizardComponents = wizardComponents;
+  }
+}
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/DefaultWizardComponents.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/DefaultWizardComponents.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/DefaultWizardComponents.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/DefaultWizardComponents.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,338 @@
+package org.apache.axis2.tools.component;
+
+import javax.swing.*;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeSupport;
+import java.util.List;
+import java.util.ArrayList;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+
+/**
+ * this is used for default wizard components
+ */
+public class DefaultWizardComponents implements WizardComponents {
+    private java.util.ResourceBundle resourceBundle =
+            java.util.ResourceBundle.getBundle("icons/i18n");
+
+    private JButton backButton;
+    private JButton nextButton;
+    private JButton finishButton;
+    private JButton cancelButton;
+
+    FinishAction finishAction;
+    CancelAction cancelAction;
+
+    List panelList;
+    int currentIndex;
+    JPanel wizardPanelsContainer;
+    PropertyChangeSupport propertyChangeListeners;
+
+    /**
+     * This class is the "bread and butter" of this framework.  All of these
+     * components can be used visually however you want, as shown in the
+     * frame and example packages, but all a developer really needs is this,
+     * and they can even instead implement JWizard and choose to do this
+     * portion any way they wish.
+     */
+    public DefaultWizardComponents() {
+        try {
+            init();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void addWizardPanel(WizardPanel panel) {
+        getWizardPanelList().add(panel);
+        wizardPanelsContainer.add(panel,
+                getWizardPanelList().size() - 1 + "");
+    }
+
+    public void addWizardPanel(int index, WizardPanel panel) {
+        getWizardPanelList().add(index, panel);
+        wizardPanelsContainer.add(panel, index + "", index);
+        if (index < getWizardPanelList().size() - 1) {
+            for (int i = index + 1; i < getWizardPanelList().size(); i++) {
+                wizardPanelsContainer.add(
+                        (WizardPanel)getWizardPanelList().get(i),
+                        i + "");
+            }
+        }
+    }
+
+    public void addWizardPanelAfter(
+            WizardPanel panelToBePlacedAfter,
+            WizardPanel panel) {
+        addWizardPanel(
+                getWizardPanelList().indexOf(panelToBePlacedAfter) + 1,
+                panel);
+    }
+
+    public void addWizardPanelBefore(
+            WizardPanel panelToBePlacedBefore,
+            WizardPanel panel) {
+        addWizardPanel(
+                getWizardPanelList().indexOf(panelToBePlacedBefore) - 1,
+                panel);
+    }
+
+    public void addWizardPanelAfterCurrent(WizardPanel panel) {
+        addWizardPanel(getCurrentIndex()+1, panel);
+    }
+
+    public WizardPanel removeWizardPanel(WizardPanel panel) {
+        int index = getWizardPanelList().indexOf(panel);
+        getWizardPanelList().remove(panel);
+        wizardPanelsContainer.remove(panel);
+        for (int i = index; i < getWizardPanelList().size(); i++) {
+            wizardPanelsContainer.add(
+                    (WizardPanel) getWizardPanelList().get(i),
+                    i + "");
+        }
+        return panel;
+    }
+
+    public WizardPanel removeWizardPanel(int index) {
+        wizardPanelsContainer.remove(index);
+        WizardPanel panel = (WizardPanel) getWizardPanelList().remove(index);
+        for (int i = index; i < getWizardPanelList().size(); i++) {
+            wizardPanelsContainer.add(
+                    (WizardPanel) getWizardPanelList().get(i),
+                    i + "");
+        }
+        return panel;
+    }
+
+    public WizardPanel removeWizardPanelAfter(WizardPanel panel) {
+        return removeWizardPanel(getWizardPanelList().indexOf(panel) + 1);
+    }
+
+    public WizardPanel removeWizardPanelBefore(WizardPanel panel) {
+        return removeWizardPanel(getWizardPanelList().indexOf(panel) - 1);
+    }
+
+    public WizardPanel getWizardPanel(int index) {
+        return (WizardPanel) getWizardPanelList().get(index);
+    }
+
+    public int getIndexOfPanel(WizardPanel panel) {
+        return getWizardPanelList().indexOf(panel);
+    }
+
+    public boolean onLastPanel() {
+        return (getCurrentIndex() == getWizardPanelList().size() - 1);
+    }
+
+    private void init() throws Exception {
+        this.propertyChangeListeners = new PropertyChangeSupport(this);
+
+        backButton = new JButton();
+        nextButton = new JButton();
+        finishButton = new JButton();
+        cancelButton = new JButton();
+
+        panelList = new ArrayList();
+        currentIndex = 0;
+        wizardPanelsContainer = new JPanel();
+
+        backButton.setText(resourceBundle.getString("L_BackButton"));
+        backButton.setMnemonic(resourceBundle.getString("L_BackButtonMnem").charAt(0));
+        backButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                backButton_actionPerformed(e);
+            }
+        });
+
+        nextButton.setText(resourceBundle.getString("L_NextButton"));
+        nextButton.setMnemonic(resourceBundle.getString("L_NextButtonMnem").charAt(0));
+        nextButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                nextButton_actionPerformed(e);
+            }
+        });
+
+        cancelButton.setText(resourceBundle.getString("L_CancelButton"));
+        cancelButton.setMnemonic(resourceBundle.getString("L_CancelButtonMnem").charAt(0));
+        cancelButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                cancelButton_actionPerformed(e);
+            }
+        });
+
+        finishButton.setText(resourceBundle.getString("L_FinishButton"));
+        finishButton.setMnemonic(resourceBundle.getString("L_FinishButtonMnem").charAt(0));
+        finishButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                finishButton_actionPerformed(e);
+            }
+        });
+
+        wizardPanelsContainer.setLayout(new CardLayout());
+    }
+
+    void cancelButton_actionPerformed(ActionEvent e) {
+        getCancelAction().performAction();
+    }
+
+    void finishButton_actionPerformed(ActionEvent e) {
+        getFinishAction().performAction();
+    }
+
+    void nextButton_actionPerformed(ActionEvent e) {
+        try {
+            getCurrentPanel().next();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    void backButton_actionPerformed(ActionEvent e) {
+        try {
+            getCurrentPanel().back();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public WizardPanel getCurrentPanel() throws Exception {
+        if (getWizardPanelList().get(currentIndex) != null) {
+            return (WizardPanel) getWizardPanelList().get(currentIndex);
+        } else {
+            throw new Exception("No panels in panelList");
+        }
+    }
+
+    public void updateComponents() {
+        try {
+            CardLayout cl = (CardLayout) (wizardPanelsContainer.getLayout());
+            cl.show(wizardPanelsContainer, currentIndex + "");
+
+            if (currentIndex == 0) {
+                backButton.setEnabled(false);
+            } else {
+                backButton.setEnabled(true);
+            }
+
+            if (onLastPanel()) {
+                nextButton.setEnabled(false);
+                finishButton.setEnabled(true);
+            } else {
+                finishButton.setEnabled(false);
+                nextButton.setEnabled(true);
+            }
+            // let panel to update itself
+            getCurrentPanel().update();
+
+            // inform PropertyChangeListeners
+            PropertyChangeEvent event = new PropertyChangeEvent(this, WizardComponents.CURRENT_PANEL_PROPERTY
+                    , null,  getCurrentPanel());
+            propertyChangeListeners.firePropertyChange(event);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    // Getters and Setters from here on ...
+
+    public List getWizardPanelList() {
+        return this.panelList;
+    }
+
+    public void setWizardPanelList(ArrayList panelList) {
+        this.panelList = panelList;
+    }
+
+    public FinishAction getFinishAction() {
+        return finishAction;
+    }
+
+    public void setFinishAction(FinishAction aFinishAction) {
+        finishAction = aFinishAction;
+    }
+
+    public CancelAction getCancelAction() {
+        return cancelAction;
+    }
+
+    public void setCancelAction(CancelAction aCancelAction) {
+        cancelAction = aCancelAction;
+    }
+
+    public int getCurrentIndex() {
+        return currentIndex;
+    }
+
+    public void setCurrentIndex(int aCurrentIndex) {
+        currentIndex = aCurrentIndex;
+    }
+
+    public JPanel getWizardPanelsContainer() {
+        return wizardPanelsContainer;
+    }
+
+    public void setWizardPanelsContainer(JPanel aWizardPanelsContainer) {
+        wizardPanelsContainer = aWizardPanelsContainer;
+    }
+
+    public JButton getBackButton() {
+        return backButton;
+    }
+
+    public void setBackButton(JButton aBackButton) {
+        backButton = aBackButton;
+    }
+
+    public JButton getNextButton() {
+        return nextButton;
+    }
+
+    public void setNextButton(JButton aNextButton) {
+        nextButton = aNextButton;
+    }
+
+    public JButton getCancelButton() {
+        return cancelButton;
+    }
+
+    public void setCancelButton(JButton aCancelButton) {
+        cancelButton = aCancelButton;
+    }
+
+    public JButton getFinishButton() {
+        return finishButton;
+    }
+
+    public void setFinishButton(JButton button) {
+        finishButton = button;
+    }
+
+    public void setWizardPanelList(List panelList) {
+        this.panelList = panelList;
+    }
+
+    public void addPropertyChangeListener(PropertyChangeListener listener) {
+        propertyChangeListeners.addPropertyChangeListener(listener);
+    }
+
+    public void removePropertyChangeListener(PropertyChangeListener listener) {
+        propertyChangeListeners.removePropertyChangeListener(listener);
+    }
+
+    /**
+     * @return Returns the resourceBundle.
+     */
+    public java.util.ResourceBundle getResourceBundle() {
+        return resourceBundle;
+    }
+
+    /**
+     * @param resourceBundle The resourceBundle to set.
+     */
+    public void setResourceBundle(
+            java.util.ResourceBundle resourceBundle) {
+        this.resourceBundle = resourceBundle;
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/FinishAction.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/FinishAction.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/FinishAction.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/FinishAction.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,12 @@
+package org.apache.axis2.tools.component;
+
+/**
+ * abstract class for FinishAction
+ */
+public abstract class FinishAction implements Action{
+    WizardComponents wizardComponents;
+
+    public FinishAction(WizardComponents wizardComponents) {
+        this.wizardComponents = wizardComponents;
+    }
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Utilities.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Utilities.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Utilities.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Utilities.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,28 @@
+package org.apache.axis2.tools.component;
+
+import java.awt.*;
+
+/**
+ * this class used for set frame in center of the current desktop
+ */
+public class Utilities {
+
+    public static void centerComponentOnScreen(Component component) {
+        Toolkit toolkit = Toolkit.getDefaultToolkit();
+        Dimension d = toolkit.getScreenSize();
+
+        Point p = new Point();
+        p.x += ((d.width - component.getWidth()) / 2);
+        p.y += ((d.height - component.getHeight()) / 2);
+
+        if (p.x < 0) {
+            p.x = 0;
+        }
+
+        if (p.y < 0) {
+            p.y = 0;
+        }
+
+        component.setLocation(p);
+    }
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Wizard.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Wizard.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Wizard.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/Wizard.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,23 @@
+package org.apache.axis2.tools.component;
+
+import java.util.List;
+
+/**
+ * interface for wizard
+ */
+public interface Wizard {
+
+    public List getWizardPanelList();
+
+    public void setWizardPanelList(List panelList);
+
+    public void addWizardPanel(WizardPanel panel);
+
+    public void addWizardPanel(int index, WizardPanel panel);
+
+    public WizardPanel removeWizardPanel(WizardPanel panel);
+
+    public WizardPanel removeWizardPanel(int index);
+
+    public WizardPanel getWizardPanel(int index);
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardComponents.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardComponents.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardComponents.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardComponents.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,87 @@
+package org.apache.axis2.tools.component;
+
+import javax.swing.*;
+import java.util.List;
+import java.beans.PropertyChangeListener;
+
+/**
+ * this interface extends from wizard interface
+ */
+
+public interface WizardComponents  extends Wizard {
+
+    public void addWizardPanel(WizardPanel panel);
+
+    public void addWizardPanel(int index, WizardPanel panel);
+
+    public void addWizardPanelAfter(
+            WizardPanel panelToBePlacedAfter,
+            WizardPanel panel);
+
+    public void addWizardPanelBefore(
+            WizardPanel panelToBePlacedBefore,
+            WizardPanel panel);
+
+    public void addWizardPanelAfterCurrent(WizardPanel panel);
+
+    public WizardPanel removeWizardPanel(WizardPanel panel);
+
+    public WizardPanel removeWizardPanel(int index);
+
+    public WizardPanel removeWizardPanelAfter(WizardPanel panel);
+
+    public WizardPanel removeWizardPanelBefore(WizardPanel panel);
+
+    public WizardPanel getWizardPanel(int index);
+
+    public int getIndexOfPanel(WizardPanel panel);
+
+    public void updateComponents();
+
+    public WizardPanel getCurrentPanel() throws Exception;
+
+    public FinishAction getFinishAction();
+
+    public void setFinishAction(FinishAction aFinishAction);
+
+    public CancelAction getCancelAction();
+
+    public void setCancelAction(CancelAction aCancelAction);
+
+    public int getCurrentIndex();
+
+    public void setCurrentIndex(int aCurrentIndex);
+
+    public JPanel getWizardPanelsContainer();
+
+    public void setWizardPanelsContainer(JPanel aWizardPanelsContainer);
+
+    public JButton getBackButton();
+
+    public void setBackButton(JButton aBackButton);
+
+    public JButton getNextButton();
+
+    public void setNextButton(JButton aNextButton);
+
+    public JButton getCancelButton();
+
+    public void setCancelButton(JButton aCancelButton);
+
+    public JButton getFinishButton();
+
+    public void setFinishButton(JButton button);
+
+    public List getWizardPanelList();
+
+    public void setWizardPanelList(List panelList);
+
+    public boolean onLastPanel();
+
+    public final static String CURRENT_PANEL_PROPERTY = "currentPanel";
+
+    public void addPropertyChangeListener(PropertyChangeListener listener);
+
+    public void removePropertyChangeListener(PropertyChangeListener listener);
+
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardPanel.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardPanel.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardPanel.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/component/WizardPanel.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,137 @@
+package org.apache.axis2.tools.component;
+
+import javax.swing.*;
+
+/**
+ * this is wizardPanel it is extends from Jpanel
+ */
+public class WizardPanel extends JPanel {
+
+    //variables
+
+    private WizardComponents wizardComponents;
+    private String panelTopTitle;
+    private ImageIcon panelImage;
+    private String  panelBottomTitle;
+    private String error;
+    private boolean flag;
+    private boolean progressFlag;
+   // private ProgressBarPanel progressBar;
+
+    public WizardPanel(WizardComponents wizardComponents) {
+        this(wizardComponents, null);
+    }
+
+    public WizardPanel(WizardComponents wizardComponents, String title) {
+        this.wizardComponents = wizardComponents;
+        this.panelTopTitle = title;
+        java.net.URL resource = WizardPanel.class.getResource("/icons/asf-feather.png");
+        setPanelImage(new ImageIcon(resource));
+    }
+
+    public void update() {
+    }
+
+    public void next() {
+        goNext();
+    }
+
+    public void back() {
+        goBack();
+    }
+
+    public WizardComponents getWizardComponents(){
+        return wizardComponents;
+    }
+
+    public void setWizardComponents(WizardComponents awizardComponents){
+        wizardComponents = awizardComponents;
+    }
+    // Title
+    public String getPanelTopTitle() {
+        return panelTopTitle;
+    }
+
+    public void setPanelTopTitle(String title) {
+        panelTopTitle = title;
+    }
+    public String getPanelBottomTitle() {
+        return panelBottomTitle;
+    }
+
+    public void setPanelBottomTitle(String title) {
+        panelBottomTitle = title;
+    }
+    // Image
+    public ImageIcon getPanelImage(){
+        return panelImage ;
+    }
+
+    public void setPanelImage(ImageIcon image){
+        panelImage = image;
+    }
+    //error
+     public String  getError(){
+        return error ;
+    }
+
+     public boolean  getErrorFlag(){
+        return flag ;
+    }
+    public void setError(String  error,boolean flag){
+        this.error=error;
+        this.flag=flag;
+    }
+    // progress panel visible flag
+    public void setProgressPanelVisible(boolean flag) {
+        this.progressFlag = flag;
+    }
+    public boolean getProgressPanelVisible() {
+        return progressFlag;
+    }
+   /* public void setProgressPanel(ProgressBarPanel panel) {
+        this.progressBar = panel;
+    }
+    public ProgressBarPanel getProgressPanel() {
+        return (ProgressBarPanel)progressBar;
+    }*/
+
+    // next
+    protected boolean goNext() {
+        if (wizardComponents.getWizardPanelList().size() > wizardComponents.getCurrentIndex()+1 ) {
+            wizardComponents.setCurrentIndex(wizardComponents.getCurrentIndex()+1);
+            wizardComponents.updateComponents();
+            return true;
+        } else {
+            return false;
+        }
+    }
+    //back
+    protected boolean goBack() {
+        if (wizardComponents.getCurrentIndex()-1 >= 0) {
+            wizardComponents.setCurrentIndex(wizardComponents.getCurrentIndex()-1);
+            wizardComponents.updateComponents();
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected void switchPanel(int panelIndex) {
+        getWizardComponents().setCurrentIndex(panelIndex);
+        getWizardComponents().updateComponents();
+    }
+
+    protected void setBackButtonEnabled(boolean set) {
+        wizardComponents.getBackButton().setEnabled(set);
+    }
+
+    protected void setNextButtonEnabled(boolean set) {
+        wizardComponents.getNextButton().setEnabled(set);
+    }
+
+    protected void setFinishButtonEnabled(boolean set) {
+        wizardComponents.getFinishButton().setEnabled(set);
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/CodegenFrame.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/CodegenFrame.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/CodegenFrame.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/CodegenFrame.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,63 @@
+package org.apache.axis2.tools.wizardframe;
+
+import org.apache.axis2.tools.bean.WsdlgenBean;
+import org.apache.axis2.tools.bean.CodegenBean;
+import org.apache.axis2.tools.idea.FirstPanel;
+import org.apache.axis2.tools.component.Utilities;
+import org.apache.axis2.tools.component.WizardPanel;
+
+/**
+ * codeaFrame class
+ */
+
+public class CodegenFrame extends WizardFrame{
+    public static final int PANEL_CHOOSER = 0;
+    public static final int PANEL_FIRST_A = 1;    //
+    public static final int PANEL_FIRST_B = 2;
+    public static final int PANEL_OPTION_A =2;
+    public static final int PANEL_OPTION_B = 3;
+    public static final int PANEL_LAST_A = 3;
+    public static final int PANEL_LAST_B = 6;
+
+    private WsdlgenBean wsdlgenBean;
+    private CodegenBean codegenBean;
+
+    public CodegenFrame() {
+        super();
+        init();
+    }
+
+    private void init() {
+        this.setTitle("Axis2 Codegen Wizard");
+
+        WizardPanel panel = null;
+
+        wsdlgenBean= new WsdlgenBean();
+        codegenBean = new CodegenBean();
+       /*
+        panel = new ChooserPanel(getWizardComponents());
+        getWizardComponents().addWizardPanel(PANEL_CHOOSER , panel);
+
+        panel = new FirstPanel(getWizardComponents(),codegenBean);
+        getWizardComponents().addWizardPanel(PANEL_FIRST_A , panel);
+
+        panel = new J2WFristWizardPanel(getWizardComponents(),wsdlgenBean );
+        getWizardComponents().addWizardPanel(PANEL_FIRST_B, panel);
+
+        panel = new SecondPanel(getWizardComponents(),codegenBean);
+        getWizardComponents().addWizardPanel(PANEL_OPTION_A , panel);
+
+        panel = new J2WOptionWizardPanel(getWizardComponents(),wsdlgenBean);
+        getWizardComponents().addWizardPanel(PANEL_OPTION_B , panel);
+
+        panel = new OutPutPanel(getWizardComponents(),codegenBean);
+        getWizardComponents().addWizardPanel(PANEL_LAST_A , panel);
+
+        panel = new J2WLocationWizardPanel(getWizardComponents(),wsdlgenBean);
+        getWizardComponents().addWizardPanel(PANEL_LAST_B , panel);*/
+
+        setSize(550, 200);
+        Utilities.centerComponentOnScreen(this);
+
+    }
+}

Added: webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/WizardFrame.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/WizardFrame.java?view=auto&rev=551476
==============================================================================
--- webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/WizardFrame.java (added)
+++ webservices/axis2/trunk/java/modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/wizardframe/WizardFrame.java Wed Jun 27 23:56:34 2007
@@ -0,0 +1,121 @@
+package org.apache.axis2.tools.wizardframe;
+
+import org.apache.axis2.tools.component.CancelAction;
+import org.apache.axis2.tools.component.WizardComponents;
+import org.apache.axis2.tools.component.FinishAction;
+import org.apache.axis2.tools.component.DefaultWizardComponents;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/**
+ * wizardFrame class
+ */
+public class WizardFrame extends JFrame {
+    private WizardComponents wizardComponents;
+
+    public WizardFrame() {
+        init();
+    }
+
+    private void init() {
+
+        wizardComponents = new DefaultWizardComponents();
+
+        this.getContentPane().setLayout(new GridBagLayout());
+       /* this.getContentPane().add(new ImagePanel(wizardComponents)
+                , new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0
+                , GridBagConstraints.NORTH, GridBagConstraints.BOTH
+                , new Insets(0, 0, 0, 0), 0, 0));
+
+        this.getContentPane().add(new JSeparator()
+                , new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0
+                , GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
+                new Insets(1, 1, 1, 1), 0, 0));
+
+        this.getContentPane().add(wizardComponents.getWizardPanelsContainer()
+                , new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0
+                , GridBagConstraints.PAGE_START , GridBagConstraints.BOTH
+                , new Insets(10, 0, 0, 0), 0, 0));
+
+        this.getContentPane().add(new ProgressBarPanel(wizardComponents)
+                , new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0
+                , GridBagConstraints.CENTER, GridBagConstraints.NONE
+                , new Insets(10, 0, 0, 0), 0, 0));
+
+        this.getContentPane().add(new JSeparator()
+                , new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0
+                , GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL
+                , new Insets(1, 1, 1, 1), 0, 0));
+
+        this.getContentPane().add(createButtonPanel(),
+                new GridBagConstraints(0, 5, 1, 1, 1.0, 0.0
+                        ,GridBagConstraints.EAST, GridBagConstraints.NONE,
+                        new Insets(20, 20, 20, 20), 0, 0));*/
+
+        ImageIcon  img=new ImageIcon("icons/icon.png");
+        this.setIconImage(img.getImage());
+
+        wizardComponents.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent event) {
+
+            }
+        });
+        wizardComponents.setFinishAction(createFinishAction());
+        wizardComponents.setCancelAction(createCancelAction());
+        handleWindowClosing();
+    }
+
+    public WizardComponents getWizardComponents(){
+        return wizardComponents;
+    }
+
+    public void setWizardComponents(WizardComponents aWizardComponents){
+        wizardComponents = aWizardComponents;
+    }
+
+    public void show() {
+        wizardComponents.updateComponents();
+        super.show();
+    }
+
+    protected JPanel createButtonPanel() {
+        JPanel panel = new JPanel(new GridLayout());
+        panel.add(wizardComponents.getBackButton());
+        panel.add(wizardComponents.getNextButton());
+        panel.add(wizardComponents.getFinishButton());
+        panel.add(wizardComponents.getCancelButton());
+        return panel;
+    }
+
+    protected FinishAction createFinishAction() {
+        return new FinishAction(wizardComponents) {
+            public void performAction() {
+                System.out.println("FinishAction performed");
+                dispose();
+            }
+        };
+    }
+
+    protected CancelAction createCancelAction() {
+        return new CancelAction(wizardComponents) {
+            public void performAction() {
+                System.out.println("CancelAction performed");
+                dispose();
+            }
+        };
+    }
+
+    protected void handleWindowClosing() {
+        this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+        this.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                wizardComponents.getCancelAction().performAction();
+            }
+        });
+    }
+}



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