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
.JDialog
;
19 import javax
.swing
.JLabel
;
20 import javax
.swing
.JComboBox
;
21 import java
.awt
.Dimension
;
23 import org
.tianocore
.PackageSurfaceAreaDocument
;
24 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
25 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
27 public class SpdPackageDefinitions
extends IInternalFrame
{
29 private JPanel jContentPane
= null;
30 private JLabel jLabel
= null;
31 private JComboBox jComboBoxReadOnly
= null;
32 private JLabel jLabel1
= null;
33 private JComboBox jComboBoxRePackage
= null;
34 private StarLabel starLabel
= null;
35 private StarLabel starLabel1
= null;
36 private SpdFileContents sfc
= null;
39 * This is the default constructor
41 public SpdPackageDefinitions() {
46 public SpdPackageDefinitions(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
){
48 sfc
= new SpdFileContents(inPsa
);
52 private void init(SpdFileContents sfc
) {
53 if (sfc
.getSpdPkgDefsRdOnly() != null) {
54 jComboBoxReadOnly
.setSelectedItem(sfc
.getSpdPkgDefsRdOnly());
56 if (sfc
.getSpdPkgDefsRePkg() != null) {
57 jComboBoxRePackage
.setSelectedItem(sfc
.getSpdPkgDefsRePkg());
59 this.setVisible(true);
62 * This method initializes this
66 private void initialize() {
67 this.setSize(300, 200);
68 this.setTitle("Package Definitions");
69 this.setContentPane(getJContentPane());
73 * This method initializes jContentPane
75 * @return javax.swing.JPanel
77 private JPanel
getJContentPane() {
78 if (jContentPane
== null) {
79 starLabel1
= new StarLabel();
80 starLabel1
.setBounds(new java
.awt
.Rectangle(4,62,10,20));
81 starLabel1
.setVisible(true);
82 starLabel
= new StarLabel();
83 starLabel
.setBounds(new java
.awt
.Rectangle(4,22,10,20));
84 jLabel1
= new JLabel();
85 jLabel1
.setPreferredSize(new java
.awt
.Dimension(65,20));
86 jLabel1
.setLocation(new java
.awt
.Point(22,62));
87 jLabel1
.setSize(new java
.awt
.Dimension(65,20));
88 jLabel1
.setText("RePackage");
89 jLabel
= new JLabel();
90 jLabel
.setPreferredSize(new java
.awt
.Dimension(57,20));
91 jLabel
.setLocation(new java
.awt
.Point(22,22));
92 jLabel
.setSize(new java
.awt
.Dimension(57,20));
93 jLabel
.setText("Read Only");
94 jContentPane
= new JPanel();
95 jContentPane
.setLayout(null);
96 jContentPane
.add(jLabel
, null);
97 jContentPane
.add(getJComboBox(), null);
98 jContentPane
.add(jLabel1
, null);
99 jContentPane
.add(getJComboBox1(), null);
100 jContentPane
.add(starLabel
, null);
101 jContentPane
.add(starLabel1
, null);
107 * This method initializes jComboBox
109 * @return javax.swing.JComboBox
111 private JComboBox
getJComboBox() {
112 if (jComboBoxReadOnly
== null) {
113 jComboBoxReadOnly
= new JComboBox();
114 jComboBoxReadOnly
.setBounds(new java
.awt
.Rectangle(95,22,117,20));
115 jComboBoxReadOnly
.setPreferredSize(new Dimension(80, 20));
116 jComboBoxReadOnly
.addItem("TRUE");
117 jComboBoxReadOnly
.addItem("FALSE");
118 jComboBoxReadOnly
.setSelectedIndex(1);
119 jComboBoxReadOnly
.addItemListener(new java
.awt
.event
.ItemListener() {
120 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
121 sfc
.setSpdPkgDefsRdOnly(jComboBoxReadOnly
.getSelectedItem()+"");
125 return jComboBoxReadOnly
;
129 * This method initializes jComboBox1
131 * @return javax.swing.JComboBox
133 private JComboBox
getJComboBox1() {
134 if (jComboBoxRePackage
== null) {
135 jComboBoxRePackage
= new JComboBox();
136 jComboBoxRePackage
.setBounds(new java
.awt
.Rectangle(95,62,116,20));
137 jComboBoxRePackage
.setPreferredSize(new Dimension(80, 20));
138 jComboBoxRePackage
.addItem("FALSE");
139 jComboBoxRePackage
.addItem("TRUE");
140 jComboBoxRePackage
.setSelectedIndex(0);
141 jComboBoxRePackage
.addItemListener(new java
.awt
.event
.ItemListener() {
142 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
143 sfc
.setSpdPkgDefsRePkg(jComboBoxRePackage
.getSelectedItem()+"");
147 return jComboBoxRePackage
;