home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.ivb.sguides.basic;
-
- import com.ibm.ivb.sguides.MultiCellContainer;
- import com.ibm.ivb.sguides.SGButton;
- import com.ibm.ivb.sguides.SmartGuide;
- import com.ibm.ivb.sguides.SmartGuideButtons;
- import com.ibm.ivb.sguides.SmartGuideButtonsUI;
- import javax.swing.JComponent;
- import javax.swing.JLabel;
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
- import javax.swing.plaf.ComponentUI;
-
- public class BasicSmartGuideButtonsUI extends SmartGuideButtonsUI implements ChangeListener {
- private static final String kCBIBMCopyright = "(c) Copyright IBM Corporation 1998";
- protected SmartGuideButtons sgbuttons;
- // $FF: renamed from: ah com.ibm.ivb.sguides.basic.BasicSmartGuideButtonsUI.ActionHandler
- ActionHandler field_0 = new ActionHandler(this);
- // $FF: renamed from: ea com.ibm.ivb.sguides.basic.BasicSmartGuideButtonsUI.EnterAction
- EnterAction field_1;
-
- public static ComponentUI createUI(JComponent var0) {
- return new BasicSmartGuideButtonsUI();
- }
-
- protected void installListeners() {
- this.field_1 = new EnterAction(this.sgbuttons);
- this.sgbuttons.backButton.addActionListener(this.field_0);
- this.sgbuttons.nextButton.addActionListener(this.field_0);
- this.sgbuttons.finishButton.addActionListener(this.field_0);
- this.sgbuttons.cancelButton.addActionListener(this.field_0);
- if (this.sgbuttons.helpButton != null) {
- this.sgbuttons.helpButton.addActionListener(this.field_0);
- }
-
- }
-
- public void installUI(JComponent var1) {
- this.sgbuttons = (SmartGuideButtons)var1;
- this.makeButtons(0, true);
- MultiCellContainer var2 = new MultiCellContainer();
- var2.setPadding(2, 0);
- var2.setFill(1);
- var2.setWeight(1, 1);
- var2.setInsets(3, 10, 6, 8);
- var2.addToCell(this.sgbuttons.infoLabel, 0, 0);
- var2.setFill(3);
- var2.setAnchor(13);
- var2.setWeight(0, 1);
- var2.setInsets(3, 0, 6, 8);
- var2.addToCell(this.sgbuttons.cancelButton, 1, 0);
- var2.setInsets(3, 0, 6, 0);
- var2.addToCell(this.sgbuttons.backButton, 2, 0);
- var2.addToCell(this.sgbuttons.nextButton, 3, 0);
- var2.setInsets(3, 8, 6, 8);
- var2.addToCell(this.sgbuttons.finishButton, 4, 0);
- var2.setInsets(3, 4, 6, 8);
- var2.addToCell(this.sgbuttons.helpButton, 5, 0);
- this.sgbuttons.setWeight(1, 1);
- this.sgbuttons.addToCell(var2, 0, 0);
- this.installListeners();
- }
-
- protected void makeButtons(int var1, boolean var2) {
- SmartGuide var3 = this.sgbuttons.getSmartGuide();
- this.sgbuttons.backButton = new SGButton((String)var3.getClientProperty("BackButtonText"));
- this.sgbuttons.backButton.setType(var1);
- Character var4 = (Character)var3.getClientProperty("BackButtonM");
- if (var4 != null) {
- this.sgbuttons.backButton.setMnemonic(var4);
- }
-
- this.sgbuttons.nextButton = new SGButton((String)var3.getClientProperty("NextButtonText"));
- this.sgbuttons.nextButton.setType(var1);
- var4 = (Character)var3.getClientProperty("NextButtonM");
- if (var4 != null) {
- this.sgbuttons.nextButton.setMnemonic(var4);
- }
-
- this.sgbuttons.finishButton = new SGButton((String)var3.getClientProperty("FinishButtonText"));
- this.sgbuttons.finishButton.setType(var1);
- var4 = (Character)var3.getClientProperty("FinishButtonM");
- if (var4 != null) {
- this.sgbuttons.finishButton.setMnemonic(var4);
- }
-
- this.sgbuttons.cancelButton = new SGButton((String)var3.getClientProperty("CancelButtonText"));
- this.sgbuttons.cancelButton.setType(var1);
- var4 = (Character)var3.getClientProperty("CancelButtonM");
- if (var4 != null) {
- this.sgbuttons.cancelButton.setMnemonic(var4);
- }
-
- if (this.sgbuttons.isHelpAvailable()) {
- this.sgbuttons.helpButton = new SGButton((String)var3.getClientProperty("HelpButtonText"));
- this.sgbuttons.helpButton.setType(var1);
- var4 = (Character)var3.getClientProperty("HelpButtonM");
- if (var4 != null) {
- this.sgbuttons.helpButton.setMnemonic(var4);
- }
- }
-
- if (var2) {
- this.sgbuttons.infoLabel = new JLabel(this.sgbuttons.getInfo());
- }
-
- }
-
- public void stateChanged(ChangeEvent var1) {
- if (this.sgbuttons.infoLabel != null) {
- this.sgbuttons.infoLabel.setText(this.sgbuttons.getInfo());
- }
-
- this.sgbuttons.invalidate();
- this.sgbuttons.validate();
- this.sgbuttons.repaint();
- }
-
- protected void uninstallListeners() {
- this.sgbuttons.backButton.removeActionListener(this.field_0);
- this.sgbuttons.nextButton.removeActionListener(this.field_0);
- this.sgbuttons.finishButton.removeActionListener(this.field_0);
- this.sgbuttons.cancelButton.removeActionListener(this.field_0);
- if (this.sgbuttons.helpButton != null) {
- this.sgbuttons.helpButton.removeActionListener(this.field_0);
- }
-
- }
-
- public void uninstallUI(JComponent var1) {
- this.sgbuttons.removeAll();
- }
-
- public void updateProperty(String var1, Object var2) {
- if (var2 != null) {
- if (var1 == "BackButtonText") {
- this.sgbuttons.backButton.setText((String)var2);
- } else {
- if (var1 == "BackButtonM") {
- Character var3 = (Character)var2;
- if (var3 != null) {
- this.sgbuttons.backButton.setMnemonic(var3);
- return;
- }
- } else {
- if (var1 == "NextButtonText") {
- this.sgbuttons.nextButton.setText((String)var2);
- return;
- }
-
- if (var1 == "NextButtonM") {
- Character var4 = (Character)var2;
- if (var4 != null) {
- this.sgbuttons.nextButton.setMnemonic(var4);
- return;
- }
- } else {
- if (var1 == "FinishButtonText") {
- this.sgbuttons.finishButton.setText((String)var2);
- return;
- }
-
- if (var1 == "FinishButtonM") {
- Character var5 = (Character)var2;
- if (var5 != null) {
- this.sgbuttons.finishButton.setMnemonic(var5);
- return;
- }
- } else {
- if (var1 == "CancelButtonText") {
- this.sgbuttons.cancelButton.setText((String)var2);
- return;
- }
-
- if (var1 == "CancelButtonM") {
- Character var6 = (Character)var2;
- if (var6 != null) {
- this.sgbuttons.cancelButton.setMnemonic(var6);
- return;
- }
- } else {
- if (var1 == "HelpButtonText") {
- this.sgbuttons.helpButton.setText((String)var2);
- return;
- }
-
- if (var1 == "HelpButtonM") {
- Character var7 = (Character)var2;
- if (var7 != null) {
- this.sgbuttons.helpButton.setMnemonic(var7);
- }
- }
- }
- }
- }
- }
-
- }
- }
- }
- }
-