001: /*
002: * $RCSfile: ProductStepLanguagePanel.java,v $
003: * @modification $Date: 2001/09/28 19:35:30 $
004: * @version $Id: ProductStepLanguagePanel.java,v 1.1 2001/09/28 19:35:30 hfalk Exp $
005: *
006: */
007:
008: package com.memoire.vainstall.builder.gui;
009:
010: import com.memoire.vainstall.VAGlobals;
011: import com.memoire.vainstall.builder.*;
012:
013: import java.awt.*;
014: import java.awt.event.*;
015:
016: import javax.swing.*;
017: import javax.swing.border.*;
018:
019: /**
020: * This panel is shown in the product dialog
021: *
022: * This is not just a view panel because it has a reference to the
023: * VAIProductModel.
024: *
025: *
026: * @see com.memoire.vainstall.builder.gui.VAIProductInternalFrame
027: * @see javax.swing.JPanel
028: *
029: * @author Henrik Falk
030: * @version $Id: ProductStepLanguagePanel.java,v 1.1 2001/09/28 19:35:30 hfalk Exp $
031: */
032: public class ProductStepLanguagePanel extends JPanel implements
033: FocusListener {
034:
035: private VAIProductModel model;
036:
037: private final static Border loweredBorder = new SoftBevelBorder(
038: BevelBorder.LOWERED);
039:
040: RequiredTextField installFileNameField;
041:
042: JComboBox uiInstallerBox;
043:
044: public ProductStepLanguagePanel() {
045:
046: setBorder(loweredBorder);
047:
048: GridBagLayout layout = new GridBagLayout();
049: setLayout(layout);
050:
051: GridBagConstraints contraint = new GridBagConstraints();
052:
053: // Filename
054: JLabel installFileNameLabel = new JLabel();
055: installFileNameLabel.setText("Filename of generated package:");
056: contraint.fill = GridBagConstraints.BOTH;
057: contraint.insets = new Insets(16, 16, 0, 16);
058: contraint.anchor = GridBagConstraints.WEST;
059: contraint.gridx = 0;
060: contraint.gridy = 0;
061: contraint.gridwidth = 1;
062: contraint.gridheight = 1;
063: contraint.weightx = 0;
064: contraint.weighty = 0;
065: layout.setConstraints(installFileNameLabel, contraint);
066: add(installFileNameLabel);
067:
068: installFileNameField = new RequiredTextField();
069: contraint.fill = GridBagConstraints.HORIZONTAL;
070: contraint.insets = new Insets(16, 16, 0, 16);
071: contraint.anchor = GridBagConstraints.CENTER;
072: contraint.gridx = 1;
073: contraint.gridy = 0;
074: contraint.gridwidth = 1;
075: contraint.gridheight = 1;
076: contraint.weightx = 1;
077: contraint.weighty = 0;
078: layout.setConstraints(installFileNameField, contraint);
079: add(installFileNameField);
080:
081: // Installer UI
082: JLabel uiInstallerLabel = new JLabel();
083: uiInstallerLabel.setText("Installtion UI:");
084: contraint.fill = GridBagConstraints.BOTH;
085: contraint.insets = new Insets(16, 16, 0, 16);
086: contraint.anchor = GridBagConstraints.WEST;
087: contraint.gridx = 0;
088: contraint.gridy = 1;
089: contraint.gridwidth = 1;
090: contraint.gridheight = 1;
091: contraint.weightx = 0;
092: contraint.weighty = 0;
093: layout.setConstraints(uiInstallerLabel, contraint);
094: add(uiInstallerLabel);
095:
096: uiInstallerBox = new JComboBox();
097: uiInstallerBox.addItem("Graphics");
098: uiInstallerBox.addItem("Enhanced Graphics");
099: uiInstallerBox.addItem("Text");
100: uiInstallerBox.addItem("Ansi");
101: uiInstallerBox.setSelectedIndex(0);
102: contraint.fill = GridBagConstraints.HORIZONTAL;
103: contraint.insets = new Insets(16, 16, 0, 16);
104: contraint.anchor = GridBagConstraints.CENTER;
105: contraint.gridx = 1;
106: contraint.gridy = 1;
107: contraint.gridwidth = 1;
108: contraint.gridheight = 1;
109: contraint.weightx = 1;
110: contraint.weighty = 0;
111: layout.setConstraints(uiInstallerBox, contraint);
112: add(uiInstallerBox);
113:
114: JPanel fillPanel = new JPanel();
115: contraint.fill = GridBagConstraints.BOTH;
116: contraint.insets = new Insets(4, 4, 4, 4);
117: contraint.anchor = GridBagConstraints.CENTER;
118: contraint.gridx = 0;
119: contraint.gridy = 2;
120: contraint.gridwidth = 1;
121: contraint.gridheight = 1;
122: contraint.weightx = 0;
123: contraint.weighty = 1;
124: layout.setConstraints(fillPanel, contraint);
125: add(fillPanel);
126:
127: }
128:
129: /**
130: * save
131: */
132: public void save() {
133: }
134:
135: /**
136: * initialize the panel
137: */
138: public void initialize(VAIProductModel model) {
139: this .model = model;
140:
141: installFileNameField.addFocusListener(this );
142: // installFileNameField.initialize(model,"Install Filename");
143: /*
144: if (model.getLicenseName() != null) {
145: licenseFileNameField.setText(model.getLicenseName());
146: }
147: if (model.getLicenseEncoding() != null) {
148: encodingField.setText(model.getLicenseEncoding());
149: }
150: */
151: }
152:
153: /**
154: * stop
155: */
156: public void stop() {
157: }
158:
159: public void focusGained(FocusEvent evt) {
160: }
161:
162: public void focusLost(FocusEvent evt) {
163:
164: if (evt.getSource() == installFileNameField
165: && installFileNameField.hasChanged() == true) {
166: model.setPackageName(installFileNameField.getText());
167: installFileNameField.setChanged(false);
168: }
169: }
170: }
|