3 The file is used to create, update Package Definitions of Spd file
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.packaging
.ui
;
17 import javax
.swing
.JPanel
;
18 import javax
.swing
.JLabel
;
19 import javax
.swing
.JComboBox
;
20 import java
.awt
.Dimension
;
22 import org
.tianocore
.PackageSurfaceAreaDocument
;
23 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
24 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
26 public class SpdPackageDefinitions
extends IInternalFrame
{
31 private static final long serialVersionUID
= 1L;
32 private JPanel jContentPane
= null;
33 private JLabel jLabel
= null;
34 private JComboBox jComboBoxReadOnly
= null;
35 private JLabel jLabel1
= null;
36 private JComboBox jComboBoxRePackage
= null;
37 private StarLabel starLabel
= null;
38 private StarLabel starLabel1
= null;
39 private SpdFileContents sfc
= null;
42 * This is the default constructor
44 public SpdPackageDefinitions() {
49 public SpdPackageDefinitions(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
){
51 sfc
= new SpdFileContents(inPsa
);
55 private void init(SpdFileContents sfc
) {
56 if (sfc
.getSpdPkgDefsRdOnly() != null) {
57 jComboBoxReadOnly
.setSelectedItem(sfc
.getSpdPkgDefsRdOnly());
59 if (sfc
.getSpdPkgDefsRePkg() != null) {
60 jComboBoxRePackage
.setSelectedItem(sfc
.getSpdPkgDefsRePkg());
62 this.setVisible(true);
65 * This method initializes this
69 private void initialize() {
70 this.setSize(300, 200);
71 this.setTitle("Package Definitions");
72 this.setContentPane(getJContentPane());
76 * This method initializes jContentPane
78 * @return javax.swing.JPanel
80 private JPanel
getJContentPane() {
81 if (jContentPane
== null) {
82 starLabel1
= new StarLabel();
83 starLabel1
.setBounds(new java
.awt
.Rectangle(4,62,10,20));
84 starLabel1
.setVisible(true);
85 starLabel
= new StarLabel();
86 starLabel
.setBounds(new java
.awt
.Rectangle(4,22,10,20));
87 jLabel1
= new JLabel();
88 jLabel1
.setPreferredSize(new java
.awt
.Dimension(65,20));
89 jLabel1
.setLocation(new java
.awt
.Point(22,62));
90 jLabel1
.setSize(new java
.awt
.Dimension(65,20));
91 jLabel1
.setText("RePackage");
92 jLabel
= new JLabel();
93 jLabel
.setPreferredSize(new java
.awt
.Dimension(57,20));
94 jLabel
.setLocation(new java
.awt
.Point(22,22));
95 jLabel
.setSize(new java
.awt
.Dimension(57,20));
96 jLabel
.setText("Read Only");
97 jContentPane
= new JPanel();
98 jContentPane
.setLayout(null);
99 jContentPane
.add(jLabel
, null);
100 jContentPane
.add(getJComboBox(), null);
101 jContentPane
.add(jLabel1
, null);
102 jContentPane
.add(getJComboBox1(), null);
103 jContentPane
.add(starLabel
, null);
104 jContentPane
.add(starLabel1
, null);
110 * This method initializes jComboBox
112 * @return javax.swing.JComboBox
114 private JComboBox
getJComboBox() {
115 if (jComboBoxReadOnly
== null) {
116 jComboBoxReadOnly
= new JComboBox();
117 jComboBoxReadOnly
.setBounds(new java
.awt
.Rectangle(95,22,117,20));
118 jComboBoxReadOnly
.setPreferredSize(new Dimension(80, 20));
119 jComboBoxReadOnly
.addItem("true");
120 jComboBoxReadOnly
.addItem("false");
121 jComboBoxReadOnly
.setSelectedIndex(1);
122 jComboBoxReadOnly
.addItemListener(new java
.awt
.event
.ItemListener() {
123 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
124 sfc
.setSpdPkgDefsRdOnly(jComboBoxReadOnly
.getSelectedItem()+"");
128 return jComboBoxReadOnly
;
132 * This method initializes jComboBox1
134 * @return javax.swing.JComboBox
136 private JComboBox
getJComboBox1() {
137 if (jComboBoxRePackage
== null) {
138 jComboBoxRePackage
= new JComboBox();
139 jComboBoxRePackage
.setBounds(new java
.awt
.Rectangle(95,62,116,20));
140 jComboBoxRePackage
.setPreferredSize(new Dimension(80, 20));
141 jComboBoxRePackage
.addItem("false");
142 jComboBoxRePackage
.addItem("true");
143 jComboBoxRePackage
.setSelectedIndex(0);
144 jComboBoxRePackage
.addItemListener(new java
.awt
.event
.ItemListener() {
145 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
146 sfc
.setSpdPkgDefsRePkg(jComboBoxRePackage
.getSelectedItem()+"");
150 return jComboBoxRePackage
;