fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / scripting / workben / installer / IdeFinal.java
blob2d91929358ab501a47012016312816f53f13ee63
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package installer;
21 import java.awt.event.*;
22 import java.util.*;
23 import javax.swing.*;
25 public class IdeFinal extends javax.swing.JPanel implements ActionListener, InstallListener {
27 /** Creates new form Welcome */
28 public IdeFinal(InstallWizard wizard) {
29 this.wizard = wizard;
30 setBackground(java.awt.Color.white);
31 ideupdater = null;
32 initComponents();
35 /** This method is called from within the constructor to
36 * initialize the form.
37 * WARNING: Do NOT modify this code. The content of this method is
38 * always regenerated by the Form Editor.
40 private void initComponents() {//GEN-BEGIN:initComponents
41 statusPanel = new javax.swing.JPanel();
42 statusPanel.setBackground(java.awt.Color.white);
43 statusLine = new javax.swing.JLabel("Ready", javax.swing.JLabel.CENTER);
45 setLayout(new java.awt.BorderLayout());
47 statusPanel.setLayout(new java.awt.BorderLayout());
49 statusLine.setText("Waiting to install IDE support.");
50 statusPanel.add(statusLine, java.awt.BorderLayout.CENTER);
52 add(statusPanel, java.awt.BorderLayout.CENTER);
53 nav = new NavPanel(wizard, true, true, true, InstallWizard.IDEVERSIONS, "");
54 nav.setNextListener(this);
55 nav.removeCancelListener(nav);
56 nav.setCancelListener(this);
57 nav.navNext.setText("Install");
58 add(nav, java.awt.BorderLayout.SOUTH);
59 }//GEN-END:initComponents
61 public java.awt.Dimension getPreferredSize() {
62 return new java.awt.Dimension(InstallWizard.DEFWIDTH, InstallWizard.DEFHEIGHT);
65 public void actionPerformed(ActionEvent e) {
66 // navNext is "Install"
67 if (e.getSource() == nav.navNext)
69 JProgressBar progressBar=new JProgressBar();
70 progressBar.setMaximum(10);
71 progressBar.setValue(0);
72 statusPanel.add(progressBar, java.awt.BorderLayout.SOUTH);
73 nav.enableNext(false);
74 nav.enableBack(false);
75 nav.enableCancel(false);
76 ArrayList<?> locations = InstallWizard.getLocations();
77 //System.out.println("here "+locations.size());
78 // Returned 1
79 String progpath=null;
80 String path=null;
81 String classespath=null;
82 for (int i =0;i<locations.size();i++){
83 path= (String)locations.get(i);
85 //InstallWizard.currentPath = path;
86 ideupdater = new IdeUpdater( path, statusLine, progressBar );
87 ideupdater.addInstallListener(this);
88 InstallWizard.setInstallStarted(true);
89 //InstallWizard.setPatchedTypes(false);
90 //InstallWizard.setPatchedJava(false);
91 //InstallWizard.setPatchedRDB(false);
92 ideupdater.start();
96 // set to "Exit" at end of installation process
97 if (e.getSource() == nav.navCancel) {
98 int answer = JOptionPane.showConfirmDialog(wizard, "Are you sure you want to exit?");
99 if (answer == JOptionPane.YES_OPTION)
101 wizard.exitForm(null);
103 else
105 return;
108 }// actionPerformed
111 public void installationComplete(InstallationEvent ev) {
112 //System.out.println("Detected installation complete");
113 //if( InstUtil.hasNetbeansInstallation() || InstUtil.hasJeditInstallation() ) {
114 //System.out.println("Detected installation complete (IDE(s) detected)");
115 nav.removeCancelListener(this);
116 nav.setCancelListener(nav);
117 nav.navCancel.setText("Finish");
118 nav.enableCancel(true);
119 ideupdater = null;
122 // Variables declaration - do not modify//GEN-BEGIN:variables
123 private javax.swing.JPanel statusPanel;
124 private javax.swing.JLabel statusLine;
125 private InstallWizard wizard;
126 private NavPanel nav;
127 //private XmlUpdater xud;
128 private IdeUpdater ideupdater;
129 // End of variables declaration//GEN-END:variables