2 Java class SpdProtocolDecls is GUI for create library definition elements of spd file.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 package org
.tianocore
.frameworkwizard
.packaging
.ui
;
15 import javax
.swing
.event
.TableModelEvent
;
16 import javax
.swing
.table
.DefaultTableModel
;
17 import javax
.swing
.table
.TableModel
;
19 import org
.tianocore
.PackageSurfaceAreaDocument
;
22 GUI for create library definition elements of spd file.
24 @since PackageEditor 1.0
26 public class SpdPpiDecls
extends SpdGuidDecls
{
28 private SpdFileContents sfc
= null;
30 public SpdPpiDecls() {
32 // TODO Auto-generated constructor stub
35 public SpdPpiDecls(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
) {
37 sfc
= new SpdFileContents(inPsa
);
41 protected void initFrame() {
43 this.setTitle("PPI Declarations");
44 getJScrollPaneGuid().setVisible(false);
45 getJLabel3().setVisible(false);
47 getJTable().getColumn("GuidTypes").setPreferredWidth(0);
48 getJTable().getColumn("GuidTypes").setWidth(0);
49 getJTable().getColumn("GuidTypes").setHeaderValue(" ");
52 protected void init(SpdFileContents sfc
){
54 // initialize table using SpdFileContents object
56 DefaultTableModel model
= getModel();
57 if (sfc
.getSpdPpiDeclarationCount() == 0) {
60 String
[][] saa
= new String
[sfc
.getSpdPpiDeclarationCount()][6];
61 sfc
.getSpdPpiDeclarations(saa
);
63 while (i
< saa
.length
) {
69 protected void updateRow(int row
, TableModel m
){
70 String name
= m
.getValueAt(row
, 0) + "";
71 String cName
= m
.getValueAt(row
, 1) + "";
72 String guid
= m
.getValueAt(row
, 2) + "";
73 String help
= m
.getValueAt(row
, 3) + "";
74 String archList
= null;
75 if (m
.getValueAt(row
, 4) != null) {
76 archList
= m
.getValueAt(row
, 4).toString();
78 String modTypeList
= null;
79 if (m
.getValueAt(row
, 5) != null) {
80 modTypeList
= m
.getValueAt(row
, 5).toString();
82 sfc
.updateSpdPpiDecl(row
, name
, cName
, guid
, help
, archList
, modTypeList
);
85 protected void addRow(String
[] row
) {
86 sfc
.genSpdPpiDeclarations(row
[0], row
[1], row
[2], row
[3], stringToVector(row
[4]), stringToVector(row
[5]));
89 protected void removeRow(int i
){
90 sfc
.removeSpdPpiDeclaration(i
);
93 protected void clearAllRow(){
94 sfc
.removeSpdPpiDeclaration();