001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU General
007: * Public License Version 2 only ("GPL") or the Common Development and Distribution
008: * License("CDDL") (collectively, the "License"). You may not use this file except in
009: * compliance with the License. You can obtain a copy of the License at
010: * http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
011: * License for the specific language governing permissions and limitations under the
012: * License. When distributing the software, include this License Header Notice in
013: * each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Sun
014: * designates this particular file as subject to the "Classpath" exception as
015: * provided by Sun in the GPL Version 2 section of the License file that
016: * accompanied this code. If applicable, add the following below the License Header,
017: * with the fields enclosed by brackets [] replaced by your own identifying
018: * information: "Portions Copyrighted [year] [name of copyright owner]"
019: *
020: * Contributor(s):
021: *
022: * The Original Software is NetBeans. The Initial Developer of the Original Software
023: * is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
024: * Rights Reserved.
025: *
026: * If you wish your version of this file to be governed by only the CDDL or only the
027: * GPL Version 2, indicate your decision by adding "[Contributor] elects to include
028: * this software in this distribution under the [CDDL or GPL Version 2] license." If
029: * you do not indicate a single choice of license, a recipient has the option to
030: * distribute your version of this file under either the CDDL, the GPL Version 2 or
031: * to extend the choice of license to its licensees as provided above. However, if
032: * you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then
033: * the option applies only if the new code is made subject to such option by the
034: * copyright holder.
035: */
036:
037: package org.netbeans.installer.wizard.components.panels;
038:
039: import java.awt.GridBagConstraints;
040: import java.awt.Insets;
041: import java.awt.event.ActionEvent;
042: import java.awt.event.ActionListener;
043: import java.awt.event.WindowAdapter;
044: import java.awt.event.WindowEvent;
045: import java.util.LinkedList;
046: import java.util.List;
047: import org.netbeans.installer.product.components.Product;
048: import org.netbeans.installer.product.Registry;
049: import org.netbeans.installer.utils.helper.ErrorLevel;
050: import org.netbeans.installer.utils.ErrorManager;
051: import org.netbeans.installer.utils.FileUtils;
052: import org.netbeans.installer.utils.LogManager;
053: import org.netbeans.installer.utils.ResourceUtils;
054: import org.netbeans.installer.utils.StringUtils;
055: import org.netbeans.installer.utils.helper.swing.NbiButton;
056: import org.netbeans.installer.utils.helper.swing.NbiLabel;
057: import org.netbeans.installer.utils.helper.swing.NbiPanel;
058: import org.netbeans.installer.utils.helper.swing.NbiTextPane;
059: import org.netbeans.installer.wizard.ui.SwingUi;
060: import org.netbeans.installer.wizard.ui.WizardUi;
061: import org.netbeans.installer.wizard.components.WizardPanel;
062: import org.netbeans.installer.wizard.components.WizardPanel.WizardPanelSwingUi;
063: import org.netbeans.installer.wizard.components.WizardPanel.WizardPanelUi;
064: import org.netbeans.installer.wizard.containers.SwingContainer;
065: import org.netbeans.installer.wizard.containers.SwingFrameContainer;
066: import org.netbeans.installer.wizard.utils.InstallationDetailsDialog;
067: import org.netbeans.installer.wizard.utils.InstallationLogDialog;
068: import static org.netbeans.installer.utils.helper.DetailedStatus.INSTALLED_SUCCESSFULLY;
069: import static org.netbeans.installer.utils.helper.DetailedStatus.INSTALLED_WITH_WARNINGS;
070: import static org.netbeans.installer.utils.helper.DetailedStatus.FAILED_TO_INSTALL;
071: import static org.netbeans.installer.utils.helper.DetailedStatus.UNINSTALLED_SUCCESSFULLY;
072: import static org.netbeans.installer.utils.helper.DetailedStatus.UNINSTALLED_WITH_WARNINGS;
073: import static org.netbeans.installer.utils.helper.DetailedStatus.FAILED_TO_UNINSTALL;
074:
075: /**
076: *
077: * @author Kirill Sorokin
078: */
079: public class PostInstallSummaryPanel extends WizardPanel {
080: /////////////////////////////////////////////////////////////////////////////////
081: // Instance
082: public PostInstallSummaryPanel() {
083: setProperty(MESSAGE_SUCCESS_TEXT_PROPERTY,
084: DEFAULT_MESSAGE_SUCCESS_TEXT);
085: setProperty(MESSAGE_SUCCESS_CONTENT_TYPE_PROPERTY,
086: DEFAULT_MESSAGE_SUCCESS_CONTENT_TYPE);
087: setProperty(MESSAGE_WARNINGS_TEXT_PROPERTY,
088: DEFAULT_MESSAGE_WARNINGS_TEXT);
089: setProperty(MESSAGE_WARNINGS_CONTENT_TYPE_PROPERTY,
090: DEFAULT_MESSAGE_WARNINGS_CONTENT_TYPE);
091: setProperty(MESSAGE_ERRORS_TEXT_PROPERTY,
092: DEFAULT_MESSAGE_ERRORS_TEXT);
093: setProperty(MESSAGE_ERRORS_CONTENT_TYPE_PROPERTY,
094: DEFAULT_MESSAGE_ERRORS_CONTENT_TYPE);
095: setProperty(SUCCESSFULLY_INSTALLED_LABEL_TEXT_PROPERTY,
096: DEFAULT_SUCCESSFULLY_INSTALLED_LABEL_TEXT);
097: setProperty(SUCCESSFULLY_INSTALLED_TEXT_PROPERTY,
098: DEFAULT_SUCCESSFULLY_INSTALLED_TEXT);
099: setProperty(SUCCESSFULLY_INSTALLED_CONTENT_TYPE_PROPERTY,
100: DEFAULT_SUCCESSFULLY_INSTALLED_CONTENT_TYPE);
101: setProperty(INSTALLED_WITH_WARNINGS_LABEL_TEXT_PROPERTY,
102: DEFAULT_INSTALLED_WITH_WARNINGS_LABEL_TEXT);
103: setProperty(INSTALLED_WITH_WARNINGS_TEXT_PROPERTY,
104: DEFAULT_INSTALLED_WITH_WARNINGS_TEXT);
105: setProperty(INSTALLED_WITH_WARNINGS_CONTENT_TYPE_PROPERTY,
106: DEFAULT_INSTALLED_WITH_WARNINGS_CONTENT_TYPE);
107: setProperty(FAILED_TO_INSTALL_WARNINGS_LABEL_TEXT_PROPERTY,
108: DEFAULT_FAILED_TO_INSTALL_WARNINGS_LABEL_TEXT);
109: setProperty(FAILED_TO_INSTALL_TEXT_PROPERTY,
110: DEFAULT_FAILED_TO_INSTALL_TEXT);
111: setProperty(FAILED_TO_INSTALL_CONTENT_TYPE_PROPERTY,
112: DEFAULT_FAILED_TO_INSTALL_CONTENT_TYPE);
113: setProperty(SUCCESSFULLY_UNINSTALLED_LABEL_TEXT_PROPERTY,
114: DEFAULT_SUCCESSFULLY_UNINSTALLED_LABEL_TEXT);
115: setProperty(SUCCESSFULLY_UNINSTALLED_TEXT_PROPERTY,
116: DEFAULT_SUCCESSFULLY_UNINSTALLED_TEXT);
117: setProperty(SUCCESSFULLY_UNINSTALLED_CONTENT_TYPE_PROPERTY,
118: DEFAULT_SUCCESSFULLY_UNINSTALLED_CONTENT_TYPE);
119: setProperty(UNINSTALLED_WITH_WARNINGS_LABEL_TEXT_PROPERTY,
120: DEFAULT_UNINSTALLED_WITH_WARNINGS_LABEL_TEXT);
121: setProperty(UNINSTALLED_WITH_WARNINGS_TEXT_PROPERTY,
122: DEFAULT_UNINSTALLED_WITH_WARNINGS_TEXT);
123: setProperty(UNINSTALLED_WITH_WARNINGS_CONTENT_TYPE_PROPERTY,
124: DEFAULT_UNINSTALLED_WITH_WARNINGS_CONTENT_TYPE);
125: setProperty(FAILED_TO_UNINSTALL_WARNINGS_LABEL_TEXT_PROPERTY,
126: DEFAULT_FAILED_TO_UNINSTALL_WARNINGS_LABEL_TEXT);
127: setProperty(FAILED_TO_UNINSTALL_TEXT_PROPERTY,
128: DEFAULT_FAILED_TO_UNINSTALL_TEXT);
129: setProperty(FAILED_TO_UNINSTALL_CONTENT_TYPE_PROPERTY,
130: DEFAULT_FAILED_TO_UNINSTALL_CONTENT_TYPE);
131: setProperty(MESSAGE_FILES_REMAINING_PROPERTY,
132: DEFAULT_MESSAGE_FILES_REMAINING);
133: setProperty(VIEW_DETAILS_BUTTON_TEXT_PROPERTY,
134: DEFAULT_VIEW_DETAILS_BUTTON_TEXT);
135: setProperty(VIEW_LOG_BUTTON_TEXT_PROPERTY,
136: DEFAULT_VIEW_LOG_BUTTON_TEXT);
137: setProperty(SEND_LOG_BUTTON_TEXT_PROPERTY,
138: DEFAULT_SEND_LOG_BUTTON_TEXT);
139: setProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY,
140: DEFAULT_COMPONENTS_LIST_SEPARATOR);
141: setProperty(ERROR_LOGFILE_UNAVAILABLE_PROPERTY,
142: DEFAULT_ERROR_LOGFILE_UNAVAILABLE_TEXT);
143:
144: setProperty(TITLE_PROPERTY, DEFAULT_DIALOG_TITLE);
145: }
146:
147: @Override
148: public WizardUi getWizardUi() {
149: if (wizardUi == null) {
150: wizardUi = new PostInstallSummaryPanelUi(this );
151: }
152:
153: return wizardUi;
154: }
155:
156: /////////////////////////////////////////////////////////////////////////////////
157: // Inner Classes
158: public static class PostInstallSummaryPanelUi extends WizardPanelUi {
159: protected PostInstallSummaryPanel component;
160:
161: public PostInstallSummaryPanelUi(
162: PostInstallSummaryPanel component) {
163: super (component);
164:
165: this .component = component;
166: }
167:
168: @Override
169: public SwingUi getSwingUi(SwingContainer container) {
170: if (swingUi == null) {
171: swingUi = new PostInstallSummaryPanelSwingUi(component,
172: container);
173: }
174:
175: return super .getSwingUi(container);
176: }
177: }
178:
179: public static class PostInstallSummaryPanelSwingUi extends
180: WizardPanelSwingUi {
181: protected PostInstallSummaryPanel component;
182:
183: private NbiTextPane messagePane;
184:
185: private NbiLabel successfullyInstalledComponentsLabel;
186: private NbiTextPane successfullyInstalledComponentsPane;
187: private NbiLabel componentsInstalledWithWarningsLabel;
188: private NbiTextPane componentsInstalledWithWarningsPane;
189: private NbiLabel componentsFailedToInstallLabel;
190: private NbiTextPane componentsFailedToInstallPane;
191:
192: private NbiLabel successfullyUninstalledComponentsLabel;
193: private NbiTextPane successfullyUninstalledComponentsPane;
194: private NbiLabel componentsUninstalledWithWarningsLabel;
195: private NbiTextPane componentsUninstalledWithWarningsPane;
196: private NbiLabel componentsFailedToUninstallLabel;
197: private NbiTextPane componentsFailedToUninstallPane;
198:
199: private NbiButton viewDetailsButton;
200: private NbiButton viewLogButton;
201: private NbiButton sendLogButton;
202:
203: private NbiPanel spacer;
204:
205: private InstallationDetailsDialog detailsDialog;
206: private InstallationLogDialog logDialog;
207:
208: public PostInstallSummaryPanelSwingUi(
209: final PostInstallSummaryPanel component,
210: final SwingContainer container) {
211: super (component, container);
212:
213: this .component = component;
214:
215: initComponents();
216: }
217:
218: // protected ////////////////////////////////////////////////////////////////
219: @Override
220: protected void initializeContainer() {
221: super .initializeContainer();
222:
223: // set up the back button
224: container.getBackButton().setEnabled(false);
225:
226: // set up the next (or finish) button
227: container.getNextButton().setText(
228: component.getProperty(FINISH_BUTTON_TEXT_PROPERTY));
229:
230: // set up the cancel button
231: container.getCancelButton().setEnabled(false);
232: }
233:
234: @Override
235: protected void initialize() {
236: final Registry registry = Registry.getInstance();
237:
238: final boolean errorsEncountered = registry.getProducts(
239: FAILED_TO_INSTALL).size() > 0
240: && registry.getProducts(FAILED_TO_UNINSTALL).size() > 0;
241: final boolean warningsEncountered = registry.getProducts(
242: INSTALLED_WITH_WARNINGS).size() > 0
243: && registry.getProducts(UNINSTALLED_WITH_WARNINGS)
244: .size() > 0;
245:
246: if (errorsEncountered) {
247: messagePane
248: .setContentType(component
249: .getProperty(MESSAGE_ERRORS_CONTENT_TYPE_PROPERTY));
250: messagePane.setText(component
251: .getProperty(MESSAGE_ERRORS_TEXT_PROPERTY));
252: } else if (warningsEncountered) {
253: messagePane
254: .setContentType(component
255: .getProperty(MESSAGE_WARNINGS_CONTENT_TYPE_PROPERTY));
256: messagePane.setText(component
257: .getProperty(MESSAGE_WARNINGS_TEXT_PROPERTY));
258: } else {
259: messagePane
260: .setContentType(component
261: .getProperty(MESSAGE_SUCCESS_CONTENT_TYPE_PROPERTY));
262: messagePane.setText(component
263: .getProperty(MESSAGE_SUCCESS_TEXT_PROPERTY));
264: }
265:
266: List<Product> products;
267:
268: products = registry.getProducts(INSTALLED_SUCCESSFULLY);
269: if (products.size() > 0) {
270: successfullyInstalledComponentsLabel.setVisible(true);
271: successfullyInstalledComponentsPane.setVisible(true);
272:
273: successfullyInstalledComponentsLabel
274: .setText(component
275: .getProperty(SUCCESSFULLY_INSTALLED_LABEL_TEXT_PROPERTY));
276: successfullyInstalledComponentsPane
277: .setContentType(component
278: .getProperty(SUCCESSFULLY_INSTALLED_CONTENT_TYPE_PROPERTY));
279: successfullyInstalledComponentsPane
280: .setText(StringUtils
281: .format(
282: component
283: .getProperty(SUCCESSFULLY_INSTALLED_TEXT_PROPERTY),
284: StringUtils
285: .asString(
286: products,
287: component
288: .getProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY))));
289: } else {
290: successfullyInstalledComponentsLabel.setVisible(false);
291: successfullyInstalledComponentsPane.setVisible(false);
292: }
293:
294: products = registry.getProducts(INSTALLED_WITH_WARNINGS);
295: if (products.size() > 0) {
296: componentsInstalledWithWarningsLabel.setVisible(true);
297: componentsInstalledWithWarningsPane.setVisible(true);
298:
299: componentsInstalledWithWarningsLabel
300: .setText(component
301: .getProperty(INSTALLED_WITH_WARNINGS_LABEL_TEXT_PROPERTY));
302: componentsInstalledWithWarningsPane
303: .setContentType(component
304: .getProperty(INSTALLED_WITH_WARNINGS_CONTENT_TYPE_PROPERTY));
305: componentsInstalledWithWarningsPane
306: .setText(StringUtils
307: .format(
308: component
309: .getProperty(INSTALLED_WITH_WARNINGS_TEXT_PROPERTY),
310: StringUtils
311: .asString(
312: products,
313: component
314: .getProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY))));
315: } else {
316: componentsInstalledWithWarningsLabel.setVisible(false);
317: componentsInstalledWithWarningsPane.setVisible(false);
318: }
319:
320: products = registry.getProducts(FAILED_TO_INSTALL);
321: if (products.size() > 0) {
322: componentsFailedToInstallLabel.setVisible(true);
323: componentsFailedToInstallPane.setVisible(true);
324:
325: componentsFailedToInstallLabel
326: .setText(component
327: .getProperty(FAILED_TO_INSTALL_WARNINGS_LABEL_TEXT_PROPERTY));
328: componentsFailedToInstallPane
329: .setContentType(component
330: .getProperty(FAILED_TO_INSTALL_CONTENT_TYPE_PROPERTY));
331: componentsFailedToInstallPane
332: .setText(StringUtils
333: .format(
334: component
335: .getProperty(FAILED_TO_INSTALL_TEXT_PROPERTY),
336: StringUtils
337: .asString(
338: products,
339: component
340: .getProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY))));
341: } else {
342: componentsFailedToInstallLabel.setVisible(false);
343: componentsFailedToInstallPane.setVisible(false);
344: }
345:
346: products = registry.getProducts(UNINSTALLED_SUCCESSFULLY);
347: if (products.size() > 0) {
348: successfullyUninstalledComponentsLabel.setVisible(true);
349: successfullyUninstalledComponentsPane.setVisible(true);
350:
351: successfullyUninstalledComponentsLabel
352: .setText(component
353: .getProperty(SUCCESSFULLY_UNINSTALLED_LABEL_TEXT_PROPERTY));
354: successfullyUninstalledComponentsPane
355: .setContentType(component
356: .getProperty(SUCCESSFULLY_UNINSTALLED_CONTENT_TYPE_PROPERTY));
357: successfullyUninstalledComponentsPane
358: .setText(StringUtils
359: .format(
360: component
361: .getProperty(SUCCESSFULLY_UNINSTALLED_TEXT_PROPERTY),
362: StringUtils
363: .asString(
364: products,
365: component
366: .getProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY))));
367: } else {
368: successfullyUninstalledComponentsLabel
369: .setVisible(false);
370: successfullyUninstalledComponentsPane.setVisible(false);
371: }
372:
373: List<Product> notCompletelyRemoved = new LinkedList<Product>();
374: for (Product product : products) {
375: if (!FileUtils.isEmpty(product
376: .getInstallationLocation())) {
377: notCompletelyRemoved.add(product);
378: }
379: }
380:
381: if (notCompletelyRemoved.size() > 0) {
382: final String text = successfullyUninstalledComponentsPane
383: .getText();
384: successfullyUninstalledComponentsPane
385: .setText(text
386: + StringUtils
387: .format(
388: component
389: .getProperty(MESSAGE_FILES_REMAINING_PROPERTY),
390: StringUtils
391: .asString(notCompletelyRemoved)));
392: }
393:
394: products = registry.getProducts(UNINSTALLED_WITH_WARNINGS);
395: if (products.size() > 0) {
396: componentsUninstalledWithWarningsLabel.setVisible(true);
397: componentsUninstalledWithWarningsPane.setVisible(true);
398:
399: componentsUninstalledWithWarningsLabel
400: .setText(component
401: .getProperty(UNINSTALLED_WITH_WARNINGS_LABEL_TEXT_PROPERTY));
402: componentsUninstalledWithWarningsPane
403: .setContentType(component
404: .getProperty(UNINSTALLED_WITH_WARNINGS_CONTENT_TYPE_PROPERTY));
405: componentsUninstalledWithWarningsPane
406: .setText(StringUtils
407: .format(
408: component
409: .getProperty(UNINSTALLED_WITH_WARNINGS_TEXT_PROPERTY),
410: StringUtils
411: .asString(
412: products,
413: component
414: .getProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY))));
415: } else {
416: componentsUninstalledWithWarningsLabel
417: .setVisible(false);
418: componentsUninstalledWithWarningsPane.setVisible(false);
419: }
420:
421: notCompletelyRemoved = new LinkedList<Product>();
422: for (Product product : products) {
423: if (!FileUtils.isEmpty(product
424: .getInstallationLocation())) {
425: notCompletelyRemoved.add(product);
426: }
427: }
428:
429: if (notCompletelyRemoved.size() > 0) {
430: final String text = componentsUninstalledWithWarningsPane
431: .getText();
432: componentsUninstalledWithWarningsPane
433: .setText(text
434: + StringUtils
435: .format(
436: component
437: .getProperty(MESSAGE_FILES_REMAINING_PROPERTY),
438: StringUtils
439: .asString(notCompletelyRemoved)));
440: }
441:
442: products = registry.getProducts(FAILED_TO_UNINSTALL);
443: if (products.size() > 0) {
444: componentsFailedToUninstallLabel.setVisible(true);
445: componentsFailedToUninstallPane.setVisible(true);
446:
447: componentsFailedToUninstallLabel
448: .setText(component
449: .getProperty(FAILED_TO_UNINSTALL_WARNINGS_LABEL_TEXT_PROPERTY));
450: componentsFailedToUninstallPane
451: .setContentType(component
452: .getProperty(FAILED_TO_UNINSTALL_CONTENT_TYPE_PROPERTY));
453: componentsFailedToUninstallPane
454: .setText(StringUtils
455: .format(
456: component
457: .getProperty(FAILED_TO_UNINSTALL_TEXT_PROPERTY),
458: StringUtils
459: .asString(
460: products,
461: component
462: .getProperty(COMPONENTS_LIST_SEPARATOR_PROPERTY))));
463: } else {
464: componentsFailedToUninstallLabel.setVisible(false);
465: componentsFailedToUninstallPane.setVisible(false);
466: }
467:
468: final String viewDetailsButtonText = component
469: .getProperty(VIEW_DETAILS_BUTTON_TEXT_PROPERTY);
470: viewDetailsButton.setText(StringUtils
471: .stripMnemonic(viewDetailsButtonText));
472: viewDetailsButton.setMnemonic(StringUtils
473: .fetchMnemonic(viewDetailsButtonText));
474:
475: final String viewLogButtonText = component
476: .getProperty(VIEW_LOG_BUTTON_TEXT_PROPERTY);
477: viewLogButton.setText(StringUtils
478: .stripMnemonic(viewLogButtonText));
479: viewLogButton.setMnemonic(StringUtils
480: .fetchMnemonic(viewLogButtonText));
481:
482: final String sendLogButtonText = component
483: .getProperty(SEND_LOG_BUTTON_TEXT_PROPERTY);
484: sendLogButton.setText(StringUtils
485: .stripMnemonic(sendLogButtonText));
486: sendLogButton.setMnemonic(StringUtils
487: .fetchMnemonic(sendLogButtonText));
488: }
489:
490: // private //////////////////////////////////////////////////////////////////
491: private void initComponents() {
492: // messagePane //////////////////////////////////////////////////////////
493: messagePane = new NbiTextPane();
494:
495: // successfullyInstalledComponentsPane //////////////////////////////////
496: successfullyInstalledComponentsPane = new NbiTextPane();
497:
498: // successfullyInstalledComponentsLabel /////////////////////////////////
499: successfullyInstalledComponentsLabel = new NbiLabel();
500: successfullyInstalledComponentsLabel
501: .setLabelFor(successfullyInstalledComponentsPane);
502:
503: // componentsInstalledWithWarningsPane //////////////////////////////////
504: componentsInstalledWithWarningsPane = new NbiTextPane();
505:
506: // componentsInstalledWithWarningsLabel /////////////////////////////////
507: componentsInstalledWithWarningsLabel = new NbiLabel();
508: componentsInstalledWithWarningsLabel
509: .setLabelFor(componentsInstalledWithWarningsPane);
510:
511: // componentsFailedToInstallPane ////////////////////////////////////////
512: componentsFailedToInstallPane = new NbiTextPane();
513:
514: // componentsFailedToInstallLabel ///////////////////////////////////////
515: componentsFailedToInstallLabel = new NbiLabel();
516: componentsFailedToInstallLabel
517: .setLabelFor(componentsFailedToInstallPane);
518:
519: // successfullyUninstalledComponentsPane ////////////////////////////////
520: successfullyUninstalledComponentsPane = new NbiTextPane();
521:
522: // successfullyUninstalledComponentsLabel ///////////////////////////////
523: successfullyUninstalledComponentsLabel = new NbiLabel();
524: successfullyUninstalledComponentsLabel
525: .setLabelFor(successfullyUninstalledComponentsPane);
526:
527: // componentsUninstalledWithWarningsPane ////////////////////////////////
528: componentsUninstalledWithWarningsPane = new NbiTextPane();
529:
530: // componentsUninstalledWithWarningsLabel ///////////////////////////////
531: componentsUninstalledWithWarningsLabel = new NbiLabel();
532: componentsUninstalledWithWarningsLabel
533: .setLabelFor(componentsUninstalledWithWarningsPane);
534:
535: // componentsFailedToUninstallPane //////////////////////////////////////
536: componentsFailedToUninstallPane = new NbiTextPane();
537:
538: // componentsFailedToUninstallLabel /////////////////////////////////////
539: componentsFailedToUninstallLabel = new NbiLabel();
540: componentsFailedToUninstallLabel
541: .setLabelFor(componentsFailedToUninstallPane);
542:
543: // viewDetailsButton ////////////////////////////////////////////////////
544: viewDetailsButton = new NbiButton();
545: viewDetailsButton.addActionListener(new ActionListener() {
546: public void actionPerformed(ActionEvent event) {
547: viewDetailsButtonClicked();
548: }
549: });
550:
551: // viewLogButton ////////////////////////////////////////////////////////
552: viewLogButton = new NbiButton();
553: viewLogButton.addActionListener(new ActionListener() {
554: public void actionPerformed(ActionEvent event) {
555: viewLogButtonClicked();
556: }
557: });
558:
559: // sendLogButton ////////////////////////////////////////////////////////
560: sendLogButton = new NbiButton();
561: sendLogButton.addActionListener(new ActionListener() {
562: public void actionPerformed(ActionEvent event) {
563: sendLogButtonClicked();
564: }
565: });
566: sendLogButton.setEnabled(false);
567:
568: // spacer ///////////////////////////////////////////////////////////////
569: spacer = new NbiPanel();
570:
571: // this /////////////////////////////////////////////////////////////////
572: add(messagePane, new GridBagConstraints(0, 0, // x, y
573: 3, 1, // width, height
574: 1.0, 0.0, // weight-x, weight-y
575: GridBagConstraints.CENTER, // anchor
576: GridBagConstraints.BOTH, // fill
577: new Insets(11, 11, 0, 11), // padding
578: 0, 0)); // padx, pady - ???
579: add(successfullyInstalledComponentsLabel,
580: new GridBagConstraints(0, 1, // x, y
581: 3, 1, // width, height
582: 1.0, 0.0, // weight-x, weight-y
583: GridBagConstraints.CENTER, // anchor
584: GridBagConstraints.BOTH, // fill
585: new Insets(15, 11, 0, 11), // padding
586: 0, 0)); // padx, pady - ???
587: add(successfullyInstalledComponentsPane,
588: new GridBagConstraints(0, 2, // x, y
589: 3, 1, // width, height
590: 1.0, 0.0, // weight-x, weight-y
591: GridBagConstraints.CENTER, // anchor
592: GridBagConstraints.BOTH, // fill
593: new Insets(3, 11, 0, 11), // padding
594: 0, 0)); // padx, pady - ???
595: add(componentsInstalledWithWarningsLabel,
596: new GridBagConstraints(0, 3, // x, y
597: 3, 1, // width, height
598: 1.0, 0.0, // weight-x, weight-y
599: GridBagConstraints.CENTER, // anchor
600: GridBagConstraints.BOTH, // fill
601: new Insets(15, 11, 0, 11), // padding
602: 0, 0)); // padx, pady - ???
603: add(componentsInstalledWithWarningsPane,
604: new GridBagConstraints(0, 4, // x, y
605: 3, 1, // width, height
606: 1.0, 0.0, // weight-x, weight-y
607: GridBagConstraints.CENTER, // anchor
608: GridBagConstraints.BOTH, // fill
609: new Insets(3, 11, 0, 11), // padding
610: 0, 0)); // padx, pady - ???
611: add(componentsFailedToInstallLabel, new GridBagConstraints(
612: 0, 5, // x, y
613: 3, 1, // width, height
614: 1.0, 0.0, // weight-x, weight-y
615: GridBagConstraints.CENTER, // anchor
616: GridBagConstraints.BOTH, // fill
617: new Insets(15, 11, 0, 11), // padding
618: 0, 0)); // padx, pady - ???
619: add(componentsFailedToInstallPane, new GridBagConstraints(
620: 0, 6, // x, y
621: 3, 1, // width, height
622: 1.0, 0.0, // weight-x, weight-y
623: GridBagConstraints.CENTER, // anchor
624: GridBagConstraints.BOTH, // fill
625: new Insets(3, 11, 0, 11), // padding
626: 0, 0)); // padx, pady - ???
627: add(successfullyUninstalledComponentsLabel,
628: new GridBagConstraints(0, 7, // x, y
629: 3, 1, // width, height
630: 1.0, 0.0, // weight-x, weight-y
631: GridBagConstraints.CENTER, // anchor
632: GridBagConstraints.BOTH, // fill
633: new Insets(15, 11, 0, 11), // padding
634: 0, 0)); // padx, pady - ???
635: add(successfullyUninstalledComponentsPane,
636: new GridBagConstraints(0, 8, // x, y
637: 3, 1, // width, height
638: 1.0, 0.0, // weight-x, weight-y
639: GridBagConstraints.CENTER, // anchor
640: GridBagConstraints.BOTH, // fill
641: new Insets(3, 11, 0, 11), // padding
642: 0, 0)); // padx, pady - ???
643: add(componentsUninstalledWithWarningsLabel,
644: new GridBagConstraints(0, 9, // x, y
645: 3, 1, // width, height
646: 1.0, 0.0, // weight-x, weight-y
647: GridBagConstraints.CENTER, // anchor
648: GridBagConstraints.BOTH, // fill
649: new Insets(15, 11, 0, 11), // padding
650: 0, 0)); // padx, pady - ???
651: add(componentsUninstalledWithWarningsPane,
652: new GridBagConstraints(0, 10, // x, y
653: 3, 1, // width, height
654: 1.0, 0.0, // weight-x, weight-y
655: GridBagConstraints.CENTER, // anchor
656: GridBagConstraints.BOTH, // fill
657: new Insets(3, 11, 0, 11), // padding
658: 0, 0)); // padx, pady - ???
659: add(componentsFailedToUninstallLabel,
660: new GridBagConstraints(0, 11, // x, y
661: 3, 1, // width, height
662: 1.0, 0.0, // weight-x, weight-y
663: GridBagConstraints.CENTER, // anchor
664: GridBagConstraints.BOTH, // fill
665: new Insets(15, 11, 0, 11), // padding
666: 0, 0)); // padx, pady - ???
667: add(componentsFailedToUninstallPane,
668: new GridBagConstraints(0, 12, // x, y
669: 3, 1, // width, height
670: 1.0, 0.0, // weight-x, weight-y
671: GridBagConstraints.CENTER, // anchor
672: GridBagConstraints.BOTH, // fill
673: new Insets(3, 11, 0, 11), // padding
674: 0, 0)); // padx, pady - ???
675: add(spacer, new GridBagConstraints(0, 13, // x, y
676: 3, 1, // width, height
677: 1.0, 1.0, // weight-x, weight-y
678: GridBagConstraints.CENTER, // anchor
679: GridBagConstraints.BOTH, // fill
680: new Insets(0, 11, 0, 11), // padding
681: 0, 0)); // padx, pady - ???
682: add(viewDetailsButton, new GridBagConstraints(0, 14, // x, y
683: 1, 1, // width, height
684: 0.0, 0.0, // weight-x, weight-y
685: GridBagConstraints.CENTER, // anchor
686: GridBagConstraints.NONE, // fill
687: new Insets(3, 11, 11, 0), // padding
688: 0, 0)); // padx, pady - ???
689: add(viewLogButton, new GridBagConstraints(1, 14, // x, y
690: 1, 1, // width, height
691: 0.0, 0.0, // weight-x, weight-y
692: GridBagConstraints.CENTER, // anchor
693: GridBagConstraints.NONE, // fill
694: new Insets(3, 6, 11, 0), // padding
695: 0, 0)); // padx, pady - ???
696: add(sendLogButton, new GridBagConstraints(2, 14, // x, y
697: 1, 1, // width, height
698: 1.0, 0.0, // weight-x, weight-y
699: GridBagConstraints.WEST, // anchor
700: GridBagConstraints.NONE, // fill
701: new Insets(3, 6, 11, 11), // padding
702: 0, 0)); // padx, pady - ???
703: if (container instanceof SwingFrameContainer) {
704: final SwingFrameContainer sfc = (SwingFrameContainer) container;
705: sfc.addWindowListener(new WindowAdapter() {
706: @Override
707: public void windowClosing(WindowEvent event) {
708: SwingUi currentUi = component.getWizardUi()
709: .getSwingUi(container);
710: if (currentUi != null) {
711: if (!container.getCancelButton()
712: .isEnabled()
713: && // cancel button is disabled
714: !container.getCancelButton()
715: .isVisible() && // no cancel button at this panel
716: !container.getBackButton()
717: .isVisible() && // no back button at this panel
718: container.getNextButton()
719: .isVisible() && // next button is visible
720: container.getNextButton()
721: .isEnabled()) { // and enabled
722: currentUi.evaluateNextButtonClick();
723: sfc.removeWindowListener(this );
724: }
725: }
726: }
727: });
728: }
729: }
730:
731: private void viewDetailsButtonClicked() {
732: if (detailsDialog == null) {
733: detailsDialog = new InstallationDetailsDialog();
734: }
735: detailsDialog.setVisible(true);
736: }
737:
738: private void viewLogButtonClicked() {
739: if (LogManager.getLogFile() != null) {
740: if (logDialog == null) {
741: logDialog = new InstallationLogDialog();
742: }
743: logDialog.setVisible(true);
744: logDialog.loadLogFile();
745: } else {
746: ErrorManager
747: .notify(
748: ErrorLevel.ERROR,
749: component
750: .getProperty(ERROR_LOGFILE_UNAVAILABLE_PROPERTY));
751: }
752: }
753:
754: private void sendLogButtonClicked() {
755: // does nothing
756: }
757: }
758:
759: /////////////////////////////////////////////////////////////////////////////////
760: // Constants
761: public static final String MESSAGE_SUCCESS_TEXT_PROPERTY = "message.success.text"; // NOI18N
762: public static final String MESSAGE_SUCCESS_CONTENT_TYPE_PROPERTY = "message.success.content.type"; // NOI18N
763: public static final String MESSAGE_WARNINGS_TEXT_PROPERTY = "message.warnings.text"; // NOI18N
764: public static final String MESSAGE_WARNINGS_CONTENT_TYPE_PROPERTY = "message.warnings.content.type"; // NOI18N
765: public static final String MESSAGE_ERRORS_TEXT_PROPERTY = "message.errors.text"; // NOI18N
766: public static final String MESSAGE_ERRORS_CONTENT_TYPE_PROPERTY = "message.errors.content.type"; // NOI18N
767: public static final String SUCCESSFULLY_INSTALLED_LABEL_TEXT_PROPERTY = "successfully.installed.label.text"; // NOI18N
768: public static final String SUCCESSFULLY_INSTALLED_TEXT_PROPERTY = "successfully.installed.text"; // NOI18N
769: public static final String SUCCESSFULLY_INSTALLED_CONTENT_TYPE_PROPERTY = "successfully.installed.content.type"; // NOI18N
770: public static final String INSTALLED_WITH_WARNINGS_LABEL_TEXT_PROPERTY = "installed.with.warnings.label.text"; // NOI18N
771: public static final String INSTALLED_WITH_WARNINGS_TEXT_PROPERTY = "installed.with.warnings.text"; // NOI18N
772: public static final String INSTALLED_WITH_WARNINGS_CONTENT_TYPE_PROPERTY = "installed.with.warnings.content.type"; // NOI18N
773: public static final String FAILED_TO_INSTALL_WARNINGS_LABEL_TEXT_PROPERTY = "failed.to.install.label.text"; // NOI18N
774: public static final String FAILED_TO_INSTALL_TEXT_PROPERTY = "failed.to.install.text"; // NOI18N
775: public static final String FAILED_TO_INSTALL_CONTENT_TYPE_PROPERTY = "failed.to.install.content.type"; // NOI18N
776: public static final String SUCCESSFULLY_UNINSTALLED_LABEL_TEXT_PROPERTY = "successfully.uninstalled.label.text"; // NOI18N
777: public static final String SUCCESSFULLY_UNINSTALLED_TEXT_PROPERTY = "successfully.uninstalled.text"; // NOI18N
778: public static final String SUCCESSFULLY_UNINSTALLED_CONTENT_TYPE_PROPERTY = "successfully.uninstalled.content.type"; // NOI18N
779: public static final String UNINSTALLED_WITH_WARNINGS_LABEL_TEXT_PROPERTY = "uninstalled.with.warnings.label.text"; // NOI18N
780: public static final String UNINSTALLED_WITH_WARNINGS_TEXT_PROPERTY = "uninstalled.with.warnings.text"; // NOI18N
781: public static final String UNINSTALLED_WITH_WARNINGS_CONTENT_TYPE_PROPERTY = "uninstalled.with.warnings.content.type"; // NOI18N
782: public static final String FAILED_TO_UNINSTALL_WARNINGS_LABEL_TEXT_PROPERTY = "failed.to.uninstall.label.text"; // NOI18N
783: public static final String FAILED_TO_UNINSTALL_TEXT_PROPERTY = "failed.to.uninstall.text"; // NOI18N
784: public static final String FAILED_TO_UNINSTALL_CONTENT_TYPE_PROPERTY = "failed.to.uninstall.content.type"; // NOI18N
785: public static final String MESSAGE_FILES_REMAINING_PROPERTY = "message.files.remaining"; // NOI18N
786: public static final String VIEW_DETAILS_BUTTON_TEXT_PROPERTY = "view.details.button.text"; // NOI18N
787: public static final String VIEW_LOG_BUTTON_TEXT_PROPERTY = "view.log.button.text"; // NOI18N
788: public static final String SEND_LOG_BUTTON_TEXT_PROPERTY = "send.log.button.text"; // NOI18N
789: public static final String COMPONENTS_LIST_SEPARATOR_PROPERTY = "components.list.separator"; // NOI18N
790: public static final String ERROR_LOGFILE_UNAVAILABLE_PROPERTY = "error.logfile.unavailable";//NOI18N
791:
792: public static final String DEFAULT_MESSAGE_SUCCESS_TEXT = ResourceUtils
793: .getString(PostInstallSummaryPanel.class,
794: "PoISP.message.success.text"); // NOI18N
795: public static final String DEFAULT_MESSAGE_SUCCESS_CONTENT_TYPE = ResourceUtils
796: .getString(PostInstallSummaryPanel.class,
797: "PoISP.message.success.content.type"); // NOI18N
798: public static final String DEFAULT_MESSAGE_WARNINGS_TEXT = ResourceUtils
799: .getString(PostInstallSummaryPanel.class,
800: "PoISP.message.warnings.text"); // NOI18N
801: public static final String DEFAULT_MESSAGE_WARNINGS_CONTENT_TYPE = ResourceUtils
802: .getString(PostInstallSummaryPanel.class,
803: "PoISP.message.warnings.content.type"); // NOI18N
804: public static final String DEFAULT_MESSAGE_ERRORS_TEXT = ResourceUtils
805: .getString(PostInstallSummaryPanel.class,
806: "PoISP.message.errors.text"); // NOI18N
807: public static final String DEFAULT_MESSAGE_ERRORS_CONTENT_TYPE = ResourceUtils
808: .getString(PostInstallSummaryPanel.class,
809: "PoISP.message.errors.content.type"); // NOI18N
810: public static final String DEFAULT_SUCCESSFULLY_INSTALLED_LABEL_TEXT = ResourceUtils
811: .getString(PostInstallSummaryPanel.class,
812: "PoISP.successfully.installed.label.text"); // NOI18N
813: public static final String DEFAULT_SUCCESSFULLY_INSTALLED_TEXT = ResourceUtils
814: .getString(PostInstallSummaryPanel.class,
815: "PoISP.successfully.installed.text"); // NOI18N
816: public static final String DEFAULT_SUCCESSFULLY_INSTALLED_CONTENT_TYPE = ResourceUtils
817: .getString(PostInstallSummaryPanel.class,
818: "PoISP.successfully.installed.content.type"); // NOI18N
819: public static final String DEFAULT_INSTALLED_WITH_WARNINGS_LABEL_TEXT = ResourceUtils
820: .getString(PostInstallSummaryPanel.class,
821: "PoISP.installed.with.warnings.label.text"); // NOI18N
822: public static final String DEFAULT_INSTALLED_WITH_WARNINGS_TEXT = ResourceUtils
823: .getString(PostInstallSummaryPanel.class,
824: "PoISP.installed.with.warnings.text"); // NOI18N
825: public static final String DEFAULT_INSTALLED_WITH_WARNINGS_CONTENT_TYPE = ResourceUtils
826: .getString(PostInstallSummaryPanel.class,
827: "PoISP.installed.with.warnings.content.type"); // NOI18N
828: public static final String DEFAULT_FAILED_TO_INSTALL_WARNINGS_LABEL_TEXT = ResourceUtils
829: .getString(PostInstallSummaryPanel.class,
830: "PoISP.failed.to.install.label.text"); // NOI18N
831: public static final String DEFAULT_FAILED_TO_INSTALL_TEXT = ResourceUtils
832: .getString(PostInstallSummaryPanel.class,
833: "PoISP.failed.to.install.text"); // NOI18N
834: public static final String DEFAULT_FAILED_TO_INSTALL_CONTENT_TYPE = ResourceUtils
835: .getString(PostInstallSummaryPanel.class,
836: "PoISP.failed.to.install.content.type"); // NOI18N
837: public static final String DEFAULT_SUCCESSFULLY_UNINSTALLED_LABEL_TEXT = ResourceUtils
838: .getString(PostInstallSummaryPanel.class,
839: "PoISP.successfully.uninstalled.label.text"); // NOI18N
840: public static final String DEFAULT_SUCCESSFULLY_UNINSTALLED_TEXT = ResourceUtils
841: .getString(PostInstallSummaryPanel.class,
842: "PoISP.successfully.uninstalled.text"); // NOI18N
843: public static final String DEFAULT_SUCCESSFULLY_UNINSTALLED_CONTENT_TYPE = ResourceUtils
844: .getString(PostInstallSummaryPanel.class,
845: "PoISP.successfully.uninstalled.content.type"); // NOI18N
846: public static final String DEFAULT_UNINSTALLED_WITH_WARNINGS_LABEL_TEXT = ResourceUtils
847: .getString(PostInstallSummaryPanel.class,
848: "PoISP.uninstalled.with.warnings.label.text"); // NOI18N
849: public static final String DEFAULT_UNINSTALLED_WITH_WARNINGS_TEXT = ResourceUtils
850: .getString(PostInstallSummaryPanel.class,
851: "PoISP.uninstalled.with.warnings.text"); // NOI18N
852: public static final String DEFAULT_UNINSTALLED_WITH_WARNINGS_CONTENT_TYPE = ResourceUtils
853: .getString(PostInstallSummaryPanel.class,
854: "PoISP.uninstalled.with.warnings.content.type"); // NOI18N
855: public static final String DEFAULT_FAILED_TO_UNINSTALL_WARNINGS_LABEL_TEXT = ResourceUtils
856: .getString(PostInstallSummaryPanel.class,
857: "PoISP.failed.to.uninstall.label.text"); // NOI18N
858: public static final String DEFAULT_FAILED_TO_UNINSTALL_TEXT = ResourceUtils
859: .getString(PostInstallSummaryPanel.class,
860: "PoISP.failed.to.uninstall.text"); // NOI18N
861: public static final String DEFAULT_FAILED_TO_UNINSTALL_CONTENT_TYPE = ResourceUtils
862: .getString(PostInstallSummaryPanel.class,
863: "PoISP.failed.to.uninstall.content.type"); // NOI18N
864: public static final String DEFAULT_MESSAGE_FILES_REMAINING = ResourceUtils
865: .getString(PostInstallSummaryPanel.class,
866: "PoISP.message.files.remaining"); // NOI18N
867: public static final String DEFAULT_VIEW_DETAILS_BUTTON_TEXT = ResourceUtils
868: .getString(PostInstallSummaryPanel.class,
869: "PoISP.view.details.button.text"); // NOI18N
870: public static final String DEFAULT_VIEW_LOG_BUTTON_TEXT = ResourceUtils
871: .getString(PostInstallSummaryPanel.class,
872: "PoISP.view.log.button.text"); // NOI18N
873: public static final String DEFAULT_SEND_LOG_BUTTON_TEXT = ResourceUtils
874: .getString(PostInstallSummaryPanel.class,
875: "PoISP.send.log.button.text"); // NOI18N
876: public static final String DEFAULT_COMPONENTS_LIST_SEPARATOR = ResourceUtils
877: .getString(PostInstallSummaryPanel.class,
878: "PoISP.components.list.separator"); // NOI18N
879: public static final String DEFAULT_ERROR_LOGFILE_UNAVAILABLE_TEXT = ResourceUtils
880: .getString(PostInstallSummaryPanel.class,
881: "PoISP.error.logfile.unavailable");//NOI18N
882:
883: public static final String DEFAULT_DIALOG_TITLE = ResourceUtils
884: .getString(PostInstallSummaryPanel.class,
885: "PoISP.dialog.title"); // NOI18N
886: }
|