1*cdf0e10cSrcweir package installer; 2*cdf0e10cSrcweir 3*cdf0e10cSrcweir /* 4*cdf0e10cSrcweir * Welcome.java 5*cdf0e10cSrcweir * 6*cdf0e10cSrcweir * Created on 04 July 2002, 15:43 7*cdf0e10cSrcweir */ 8*cdf0e10cSrcweir 9*cdf0e10cSrcweir /** 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * @author mike 12*cdf0e10cSrcweir */ 13*cdf0e10cSrcweir 14*cdf0e10cSrcweir import java.awt.event.*; 15*cdf0e10cSrcweir import java.util.*; 16*cdf0e10cSrcweir import java.net.*; 17*cdf0e10cSrcweir import javax.swing.*; 18*cdf0e10cSrcweir 19*cdf0e10cSrcweir public class IdeFinal extends javax.swing.JPanel implements ActionListener, InstallListener { 20*cdf0e10cSrcweir 21*cdf0e10cSrcweir /** Creates new form Welcome */ 22*cdf0e10cSrcweir public IdeFinal(InstallWizard wizard) { 23*cdf0e10cSrcweir this.wizard = wizard; 24*cdf0e10cSrcweir setBackground(java.awt.Color.white); 25*cdf0e10cSrcweir ideupdater = null; 26*cdf0e10cSrcweir initComponents(); 27*cdf0e10cSrcweir } 28*cdf0e10cSrcweir 29*cdf0e10cSrcweir /** This method is called from within the constructor to 30*cdf0e10cSrcweir * initialize the form. 31*cdf0e10cSrcweir * WARNING: Do NOT modify this code. The content of this method is 32*cdf0e10cSrcweir * always regenerated by the Form Editor. 33*cdf0e10cSrcweir */ 34*cdf0e10cSrcweir private void initComponents() {//GEN-BEGIN:initComponents 35*cdf0e10cSrcweir statusPanel = new javax.swing.JPanel(); 36*cdf0e10cSrcweir statusPanel.setBackground(java.awt.Color.white); 37*cdf0e10cSrcweir statusLine = new javax.swing.JLabel("Ready", javax.swing.JLabel.CENTER); 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir setLayout(new java.awt.BorderLayout()); 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir statusPanel.setLayout(new java.awt.BorderLayout()); 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir statusLine.setText("Waiting to install IDE support."); 44*cdf0e10cSrcweir statusPanel.add(statusLine, java.awt.BorderLayout.CENTER); 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir add(statusPanel, java.awt.BorderLayout.CENTER); 47*cdf0e10cSrcweir nav = new NavPanel(wizard, true, true, true, InstallWizard.IDEVERSIONS, ""); 48*cdf0e10cSrcweir nav.setNextListener(this); 49*cdf0e10cSrcweir nav.removeCancelListener(nav); 50*cdf0e10cSrcweir nav.setCancelListener(this); 51*cdf0e10cSrcweir nav.navNext.setText("Install"); 52*cdf0e10cSrcweir add(nav, java.awt.BorderLayout.SOUTH); 53*cdf0e10cSrcweir }//GEN-END:initComponents 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir public java.awt.Dimension getPreferredSize() { 56*cdf0e10cSrcweir return new java.awt.Dimension(InstallWizard.DEFWIDTH, InstallWizard.DEFHEIGHT); 57*cdf0e10cSrcweir } 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir public void actionPerformed(ActionEvent e) { 60*cdf0e10cSrcweir // navNext is "Install" 61*cdf0e10cSrcweir if (e.getSource() == nav.navNext) 62*cdf0e10cSrcweir { 63*cdf0e10cSrcweir JProgressBar progressBar=new JProgressBar(); 64*cdf0e10cSrcweir progressBar.setMaximum(10); 65*cdf0e10cSrcweir progressBar.setValue(0); 66*cdf0e10cSrcweir statusPanel.add(progressBar, java.awt.BorderLayout.SOUTH); 67*cdf0e10cSrcweir nav.enableNext(false); 68*cdf0e10cSrcweir nav.enableBack(false); 69*cdf0e10cSrcweir nav.enableCancel(false); 70*cdf0e10cSrcweir ArrayList locations = wizard.getLocations(); 71*cdf0e10cSrcweir //System.out.println("here "+locations.size()); 72*cdf0e10cSrcweir // Returned 1 73*cdf0e10cSrcweir String progpath=null; 74*cdf0e10cSrcweir String path=null; 75*cdf0e10cSrcweir String classespath=null; 76*cdf0e10cSrcweir for (int i =0;i<locations.size();i++){ 77*cdf0e10cSrcweir path= (String)locations.get(i); 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir //InstallWizard.currentPath = path; 80*cdf0e10cSrcweir ideupdater = new IdeUpdater( path, statusLine, progressBar ); 81*cdf0e10cSrcweir ideupdater.addInstallListener(this); 82*cdf0e10cSrcweir InstallWizard.setInstallStarted(true); 83*cdf0e10cSrcweir //InstallWizard.setPatchedTypes(false); 84*cdf0e10cSrcweir //InstallWizard.setPatchedJava(false); 85*cdf0e10cSrcweir //InstallWizard.setPatchedRDB(false); 86*cdf0e10cSrcweir ideupdater.start(); 87*cdf0e10cSrcweir } 88*cdf0e10cSrcweir } 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir // set to "Exit" at end of installation process 91*cdf0e10cSrcweir if (e.getSource() == nav.navCancel) { 92*cdf0e10cSrcweir int answer = JOptionPane.showConfirmDialog(wizard, "Are you sure you want to exit?"); 93*cdf0e10cSrcweir if (answer == JOptionPane.YES_OPTION) 94*cdf0e10cSrcweir { 95*cdf0e10cSrcweir wizard.exitForm(null); 96*cdf0e10cSrcweir } 97*cdf0e10cSrcweir else 98*cdf0e10cSrcweir { 99*cdf0e10cSrcweir return; 100*cdf0e10cSrcweir } 101*cdf0e10cSrcweir } 102*cdf0e10cSrcweir }// actionPerformed 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir public void installationComplete(InstallationEvent ev) { 106*cdf0e10cSrcweir //System.out.println("Detected installation complete"); 107*cdf0e10cSrcweir //if( InstUtil.hasNetbeansInstallation() || InstUtil.hasJeditInstallation() ) { 108*cdf0e10cSrcweir //System.out.println("Detected installation complete (IDE(s) detected)"); 109*cdf0e10cSrcweir nav.removeCancelListener(this); 110*cdf0e10cSrcweir nav.setCancelListener(nav); 111*cdf0e10cSrcweir nav.navCancel.setText("Finish"); 112*cdf0e10cSrcweir nav.enableCancel(true); 113*cdf0e10cSrcweir ideupdater = null; 114*cdf0e10cSrcweir } 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir // Variables declaration - do not modify//GEN-BEGIN:variables 117*cdf0e10cSrcweir private javax.swing.JPanel statusPanel; 118*cdf0e10cSrcweir private javax.swing.JLabel statusLine; 119*cdf0e10cSrcweir private InstallWizard wizard; 120*cdf0e10cSrcweir private NavPanel nav; 121*cdf0e10cSrcweir //private XmlUpdater xud; 122*cdf0e10cSrcweir private IdeUpdater ideupdater; 123*cdf0e10cSrcweir // End of variables declaration//GEN-END:variables 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir } 126