fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / scripting / workben / installer / Final.java
blob51646315d2b13efe2ed6709bd395a223d31ddfd6
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 Final extends javax.swing.JPanel implements ActionListener, InstallListener {
27 /** Creates new form Welcome */
28 public Final(InstallWizard wizard) {
29 this.wizard = wizard;
30 setBackground(java.awt.Color.white);
31 xud = 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. \n All Office processes must be terminated.");
50 statusPanel.add(statusLine, java.awt.BorderLayout.CENTER);
52 add(statusPanel, java.awt.BorderLayout.CENTER);
53 nav = new NavPanel(wizard, true, true, true, InstallWizard.VERSIONS, "");
54 nav.setNextListener(this);
55 nav.removeCancelListener(nav);
56 nav.setCancelListener(this);
57 nav.navNext.setText("Install");
58 add(nav, java.awt.BorderLayout.SOUTH);
62 }//GEN-END:initComponents
64 public java.awt.Dimension getPreferredSize() {
65 return new java.awt.Dimension(InstallWizard.DEFWIDTH, InstallWizard.DEFHEIGHT);
68 public void actionPerformed(ActionEvent e) {
69 // navNext is "Install"
70 if (e.getSource() == nav.navNext)
72 JProgressBar progressBar=new JProgressBar();
73 progressBar.setMaximum(10);
74 progressBar.setValue(0);
75 statusPanel.add(progressBar, java.awt.BorderLayout.SOUTH);
76 nav.enableNext(false);
77 nav.enableBack(false);
78 nav.enableCancel(false);
79 ArrayList<?> locations = InstallWizard.getLocations();
80 //System.out.println("here "+locations.size());
81 // Returned 1
82 String progpath=null;
83 String path=null;
84 String classespath=null;
85 for (int i =0;i<locations.size();i++){
86 path= (String)locations.get(i);
87 //InstallWizard.currentPath = path;
88 xud = new XmlUpdater(path, statusLine,progressBar,InstallWizard.bNetworkInstall,InstallWizard.bBindingsInstall);
89 xud.addInstallListener(this);
90 InstallWizard.setInstallStarted(true);
91 InstallWizard.setPatchedTypes(false);
92 InstallWizard.setPatchedJava(false);
93 InstallWizard.setPatchedRDB(false);
94 xud.start();
98 // set to "Exit" at end of installation process
99 if (e.getSource() == nav.navCancel) {
100 int answer = JOptionPane.showConfirmDialog(wizard, "Are you sure you want to exit?");
101 if (answer == JOptionPane.YES_OPTION)
103 wizard.exitForm(null);
105 else
107 return;
110 }// actionPerformed
113 public void installationComplete(InstallationEvent ev) {
114 //System.out.println("Detected installation complete");
115 if( InstUtil.hasNetbeansInstallation() ) {
116 //System.out.println("Detected installation complete (IDE(s) detected)");
117 nav.removeCancelListener(this);
118 nav.setCancelListener(nav);
119 nav.navCancel.setText("Finish");
120 nav.enableIDE(true);
121 nav.enableCancel(true);
122 xud = null;
124 else {
125 //System.out.println("Detected installation complete (No IDE(s) detected)");
126 nav.removeCancelListener(this);
127 nav.setCancelListener(nav);
128 nav.navCancel.setText("Finish");
129 nav.enableCancel(true);
130 xud = null;
134 // Variables declaration - do not modify//GEN-BEGIN:variables
135 private javax.swing.JPanel statusPanel;
136 private javax.swing.JLabel statusLine;
137 private InstallWizard wizard;
138 private NavPanel nav;
139 private XmlUpdater xud;
140 // End of variables declaration//GEN-END:variables