01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19:
20: package org.netbeans.installer;
21:
22: import com.installshield.wizard.WizardAction;
23: import com.installshield.wizard.WizardBeanEvent;
24: import com.installshield.wizard.WizardBuilderSupport;
25: import com.installshield.wizard.WizardUI;
26: import com.installshield.wizard.awt.AWTWizardUI;
27:
28: import java.awt.Color;
29: import javax.swing.JComponent;
30:
31: /** This class is used to customize Wizard UI.
32: */
33: public class CustomizeUIAction extends WizardAction {
34:
35: public void build(WizardBuilderSupport support) {
36: try {
37: support.putClass(Util.class.getName());
38: } catch (Exception ex) {
39: System.out.println(ex.getLocalizedMessage());
40: ex.printStackTrace();
41: }
42: }
43:
44: public void execute(WizardBeanEvent evt) {
45: customizeNavigationButtons();
46: }
47:
48: /** Set navigation button background */
49: private void customizeNavigationButtons() {
50: WizardUI wizardUI = getWizard().getUI();
51: if (wizardUI instanceof AWTWizardUI) {
52: AWTWizardUI awtWizardUI = (AWTWizardUI) wizardUI;
53: AWTWizardUI.NavigationController controler = awtWizardUI
54: .getNavigationController();
55: if (Util.isMacOSX()) {
56: if (controler.back() instanceof JComponent) {
57: ((JComponent) controler.back()).setOpaque(false);
58: }
59: if (controler.next() instanceof JComponent) {
60: ((JComponent) controler.next()).setOpaque(false);
61: }
62: if (controler.cancel() instanceof JComponent) {
63: ((JComponent) controler.cancel()).setOpaque(false);
64: }
65: } else {
66: controler.back().setBackground(Color.lightGray);
67: controler.next().setBackground(Color.lightGray);
68: controler.cancel().setBackground(Color.lightGray);
69: }
70: }
71: }
72: }
|