mirror of https://github.com/acidanthera/audk.git
Delete useless file SpdPackageDefinitions.java;
Change button texts to Add, Delete, Clear All. Activate the Read-Only attribute checking for package editors. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1853 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b5ace64c27
commit
62df8efa93
|
@ -357,7 +357,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
if (jButtonRemove == null) {
|
if (jButtonRemove == null) {
|
||||||
jButtonRemove = new JButton();
|
jButtonRemove = new JButton();
|
||||||
jButtonRemove.setBounds(new java.awt.Rectangle(270,227,90,20));
|
jButtonRemove.setBounds(new java.awt.Rectangle(270,227,90,20));
|
||||||
jButtonRemove.setText("Remove");
|
jButtonRemove.setText("Delete");
|
||||||
jButtonRemove.addActionListener(this);
|
jButtonRemove.addActionListener(this);
|
||||||
}
|
}
|
||||||
return jButtonRemove;
|
return jButtonRemove;
|
||||||
|
@ -432,6 +432,10 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
public SpdGuidDecls(OpeningPackageType opt) {
|
public SpdGuidDecls(OpeningPackageType opt) {
|
||||||
this(opt.getXmlSpd());
|
this(opt.getXmlSpd());
|
||||||
docConsole = opt;
|
docConsole = opt;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
This method initializes this
|
This method initializes this
|
||||||
|
@ -449,7 +453,6 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
});
|
});
|
||||||
this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
|
this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
initFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void init(SpdFileContents sfc){
|
protected void init(SpdFileContents sfc){
|
||||||
|
@ -466,6 +469,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
model.addRow(saa[i]);
|
model.addRow(saa[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected JScrollPane getJContentPane(){
|
protected JScrollPane getJContentPane(){
|
||||||
|
@ -568,6 +572,15 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
|
|
||||||
this.setTitle("GUID Declarations");
|
this.setTitle("GUID Declarations");
|
||||||
|
|
||||||
|
boolean editable = true;
|
||||||
|
if (getSfc().getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
editable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
jButtonAdd.setEnabled(editable);
|
||||||
|
jButtonRemove.setEnabled(editable);
|
||||||
|
jButtonClearAll.setEnabled(editable);
|
||||||
|
jTable.setEnabled(editable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -722,7 +735,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
if (jButtonGen == null) {
|
if (jButtonGen == null) {
|
||||||
jButtonGen = new JButton();
|
jButtonGen = new JButton();
|
||||||
jButtonGen.setBounds(new java.awt.Rectangle(485,58,92,21));
|
jButtonGen.setBounds(new java.awt.Rectangle(485,58,92,21));
|
||||||
jButtonGen.setText("Gen GUID");
|
jButtonGen.setText("Gen");
|
||||||
jButtonGen.setPreferredSize(new java.awt.Dimension(80,20));
|
jButtonGen.setPreferredSize(new java.awt.Dimension(80,20));
|
||||||
jButtonGen.addActionListener(this);
|
jButtonGen.addActionListener(this);
|
||||||
}
|
}
|
||||||
|
@ -919,6 +932,13 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
|
||||||
protected JLabel getJLabelGuidType() {
|
protected JLabel getJLabelGuidType() {
|
||||||
return jLabelGuidType;
|
return jLabelGuidType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Returns the sfc.
|
||||||
|
*/
|
||||||
|
protected SpdFileContents getSfc() {
|
||||||
|
return sfc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -493,13 +493,13 @@ public class SpdHeader extends IInternalFrame {
|
||||||
jCheckBoxRdOnly.setText("Read Only");
|
jCheckBoxRdOnly.setText("Read Only");
|
||||||
jCheckBoxRdOnly.setLocation(new java.awt.Point(labelColumn, rowNine));
|
jCheckBoxRdOnly.setLocation(new java.awt.Point(labelColumn, rowNine));
|
||||||
jCheckBoxRdOnly.setSize(new java.awt.Dimension(labelWidth, oneRowHeight));
|
jCheckBoxRdOnly.setSize(new java.awt.Dimension(labelWidth, oneRowHeight));
|
||||||
// jCheckBoxRdOnly.setPreferredSize(new java.awt.Dimension(150, oneRowHeight));
|
|
||||||
jCheckBoxRdOnly.addItemListener(new java.awt.event.ItemListener() {
|
jCheckBoxRdOnly.addItemListener(new java.awt.event.ItemListener() {
|
||||||
public void itemStateChanged(java.awt.event.ItemEvent e) {
|
public void itemStateChanged(java.awt.event.ItemEvent e) {
|
||||||
if (docConsole != null) {
|
if (docConsole != null) {
|
||||||
docConsole.setSaved(false);
|
docConsole.setSaved(false);
|
||||||
}
|
}
|
||||||
sfc.setSpdPkgDefsRdOnly(jCheckBoxRdOnly.isSelected() + "");
|
sfc.setSpdPkgDefsRdOnly(jCheckBoxRdOnly.isSelected()+"");
|
||||||
|
initFrame();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -522,7 +522,7 @@ public class SpdHeader extends IInternalFrame {
|
||||||
if (docConsole != null) {
|
if (docConsole != null) {
|
||||||
docConsole.setSaved(false);
|
docConsole.setSaved(false);
|
||||||
}
|
}
|
||||||
sfc.setSpdPkgDefsRePkg(jCheckBoxRePkg.isSelected() + "");
|
sfc.setSpdPkgDefsRePkg(jCheckBoxRePkg.isSelected()+"");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -558,6 +558,7 @@ public class SpdHeader extends IInternalFrame {
|
||||||
public SpdHeader(OpeningPackageType opt) {
|
public SpdHeader(OpeningPackageType opt) {
|
||||||
this(opt.getXmlSpd());
|
this(opt.getXmlSpd());
|
||||||
docConsole = opt;
|
docConsole = opt;
|
||||||
|
initFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -567,7 +568,6 @@ public class SpdHeader extends IInternalFrame {
|
||||||
private void init() {
|
private void init() {
|
||||||
this.setContentPane(getTopScrollPane());
|
this.setContentPane(getTopScrollPane());
|
||||||
this.setTitle("Package Surface Area Header");
|
this.setTitle("Package Surface Area Header");
|
||||||
initFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -646,9 +646,11 @@ public class SpdHeader extends IInternalFrame {
|
||||||
jStarLabel7.setLocation(new java.awt.Point(2, rowEight));
|
jStarLabel7.setLocation(new java.awt.Point(2, rowEight));
|
||||||
jStarLabel8 = new StarLabel();
|
jStarLabel8 = new StarLabel();
|
||||||
jStarLabel8.setLocation(new java.awt.Point(2, rowNine));
|
jStarLabel8.setLocation(new java.awt.Point(2, rowNine));
|
||||||
|
jStarLabel8.setVisible(false);
|
||||||
jStarLabel9 = new StarLabel();
|
jStarLabel9 = new StarLabel();
|
||||||
jStarLabel9.setLocation(new java.awt.Point(2, rowTen));
|
jStarLabel9.setLocation(new java.awt.Point(2, rowTen));
|
||||||
|
|
||||||
|
jStarLabel9.setVisible(false);
|
||||||
jPackageNameLabel = new JLabel();
|
jPackageNameLabel = new JLabel();
|
||||||
jPackageNameLabel.setText("Package Name");
|
jPackageNameLabel.setText("Package Name");
|
||||||
jPackageNameLabel.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
|
jPackageNameLabel.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
|
||||||
|
@ -739,7 +741,20 @@ public class SpdHeader extends IInternalFrame {
|
||||||
|
|
||||||
**/
|
**/
|
||||||
private void initFrame() {
|
private void initFrame() {
|
||||||
|
boolean editable = true;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
editable = false;
|
||||||
|
}
|
||||||
|
jPackageNameTextField.setEditable(editable);
|
||||||
|
jGuidTextField.setEditable(editable);
|
||||||
|
jGenerateGuidButton.setEnabled(editable);
|
||||||
|
jVersionTextField.setEditable(editable);
|
||||||
|
jCopyrightTextArea.setEditable(editable);
|
||||||
|
jLicenseTextArea.setEditable(editable);
|
||||||
|
jUrlTextField.setEditable(editable);
|
||||||
|
jAbstractTextField.setEditable(editable);
|
||||||
|
jDescriptionTextArea.setEditable(editable);
|
||||||
|
jCheckBoxRePkg.setEnabled(editable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -407,7 +407,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
|
||||||
private JButton getJButtonRemove() {
|
private JButton getJButtonRemove() {
|
||||||
if (jButtonRemove == null) {
|
if (jButtonRemove == null) {
|
||||||
jButtonRemove = new JButton();
|
jButtonRemove = new JButton();
|
||||||
jButtonRemove.setText("Remove");
|
jButtonRemove.setText("Delete");
|
||||||
jButtonRemove.setSize(new java.awt.Dimension(buttonWidth,20));
|
jButtonRemove.setSize(new java.awt.Dimension(buttonWidth,20));
|
||||||
jButtonRemove.setBounds(new java.awt.Rectangle(removeButtonCol,rowSeven,buttonWidth,20));
|
jButtonRemove.setBounds(new java.awt.Rectangle(removeButtonCol,rowSeven,buttonWidth,20));
|
||||||
jButtonRemove.addActionListener(this);
|
jButtonRemove.addActionListener(this);
|
||||||
|
@ -423,7 +423,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
|
||||||
private JButton getJButtonRemoveAll() {
|
private JButton getJButtonRemoveAll() {
|
||||||
if (jButtonRemoveAll == null) {
|
if (jButtonRemoveAll == null) {
|
||||||
jButtonRemoveAll = new JButton();
|
jButtonRemoveAll = new JButton();
|
||||||
jButtonRemoveAll.setText("Remove All");
|
jButtonRemoveAll.setText("Clear All");
|
||||||
jButtonRemoveAll.setLocation(removeAllButtonCol,rowSeven);
|
jButtonRemoveAll.setLocation(removeAllButtonCol,rowSeven);
|
||||||
FontMetrics fm = jButtonRemoveAll.getFontMetrics(jButtonRemoveAll.getFont());
|
FontMetrics fm = jButtonRemoveAll.getFontMetrics(jButtonRemoveAll.getFont());
|
||||||
jButtonRemoveAll.setSize(fm.stringWidth(jButtonRemoveAll.getText()) + 50, 20);
|
jButtonRemoveAll.setSize(fm.stringWidth(jButtonRemoveAll.getText()) + 50, 20);
|
||||||
|
@ -473,6 +473,12 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(SpdFileContents sfc) {
|
private void init(SpdFileContents sfc) {
|
||||||
|
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
|
|
||||||
if (sfc.getSpdLibClassDeclarationCount() == 0) {
|
if (sfc.getSpdLibClassDeclarationCount() == 0) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -491,7 +497,21 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
|
||||||
model.addRow(saa[i]);
|
model.addRow(saa[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initFrame() {
|
||||||
|
boolean editable = true;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
editable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
jButtonAdd.setEnabled(editable);
|
||||||
|
jButtonRemove.setEnabled(editable);
|
||||||
|
jButtonRemoveAll.setEnabled(editable);
|
||||||
|
jTable.setEnabled(editable);
|
||||||
|
}
|
||||||
|
|
||||||
private JScrollPane getJContentPane(){
|
private JScrollPane getJContentPane(){
|
||||||
if (topScrollPane == null){
|
if (topScrollPane == null){
|
||||||
topScrollPane = new JScrollPane();
|
topScrollPane = new JScrollPane();
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
|
||||||
if (jButtonRemove == null) {
|
if (jButtonRemove == null) {
|
||||||
jButtonRemove = new JButton();
|
jButtonRemove = new JButton();
|
||||||
jButtonRemove.setBounds(new java.awt.Rectangle(266,148,90,20));
|
jButtonRemove.setBounds(new java.awt.Rectangle(266,148,90,20));
|
||||||
jButtonRemove.setText("Remove");
|
jButtonRemove.setText("Delete");
|
||||||
jButtonRemove.addActionListener(this);
|
jButtonRemove.addActionListener(this);
|
||||||
}
|
}
|
||||||
return jButtonRemove;
|
return jButtonRemove;
|
||||||
|
@ -264,10 +264,15 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
initFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(SpdFileContents sfc){
|
private void init(SpdFileContents sfc){
|
||||||
|
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
|
|
||||||
if (sfc.getSpdMsaFileCount() == 0) {
|
if (sfc.getSpdMsaFileCount() == 0) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -281,6 +286,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
|
||||||
model.addRow(saa[i]);
|
model.addRow(saa[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JScrollPane getJScrollPane(){
|
private JScrollPane getJScrollPane(){
|
||||||
|
@ -325,7 +331,15 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
|
||||||
fill ComboBoxes with pre-defined contents
|
fill ComboBoxes with pre-defined contents
|
||||||
**/
|
**/
|
||||||
private void initFrame() {
|
private void initFrame() {
|
||||||
|
boolean editable = true;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
editable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
jButtonAdd.setEnabled(editable);
|
||||||
|
jButtonRemove.setEnabled(editable);
|
||||||
|
jButtonClearAll.setEnabled(editable);
|
||||||
|
jTable.setEnabled(editable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -1,172 +0,0 @@
|
||||||
/** @file
|
|
||||||
|
|
||||||
The file is used to create, update Package Definitions of Spd file
|
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
|
||||||
All rights reserved. This program and the accompanying materials
|
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
**/
|
|
||||||
package org.tianocore.frameworkwizard.packaging.ui;
|
|
||||||
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
|
|
||||||
import org.tianocore.PackageSurfaceAreaDocument;
|
|
||||||
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
|
|
||||||
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
|
|
||||||
import org.tianocore.frameworkwizard.common.ui.StarLabel;
|
|
||||||
|
|
||||||
public class SpdPackageDefinitions extends IInternalFrame {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private JPanel jContentPane = null;
|
|
||||||
private JLabel jLabelRdOnly = null;
|
|
||||||
private JComboBox jComboBoxReadOnly = null;
|
|
||||||
private JLabel jLabelRePkg = null;
|
|
||||||
private JComboBox jComboBoxRePackage = null;
|
|
||||||
private StarLabel starLabel = null;
|
|
||||||
private StarLabel starLabel1 = null;
|
|
||||||
private SpdFileContents sfc = null;
|
|
||||||
private OpeningPackageType docConsole = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the default constructor
|
|
||||||
*/
|
|
||||||
public SpdPackageDefinitions() {
|
|
||||||
super();
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpdPackageDefinitions(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa){
|
|
||||||
this();
|
|
||||||
sfc = new SpdFileContents(inPsa);
|
|
||||||
init(sfc);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpdPackageDefinitions(OpeningPackageType opt) {
|
|
||||||
this(opt.getXmlSpd());
|
|
||||||
docConsole = opt;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void init(SpdFileContents sfc) {
|
|
||||||
if (sfc.getSpdPkgDefsRdOnly() != null) {
|
|
||||||
jComboBoxReadOnly.setSelectedItem(sfc.getSpdPkgDefsRdOnly());
|
|
||||||
}
|
|
||||||
if (sfc.getSpdPkgDefsRePkg() != null) {
|
|
||||||
jComboBoxRePackage.setSelectedItem(sfc.getSpdPkgDefsRePkg());
|
|
||||||
}
|
|
||||||
this.setVisible(true);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This method initializes this
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
private void initialize() {
|
|
||||||
this.setSize(300, 200);
|
|
||||||
this.setTitle("Package Definitions");
|
|
||||||
this.setContentPane(getJContentPane());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method initializes jContentPane
|
|
||||||
*
|
|
||||||
* @return javax.swing.JPanel
|
|
||||||
*/
|
|
||||||
private JPanel getJContentPane() {
|
|
||||||
if (jContentPane == null) {
|
|
||||||
starLabel1 = new StarLabel();
|
|
||||||
starLabel1.setBounds(new java.awt.Rectangle(4,62,10,20));
|
|
||||||
starLabel1.setVisible(true);
|
|
||||||
starLabel = new StarLabel();
|
|
||||||
starLabel.setBounds(new java.awt.Rectangle(4,22,10,20));
|
|
||||||
jLabelRePkg = new JLabel();
|
|
||||||
jLabelRePkg.setPreferredSize(new java.awt.Dimension(65,20));
|
|
||||||
jLabelRePkg.setLocation(new java.awt.Point(22,62));
|
|
||||||
jLabelRePkg.setSize(new java.awt.Dimension(65,20));
|
|
||||||
jLabelRePkg.setText("RePackage");
|
|
||||||
jLabelRdOnly = new JLabel();
|
|
||||||
jLabelRdOnly.setPreferredSize(new java.awt.Dimension(57,20));
|
|
||||||
jLabelRdOnly.setLocation(new java.awt.Point(22,22));
|
|
||||||
jLabelRdOnly.setSize(new java.awt.Dimension(57,20));
|
|
||||||
jLabelRdOnly.setText("Read Only");
|
|
||||||
jContentPane = new JPanel();
|
|
||||||
jContentPane.setLayout(null);
|
|
||||||
jContentPane.add(jLabelRdOnly, null);
|
|
||||||
jContentPane.add(getJComboBox(), null);
|
|
||||||
jContentPane.add(jLabelRePkg, null);
|
|
||||||
jContentPane.add(getJComboBox1(), null);
|
|
||||||
jContentPane.add(starLabel, null);
|
|
||||||
jContentPane.add(starLabel1, null);
|
|
||||||
}
|
|
||||||
return jContentPane;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method initializes jComboBox
|
|
||||||
*
|
|
||||||
* @return javax.swing.JComboBox
|
|
||||||
*/
|
|
||||||
private JComboBox getJComboBox() {
|
|
||||||
if (jComboBoxReadOnly == null) {
|
|
||||||
jComboBoxReadOnly = new JComboBox();
|
|
||||||
jComboBoxReadOnly.setBounds(new java.awt.Rectangle(95,22,117,20));
|
|
||||||
jComboBoxReadOnly.setPreferredSize(new Dimension(80, 20));
|
|
||||||
jComboBoxReadOnly.addItem("true");
|
|
||||||
jComboBoxReadOnly.addItem("false");
|
|
||||||
jComboBoxReadOnly.setSelectedIndex(1);
|
|
||||||
jComboBoxReadOnly.addItemListener(new java.awt.event.ItemListener() {
|
|
||||||
public void itemStateChanged(java.awt.event.ItemEvent e) {
|
|
||||||
if (jComboBoxReadOnly.getSelectedItem().equals(sfc.getSpdPkgDefsRdOnly())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (docConsole != null) {
|
|
||||||
docConsole.setSaved(false);
|
|
||||||
}
|
|
||||||
sfc.setSpdPkgDefsRdOnly(jComboBoxReadOnly.getSelectedItem()+"");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return jComboBoxReadOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method initializes jComboBox1
|
|
||||||
*
|
|
||||||
* @return javax.swing.JComboBox
|
|
||||||
*/
|
|
||||||
private JComboBox getJComboBox1() {
|
|
||||||
if (jComboBoxRePackage == null) {
|
|
||||||
jComboBoxRePackage = new JComboBox();
|
|
||||||
jComboBoxRePackage.setBounds(new java.awt.Rectangle(95,62,116,20));
|
|
||||||
jComboBoxRePackage.setPreferredSize(new Dimension(80, 20));
|
|
||||||
jComboBoxRePackage.addItem("false");
|
|
||||||
jComboBoxRePackage.addItem("true");
|
|
||||||
jComboBoxRePackage.setSelectedIndex(0);
|
|
||||||
jComboBoxRePackage.addItemListener(new java.awt.event.ItemListener() {
|
|
||||||
public void itemStateChanged(java.awt.event.ItemEvent e) {
|
|
||||||
if (jComboBoxRePackage.getSelectedItem().equals(sfc.getSpdPkgDefsRePkg())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (docConsole != null) {
|
|
||||||
docConsole.setSaved(false);
|
|
||||||
}
|
|
||||||
sfc.setSpdPkgDefsRePkg(jComboBoxRePackage.getSelectedItem()+"");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return jComboBoxRePackage;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -189,7 +189,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
|
||||||
if (jButtonRemove == null) {
|
if (jButtonRemove == null) {
|
||||||
jButtonRemove = new JButton();
|
jButtonRemove = new JButton();
|
||||||
jButtonRemove.setBounds(new java.awt.Rectangle(removeButtonCol,rowFour,buttonWidth,20));
|
jButtonRemove.setBounds(new java.awt.Rectangle(removeButtonCol,rowFour,buttonWidth,20));
|
||||||
jButtonRemove.setText("Remove");
|
jButtonRemove.setText("Delete");
|
||||||
jButtonRemove.addActionListener(this);
|
jButtonRemove.addActionListener(this);
|
||||||
}
|
}
|
||||||
return jButtonRemove;
|
return jButtonRemove;
|
||||||
|
@ -248,10 +248,15 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
initFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(SpdFileContents sfc){
|
private void init(SpdFileContents sfc){
|
||||||
|
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
|
|
||||||
if (sfc.getSpdPackageHeaderCount() == 0) {
|
if (sfc.getSpdPackageHeaderCount() == 0) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -262,6 +267,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
|
||||||
model.addRow(saa[i]);
|
model.addRow(saa[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JScrollPane getJScrollPane(){
|
private JScrollPane getJScrollPane(){
|
||||||
|
@ -323,6 +329,16 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
|
||||||
jComboBoxSelect.addItem("UEFI_APPLICATION");
|
jComboBoxSelect.addItem("UEFI_APPLICATION");
|
||||||
jComboBoxSelect.addItem("USER_DEFINED");
|
jComboBoxSelect.addItem("USER_DEFINED");
|
||||||
jComboBoxSelect.setSelectedIndex(0);
|
jComboBoxSelect.setSelectedIndex(0);
|
||||||
|
|
||||||
|
boolean editable = true;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
editable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
jButtonAdd.setEnabled(editable);
|
||||||
|
jButtonRemove.setEnabled(editable);
|
||||||
|
jButtonClearAll.setEnabled(editable);
|
||||||
|
jTable.setEnabled(editable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -296,7 +296,12 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(SpdFileContents sfc){
|
private void init(SpdFileContents sfc){
|
||||||
initFrame(sfc);
|
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
|
|
||||||
if (sfc.getSpdPcdDefinitionCount() == 0) {
|
if (sfc.getSpdPcdDefinitionCount() == 0) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -346,8 +351,6 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JScrollPane getJContentPane(){
|
private JScrollPane getJContentPane(){
|
||||||
|
@ -459,7 +462,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
|
||||||
jContentPane.add(jLabelTokenSpace, null);
|
jContentPane.add(jLabelTokenSpace, null);
|
||||||
|
|
||||||
**/
|
**/
|
||||||
private void initFrame(SpdFileContents sfc) {
|
private void initFrame() {
|
||||||
|
|
||||||
jComboBoxDataType.addItem("UINT8");
|
jComboBoxDataType.addItem("UINT8");
|
||||||
jComboBoxDataType.addItem("UINT16");
|
jComboBoxDataType.addItem("UINT16");
|
||||||
|
@ -474,6 +477,16 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
|
||||||
for (int i = 0; i < vGuidCName.size(); ++i) {
|
for (int i = 0; i < vGuidCName.size(); ++i) {
|
||||||
jComboBoxTsGuid.addItem(vGuidCName.get(i));
|
jComboBoxTsGuid.addItem(vGuidCName.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean editable = true;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
editable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
jButtonAdd.setEnabled(editable);
|
||||||
|
jButtonRemove.setEnabled(editable);
|
||||||
|
jButtonClearAll.setEnabled(editable);
|
||||||
|
jTable.setEnabled(editable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
|
|
|
@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.packaging.ui;
|
package org.tianocore.frameworkwizard.packaging.ui;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import javax.swing.table.TableModel;
|
import javax.swing.table.TableModel;
|
||||||
|
|
||||||
|
@ -47,10 +48,14 @@ public class SpdPpiDecls extends SpdGuidDecls {
|
||||||
public SpdPpiDecls(OpeningPackageType opt) {
|
public SpdPpiDecls(OpeningPackageType opt) {
|
||||||
this(opt.getXmlSpd());
|
this(opt.getXmlSpd());
|
||||||
docConsole = opt;
|
docConsole = opt;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initFrame() {
|
protected void initFrame() {
|
||||||
|
super.initFrame();
|
||||||
this.setTitle("PPI Declarations");
|
this.setTitle("PPI Declarations");
|
||||||
starLabel.setVisible(false);
|
starLabel.setVisible(false);
|
||||||
((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);
|
((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);
|
||||||
|
@ -71,6 +76,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
|
||||||
model.addRow(saa[i]);
|
model.addRow(saa[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateRow(int row, int column, TableModel m){
|
protected void updateRow(int row, int column, TableModel m){
|
||||||
|
@ -130,4 +136,11 @@ public class SpdPpiDecls extends SpdGuidDecls {
|
||||||
sfc.removeSpdPpiDeclaration();
|
sfc.removeSpdPpiDeclaration();
|
||||||
docConsole.setSaved(false);
|
docConsole.setSaved(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Returns the sfc.
|
||||||
|
*/
|
||||||
|
protected SpdFileContents getSfc() {
|
||||||
|
return sfc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
package org.tianocore.frameworkwizard.packaging.ui;
|
package org.tianocore.frameworkwizard.packaging.ui;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import javax.swing.table.TableModel;
|
import javax.swing.table.TableModel;
|
||||||
|
|
||||||
|
@ -47,10 +48,14 @@ public class SpdProtocolDecls extends SpdGuidDecls {
|
||||||
public SpdProtocolDecls(OpeningPackageType opt) {
|
public SpdProtocolDecls(OpeningPackageType opt) {
|
||||||
this(opt.getXmlSpd());
|
this(opt.getXmlSpd());
|
||||||
docConsole = opt;
|
docConsole = opt;
|
||||||
|
if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
|
||||||
|
JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table.");
|
||||||
|
}
|
||||||
|
initFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initFrame() {
|
protected void initFrame() {
|
||||||
|
super.initFrame();
|
||||||
this.setTitle("Protocol Declarations");
|
this.setTitle("Protocol Declarations");
|
||||||
starLabel.setVisible(false);
|
starLabel.setVisible(false);
|
||||||
((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);
|
((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);
|
||||||
|
@ -130,4 +135,11 @@ public class SpdProtocolDecls extends SpdGuidDecls {
|
||||||
sfc.removeSpdProtocolDeclaration();
|
sfc.removeSpdProtocolDeclaration();
|
||||||
docConsole.setSaved(false);
|
docConsole.setSaved(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Returns the sfc.
|
||||||
|
*/
|
||||||
|
protected SpdFileContents getSfc() {
|
||||||
|
return sfc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue