Fixed Absolute position of fields, Added ToolTipText and made HelpText a Scrolling Text Area

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1128 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lhauch 2006-07-27 22:22:01 +00:00
parent a5760d04fa
commit 5b38b75ba6
6 changed files with 1870 additions and 1728 deletions

View File

@ -1,6 +1,7 @@
/** @file /** @file
<<The file is used to create, update BootModes of MSA file>>
The file is used to create, update BootModes of MSA/MBD file <<The BootModesDlg is called to add or edit a Module's Boot Modes definitions.>>
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -11,6 +12,9 @@
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Package Name: Tools
Module Name: FrameworkWizard
**/ **/
package org.tianocore.frameworkwizard.module.ui.dialog; package org.tianocore.frameworkwizard.module.ui.dialog;
@ -38,12 +42,12 @@ import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification; import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
/** /**
The class is used to create, update BootModes of MSA/MBD file * The class is used to create, update BootModes of MSA/MBD file It extends
It extends IDialog * IDialog
*
*
*
**/ */
public class BootModesDlg extends IDialog { public class BootModesDlg extends IDialog {
// / // /
@ -96,11 +100,11 @@ public class BootModesDlg extends IDialog {
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
/** /**
This method initializes jComboBoxBootModeName * This method initializes jComboBoxBootModeName
*
@return javax.swing.JComboBox jComboBoxBootModeName * @return javax.swing.JComboBox jComboBoxBootModeName
*
**/ */
private JComboBox getJComboBoxBootModeName() { private JComboBox getJComboBoxBootModeName() {
if (jComboBoxBootModeName == null) { if (jComboBoxBootModeName == null) {
jComboBoxBootModeName = new JComboBox(); jComboBoxBootModeName = new JComboBox();
@ -112,11 +116,11 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes jComboBoxUsage * This method initializes jComboBoxUsage
*
@return javax.swing.JComboBox jComboBoxUsage * @return javax.swing.JComboBox jComboBoxUsage
*
**/ */
private JComboBox getJComboBoxUsage() { private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) { if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox(); jComboBoxUsage = new JComboBox();
@ -135,16 +139,18 @@ public class BootModesDlg extends IDialog {
private JTextField getJTextFieldFeatureFlag() { private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) { if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField(); jTextFieldFeatureFlag = new JTextField();
jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20)); jTextFieldFeatureFlag
.setBounds(new java.awt.Rectangle(160, 105, 320, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
} }
return jTextFieldFeatureFlag; return jTextFieldFeatureFlag;
} }
/** /**
This method initializes jScrollPane * This method initializes jScrollPane
*
@return javax.swing.JScrollPane * @return javax.swing.JScrollPane
*/ */
private JScrollPane getJScrollPane() { private JScrollPane getJScrollPane() {
if (jScrollPane == null) { if (jScrollPane == null) {
@ -155,28 +161,26 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes jTextAreaHelpText * This method initializes jTextAreaHelpText
*
@return javax.swing.JTextArea * @return javax.swing.JTextArea
*
**/ */
private JTextArea getJTextAreaHelpText() { private JTextArea getJTextAreaHelpText() {
if (jTextAreaHelpText == null) { if (jTextAreaHelpText == null) {
jTextAreaHelpText = new JTextArea(); jTextAreaHelpText = new JTextArea();
jTextAreaHelpText.setLineWrap(true); jTextAreaHelpText.setLineWrap(true);
jTextAreaHelpText.setWrapStyleWord(true); jTextAreaHelpText.setWrapStyleWord(true);
// jTextAreaHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
// jTextAreaHelpText.setPreferredSize(new java.awt.Dimension(320, 20));
} }
return jTextAreaHelpText; return jTextAreaHelpText;
} }
/** /**
This method initializes jScrollPaneHelpText * This method initializes jScrollPaneHelpText
*
@return javax.swing.JScrollPane * @return javax.swing.JScrollPane
*
**/ */
private JScrollPane getJScrollPaneHelpText() { private JScrollPane getJScrollPaneHelpText() {
if (jScrollPaneHelpText == null) { if (jScrollPaneHelpText == null) {
jScrollPaneHelpText = new JScrollPane(); jScrollPaneHelpText = new JScrollPane();
@ -190,11 +194,11 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes jButtonOk * This method initializes jButtonOk
*
@return javax.swing.JButton * @return javax.swing.JButton
*
**/ */
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); jButtonOk = new JButton();
@ -206,11 +210,11 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes jButtonCancel * This method initializes jButtonCancel
*
@return javax.swing.JButton * @return javax.swing.JButton
*
**/ */
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); jButtonCancel = new JButton();
@ -225,9 +229,9 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this
*
**/ */
private void init() { private void init() {
this.setSize(500, 230); this.setSize(500, 230);
this.setContentPane(getJScrollPane()); this.setContentPane(getJScrollPane());
@ -238,12 +242,12 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this Fill values to all fields if these values are
Fill values to all fields if these values are not empty * not empty
*
@param inBootModesId * @param inBootModesId
*
**/ */
private void init(BootModesIdentification inBootModesId) { private void init(BootModesIdentification inBootModesId) {
init(); init();
this.id = inBootModesId; this.id = inBootModesId;
@ -258,23 +262,24 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This is the override edit constructor * This is the override edit constructor
*
@param inBootModesIdentification * @param inBootModesIdentification
@param iFrame * @param iFrame
*
**/ */
public BootModesDlg(BootModesIdentification inBootModesIdentification, IFrame iFrame) { public BootModesDlg(BootModesIdentification inBootModesIdentification, IFrame iFrame) {
super(iFrame, true); super(iFrame, true);
init(inBootModesIdentification); init(inBootModesIdentification);
} }
/** /**
Disable all components when the mode is view * Disable all components when the mode is view
*
@param isView true - The view mode; false - The non-view mode * @param isView
* true - The view mode; false - The non-view mode
**/ *
*/
public void setViewMode(boolean isView) { public void setViewMode(boolean isView) {
if (isView) { if (isView) {
this.jComboBoxBootModeName.setEnabled(!isView); this.jComboBoxBootModeName.setEnabled(!isView);
@ -283,11 +288,11 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes jContentPane * This method initializes jContentPane
*
@return javax.swing.JPanel jContentPane * @return javax.swing.JPanel jContentPane
*
**/ */
private JPanel getJContentPane() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jStarLabel1 = new StarLabel(); jStarLabel1 = new StarLabel();
@ -305,7 +310,7 @@ public class BootModesDlg extends IDialog {
jLabelHelpText.setText("Help Text"); jLabelHelpText.setText("Help Text");
jLabelFeatureFlag = new JLabel(); jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 145, 20)); jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 145, 20));
jLabelFeatureFlag.setText("Feature Flag"); jLabelFeatureFlag.setText("Feature Flag Expression");
jLabelArch = new JLabel(); jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20)); jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
jLabelArch.setText("Supported Archectures"); jLabelArch.setText("Supported Archectures");
@ -338,15 +343,17 @@ public class BootModesDlg extends IDialog {
} }
/** /**
This method initializes BootModeName groups and Usage type * This method initializes BootModeName groups and Usage type
*
**/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxBootModeName, ed.getVBootModeNames()); Tools.generateComboBoxByVector(jComboBoxBootModeName, ed.getVBootModeNames());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
} }
/* (non-Javadoc) /*
* (non-Javadoc)
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
* *
* Override actionPerformed to listen all actions * Override actionPerformed to listen all actions
@ -368,12 +375,12 @@ public class BootModesDlg extends IDialog {
} }
/** /**
Data validation for all fields * Data validation for all fields
*
@retval true - All datas are valid * @retval true - All datas are valid
@retval false - At least one data is invalid * @retval false - At least one data is invalid
*
**/ */
public boolean checkAdd() { public boolean checkAdd() {
// //
// Check if all fields have correct data types // Check if all fields have correct data types
@ -394,7 +401,6 @@ public class BootModesDlg extends IDialog {
private BootModesIdentification getCurrentBootModes() { private BootModesIdentification getCurrentBootModes() {
String arg0 = this.jComboBoxBootModeName.getSelectedItem().toString(); String arg0 = this.jComboBoxBootModeName.getSelectedItem().toString();
String arg1 = this.jComboBoxUsage.getSelectedItem().toString(); String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
String arg2 = this.jTextFieldFeatureFlag.getText(); String arg2 = this.jTextFieldFeatureFlag.getText();

View File

@ -1,6 +1,7 @@
/** @file /** @file
<<The file is used to create, update Data Hub Record entries in a MSA file.>>
The file is used to create, update DataHub of MSA/MBD file <<The DataHbsDlg is a dialog called to add or edit a Data Hub Record within a MSA file.>>
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -11,6 +12,9 @@
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Package Name: Tools
Module Name: FrameworkWizard
**/ **/
package org.tianocore.frameworkwizard.module.ui.dialog; package org.tianocore.frameworkwizard.module.ui.dialog;
@ -24,6 +28,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JTextArea;
import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
@ -37,12 +42,12 @@ import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification; import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification;
/** /**
The class is used to create, update DataHub of MSA/MBD file * The class is used to create, update DataHub of MSA/MBD file It extends
It extends IInternalFrame * IInternalFrame
*
*
*
**/ */
public class DataHubsDlg extends IDialog { public class DataHubsDlg extends IDialog {
// / // /
@ -77,7 +82,9 @@ public class DataHubsDlg extends IDialog {
private JLabel jLabelHelpText = null; private JLabel jLabelHelpText = null;
private JTextField jTextFieldHelpText = null; private JTextArea jTextAreaHelpText = null;
private JScrollPane jScrollPaneHelpText = null;
private ArchCheckBox jArchCheckBox = null; private ArchCheckBox jArchCheckBox = null;
@ -93,36 +100,40 @@ public class DataHubsDlg extends IDialog {
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
/** /**
This method initializes jComboBoxUsage * This method initializes jTextFieldDataHubRecord
*
* @return javax.swing.JTextField jTextFieldDataHubRecord
*
*/
private JTextField getJTextFieldDataHubRecord() {
if (jTextFieldDataHubRecord == null) {
jTextFieldDataHubRecord = new JTextField();
jTextFieldDataHubRecord
.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
jTextFieldDataHubRecord.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldDataHubRecord
.setToolTipText("Enter the C Name of the Data Hub Record");
}
return jTextFieldDataHubRecord;
}
@return javax.swing.JComboBox jComboBoxUsage /**
* This method initializes jComboBoxUsage
**/ *
* @return javax.swing.JComboBox jComboBoxUsage
*
*/
private JComboBox getJComboBoxUsage() { private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) { if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox(); jComboBoxUsage = new JComboBox();
jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20)); jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxUsage
.setToolTipText("<html><table><tr><td>ALWAYS_CONSUMED</td><td>Module always consumes a Data Hub Entry<br>via registering a filter driver.</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module will use a Data Hub Entry if it exists<br>via registering a filter driver</td></tr><tr><td>ALWAYS_PRODUCED</td><td>Always logs data into the Data Hub</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Log data into the Data Hub under<br>certain circumstances</td></tr></table></html>");
} }
return jComboBoxUsage; return jComboBoxUsage;
} }
/**
This method initializes jTextFieldDataHubRecord
@return javax.swing.JTextField jTextFieldDataHubRecord
**/
private JTextField getJTextFieldDataHubRecord() {
if (jTextFieldDataHubRecord == null) {
jTextFieldDataHubRecord = new JTextField();
jTextFieldDataHubRecord.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
jTextFieldDataHubRecord.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldDataHubRecord.setToolTipText("Enter the C Name of the Data Hub Record");
}
return jTextFieldDataHubRecord;
}
/** /**
* This method initializes jTextFieldFeatureFlag * This method initializes jTextFieldFeatureFlag
* *
@ -131,16 +142,17 @@ public class DataHubsDlg extends IDialog {
private JTextField getJTextFieldFeatureFlag() { private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) { if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField(); jTextFieldFeatureFlag = new JTextField();
jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20)); jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
} }
return jTextFieldFeatureFlag; return jTextFieldFeatureFlag;
} }
/** /**
This method initializes jScrollPane * This method initializes jScrollPane
*
@return javax.swing.JScrollPane * @return javax.swing.JScrollPane
*/ */
private JScrollPane getJScrollPane() { private JScrollPane getJScrollPane() {
if (jScrollPane == null) { if (jScrollPane == null) {
@ -151,30 +163,47 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
This method initializes jTextFieldHelpText * This method initializes jTextAreaHelpText
*
@return javax.swing.JTextField * @return javax.swing.JTextArea
*
**/ */
private JTextField getJTextFieldHelpText() { private JTextArea getJTextAreaHelpText() {
if (jTextFieldHelpText == null) { if (jTextAreaHelpText == null) {
jTextFieldHelpText = new JTextField(); jTextAreaHelpText = new JTextArea();
jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20)); jTextAreaHelpText.setLineWrap(true);
jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20)); jTextAreaHelpText.setWrapStyleWord(true);
} }
return jTextFieldHelpText; return jTextAreaHelpText;
} }
/** /**
This method initializes jButtonOk * This method initializes jScrollPaneHelpText
*
@return javax.swing.JButton * @return javax.swing.JScrollPane
*
**/ */
private JScrollPane getJScrollPaneHelpText() {
if (jScrollPaneHelpText == null) {
jScrollPaneHelpText = new JScrollPane();
jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320,40));
jScrollPaneHelpText.setLocation(new java.awt.Point(160,60));
jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
}
return jScrollPaneHelpText;
}
/**
* This method initializes jButtonOk
*
* @return javax.swing.JButton
*
*/
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); jButtonOk = new JButton();
jButtonOk.setBounds(new java.awt.Rectangle(290, 140, 90, 20)); jButtonOk.setBounds(new java.awt.Rectangle(290, 157, 90, 20));
jButtonOk.setText("Ok"); jButtonOk.setText("Ok");
jButtonOk.addActionListener(this); jButtonOk.addActionListener(this);
} }
@ -182,15 +211,15 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
This method initializes jButtonCancel * This method initializes jButtonCancel
*
@return javax.swing.JButton * @return javax.swing.JButton
*
**/ */
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); jButtonCancel = new JButton();
jButtonCancel.setBounds(new java.awt.Rectangle(390, 140, 90, 20)); jButtonCancel.setBounds(new java.awt.Rectangle(390, 157, 90, 20));
jButtonCancel.setText("Cancel"); jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this); jButtonCancel.addActionListener(this);
} }
@ -202,11 +231,11 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this
*
**/ */
private void init() { private void init() {
this.setSize(508, 220); this.setSize(500, 230);
this.setContentPane(getJScrollPane()); this.setContentPane(getJScrollPane());
this.setTitle("Data Hubs"); this.setTitle("Data Hubs");
initFrame(); initFrame();
@ -215,12 +244,12 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this Fill values to all fields if these values are
Fill values to all fields if these values are not empty * not empty
*
@param inDataHubsId * @param inDataHubsId
*
**/ */
private void init(DataHubsIdentification inDataHubsId) { private void init(DataHubsIdentification inDataHubsId) {
init(); init();
this.id = inDataHubsId; this.id = inDataHubsId;
@ -228,30 +257,32 @@ public class DataHubsDlg extends IDialog {
if (this.id != null) { if (this.id != null) {
this.jTextFieldDataHubRecord.setText(id.getName()); this.jTextFieldDataHubRecord.setText(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
this.jTextFieldHelpText.setText(id.getHelp()); this.jTextAreaHelpText.setText(id.getHelp());
this.jTextFieldFeatureFlag.setText(id.getFeatureFlag()); this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
this.jArchCheckBox.setSelectedItems(id.getSupArchList()); this.jArchCheckBox.setSelectedItems(id.getSupArchList());
} }
} }
/** /**
This is the override edit constructor * This is the override edit constructor
*
@param inDataHubsIdentification * @param inDataHubsIdentification
@param iFrame * @param iFrame
*
**/ */
public DataHubsDlg(DataHubsIdentification inDataHubsIdentification, IFrame iFrame) { public DataHubsDlg(DataHubsIdentification inDataHubsIdentification,
IFrame iFrame) {
super(iFrame, true); super(iFrame, true);
init(inDataHubsIdentification); init(inDataHubsIdentification);
} }
/** /**
Disable all components when the mode is view * Disable all components when the mode is view
*
@param isView true - The view mode; false - The non-view mode * @param isView
* true - The view mode; false - The non-view mode
**/ *
*/
public void setViewMode(boolean isView) { public void setViewMode(boolean isView) {
if (isView) { if (isView) {
this.jTextFieldDataHubRecord.setEnabled(!isView); this.jTextFieldDataHubRecord.setEnabled(!isView);
@ -260,35 +291,39 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
This method initializes jContentPane * This method initializes jContentPane
*
@return javax.swing.JPanel jContentPane * @return javax.swing.JPanel jContentPane
*
**/ */
private JPanel getJContentPane() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jArchCheckBox = new ArchCheckBox(); jStarLabel1 = new StarLabel();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 110, 320, 20)); jStarLabel1.setLocation(new java.awt.Point(2, 10));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
jLabelDataHubRecord = new JLabel(); jLabelDataHubRecord = new JLabel();
jLabelDataHubRecord.setBounds(new java.awt.Rectangle(15, 10, 140, 20)); jLabelDataHubRecord.setBounds(new java.awt.Rectangle(15, 10, 145, 20));
jLabelDataHubRecord.setText("Data Hub Record"); jLabelDataHubRecord.setText("Data Hub Record");
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(2, 35));
jLabelUsage = new JLabel(); jLabelUsage = new JLabel();
jLabelUsage.setText("Usage"); jLabelUsage.setText("Usage");
jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 20)); jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 145, 20));
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 110, 140, 20));
jLabelArch.setText("Arch");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
jLabelFeatureFlag.setText("Feature Flag");
jLabelHelpText = new JLabel(); jLabelHelpText = new JLabel();
jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20)); jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 145, 20));
jLabelHelpText.setText("Help Text"); jLabelHelpText.setText("Help Text");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 145, 20));
jLabelFeatureFlag.setText("Feature Flag Expression");
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
jLabelArch.setText("Supported Architectures");
jArchCheckBox = new ArchCheckBox();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 130, 320, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setLayout(null); jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(490, 165)); jContentPane.setPreferredSize(new java.awt.Dimension(485, 185));
jContentPane.add(jLabelDataHubRecord, null); jContentPane.add(jLabelDataHubRecord, null);
jContentPane.add(jLabelUsage, null); jContentPane.add(jLabelUsage, null);
@ -299,16 +334,11 @@ public class DataHubsDlg extends IDialog {
jContentPane.add(getJComboBoxUsage(), null); jContentPane.add(getJComboBoxUsage(), null);
jContentPane.add(getJTextFieldFeatureFlag(), null); jContentPane.add(getJTextFieldFeatureFlag(), null);
jStarLabel1 = new StarLabel();
jStarLabel1.setLocation(new java.awt.Point(0, 10));
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(0, 35));
jContentPane.add(jStarLabel1, null); jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null); jContentPane.add(jStarLabel2, null);
jContentPane.add(jLabelHelpText, null); jContentPane.add(jLabelHelpText, null);
jContentPane.add(getJTextFieldHelpText(), null); jContentPane.add(getJScrollPaneHelpText(), null);
jContentPane.add(jArchCheckBox, null); jContentPane.add(jArchCheckBox, null);
jContentPane.add(getJButtonOk(), null); jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null); jContentPane.add(getJButtonCancel(), null);
@ -317,14 +347,16 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
This method initializes Usage type * This method initializes Usage type
*
**/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVDataHubUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVDataHubUsage());
} }
/* (non-Javadoc) /*
* (non-Javadoc)
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
* *
* Override actionPerformed to listen all actions * Override actionPerformed to listen all actions
@ -346,12 +378,12 @@ public class DataHubsDlg extends IDialog {
} }
/** /**
Data validation for all fields * Data validation for all fields
*
@retval true - All datas are valid * @retval true - All datas are valid
@retval false - At least one data is invalid * @retval false - At least one data is invalid
*
**/ */
public boolean checkAdd() { public boolean checkAdd() {
// //
// Check if all fields have correct data types // Check if all fields have correct data types
@ -361,7 +393,7 @@ public class DataHubsDlg extends IDialog {
// Check DataHubRecord // Check DataHubRecord
// //
if (isEmpty(this.jTextFieldDataHubRecord.getText())) { if (isEmpty(this.jTextFieldDataHubRecord.getText())) {
Log.wrn("Update Hubs", "Data Hub Record couldn't be empty"); Log.wrn("Update Hubs", "Data Hub Record must not be empty");
return false; return false;
} }
@ -391,7 +423,7 @@ public class DataHubsDlg extends IDialog {
String arg2 = this.jTextFieldFeatureFlag.getText(); String arg2 = this.jTextFieldFeatureFlag.getText();
Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector(); Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
String arg4 = this.jTextFieldHelpText.getText(); String arg4 = this.jTextAreaHelpText.getText();
id = new DataHubsIdentification(arg0, arg1, arg2, arg3, arg4); id = new DataHubsIdentification(arg0, arg1, arg2, arg3, arg4);
return id; return id;

View File

@ -1,6 +1,5 @@
/** @file /** @file
<<The file is used to create, update Guids of the MSA file>>
The file is used to create, update Guids of MSA/MBD file
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -23,6 +22,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JTextArea;
import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
@ -37,12 +37,11 @@ import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentific
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
The class is used to create, update Guids of MSA/MBD file * The class is used to create, update Guids of the MSA file
It extends IInternalFrame *
* It extends IDialog
*
*/
**/
public class GuidsDlg extends IDialog { public class GuidsDlg extends IDialog {
// / // /
@ -77,7 +76,9 @@ public class GuidsDlg extends IDialog {
private JLabel jLabelHelpText = null; private JLabel jLabelHelpText = null;
private JTextField jTextFieldHelpText = null; private JTextArea jTextAreaHelpText = null;
private JScrollPane jScrollPaneHelpText = null;
private ArchCheckBox jArchCheckBox = null; private ArchCheckBox jArchCheckBox = null;
@ -95,54 +96,57 @@ public class GuidsDlg extends IDialog {
private WorkspaceTools wt = new WorkspaceTools(); private WorkspaceTools wt = new WorkspaceTools();
/** /**
This method initializes jTextFieldC_Name * This method initializes jTextFieldC_Name
*
@return javax.swing.JTextField jTextFieldC_Name * @return javax.swing.JTextField jTextFieldC_Name
*
**/ */
private JComboBox getJComboBoxCName() { private JComboBox getJComboBoxCName() {
if (jComboBoxCName == null) { if (jComboBoxCName == null) {
jComboBoxCName = new JComboBox(); jComboBoxCName = new JComboBox();
jComboBoxCName.setBounds(new java.awt.Rectangle(160, 10, 320, 20)); jComboBoxCName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxCName.setToolTipText("Select the C Name of the GUID");
} }
return jComboBoxCName; return jComboBoxCName;
} }
/** /**
This method initializes jComboBoxUsage * This method initializes jComboBoxUsage
*
@return javax.swing.JComboBox jComboBoxUsage * @return javax.swing.JComboBox jComboBoxUsage
*
**/ */
private JComboBox getJComboBoxUsage() { private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) { if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox(); jComboBoxUsage = new JComboBox();
jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20)); jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxUsage.setToolTipText("<html><table><tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the GUID</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module will use the GUID only if it is present</td></tr><tr><td>ALWAYS_PRODUCED</td><td>Module always produces the GUID</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Module will sometimes produce the GUID</td></tr><tr><td>DEFAULT</td><td>Default is the the GUID that specified the<br>instance of the package</td></tr></table></html>");
} }
return jComboBoxUsage; return jComboBoxUsage;
} }
/** /**
This method initializes jTextFieldFeatureFlag * This method initializes jTextFieldFeatureFlag
*
@return javax.swing.JTextField * @return javax.swing.JTextField
*
**/ */
private JTextField getJTextFieldFeatureFlag() { private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) { if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField(); jTextFieldFeatureFlag = new JTextField();
jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20)); jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
} }
return jTextFieldFeatureFlag; return jTextFieldFeatureFlag;
} }
/** /**
This method initializes jScrollPane * This method initializes jScrollPane
*
@return javax.swing.JScrollPane * @return javax.swing.JScrollPane
*/ */
private JScrollPane getJScrollPane() { private JScrollPane getJScrollPane() {
if (jScrollPane == null) { if (jScrollPane == null) {
@ -153,30 +157,47 @@ public class GuidsDlg extends IDialog {
} }
/** /**
This method initializes jTextFieldHelpText * This method initializes jTextAreaHelpText
*
@return javax.swing.JTextField * @return javax.swing.JTextArea
*
**/ */
private JTextField getJTextFieldHelpText() { private JTextArea getJTextAreaHelpText() {
if (jTextFieldHelpText == null) { if (jTextAreaHelpText == null) {
jTextFieldHelpText = new JTextField(); jTextAreaHelpText = new JTextArea();
jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20)); jTextAreaHelpText.setLineWrap(true);
jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20)); jTextAreaHelpText.setWrapStyleWord(true);
} }
return jTextFieldHelpText; return jTextAreaHelpText;
} }
/** /**
This method initializes jButtonOk *
* This method initializes jScrollPaneHelpText
@return javax.swing.JButton *
* @return javax.swing.JScrollPane jScrollPaneHelpText
*
**/ **/
private JScrollPane getJScrollPaneHelpText() {
if (jScrollPaneHelpText == null){
jScrollPaneHelpText = new JScrollPane();
jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
jScrollPaneHelpText.setLocation(new java.awt.Point(160,60));
jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
}
return jScrollPaneHelpText;
}
/**
* This method initializes jButtonOk
*
* @return javax.swing.JButton
*
*/
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); jButtonOk = new JButton();
jButtonOk.setBounds(new java.awt.Rectangle(290, 140, 90, 20)); jButtonOk.setBounds(new java.awt.Rectangle(290, 157, 90, 20));
jButtonOk.setText("Ok"); jButtonOk.setText("Ok");
jButtonOk.addActionListener(this); jButtonOk.addActionListener(this);
} }
@ -184,15 +205,15 @@ public class GuidsDlg extends IDialog {
} }
/** /**
This method initializes jButtonCancel * This method initializes jButtonCancel
*
@return javax.swing.JButton * @return javax.swing.JButton
*
**/ */
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); jButtonCancel = new JButton();
jButtonCancel.setBounds(new java.awt.Rectangle(390, 140, 90, 20)); jButtonCancel.setBounds(new java.awt.Rectangle(390, 157, 90, 20));
jButtonCancel.setText("Cancel"); jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this); jButtonCancel.addActionListener(this);
} }
@ -204,11 +225,12 @@ public class GuidsDlg extends IDialog {
} }
/** /**
This method initializes this *
* This method initializes this
**/ *
*/
private void init() { private void init() {
this.setSize(508, 220); this.setSize(500, 230);
this.setContentPane(getJScrollPane()); this.setContentPane(getJScrollPane());
this.setTitle("Guids"); this.setTitle("Guids");
initFrame(); initFrame();
@ -217,12 +239,13 @@ public class GuidsDlg extends IDialog {
} }
/** /**
This method initializes this *
Fill values to all fields if these values are not empty * This method initializes this Fill values to all fields if these values are
* not empty
@param inGuidsId *
* @param inGuidsId
**/ *
*/
private void init(GuidsIdentification inGuidsId) { private void init(GuidsIdentification inGuidsId) {
init(); init();
this.id = inGuidsId; this.id = inGuidsId;
@ -230,30 +253,31 @@ public class GuidsDlg extends IDialog {
if (this.id != null) { if (this.id != null) {
this.jComboBoxCName.setSelectedItem(id.getName()); this.jComboBoxCName.setSelectedItem(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
this.jTextFieldHelpText.setText(id.getHelp()); this.jTextAreaHelpText.setText(id.getHelp());
this.jTextFieldFeatureFlag.setText(id.getFeatureFlag()); this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
this.jArchCheckBox.setSelectedItems(id.getSupArchList()); this.jArchCheckBox.setSelectedItems(id.getSupArchList());
} }
} }
/** /**
This is the override edit constructor * This is the override edit constructor
*
@param inGuidsIdentification * @param inGuidsIdentification
@param iFrame * @param iFrame
*
**/ */
public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) { public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) {
super(iFrame, true); super(iFrame, true);
init(inGuidsIdentification); init(inGuidsIdentification);
} }
/** /**
Disable all components when the mode is view * Disable all components when the mode is view
*
@param isView true - The view mode; false - The non-view mode * @param isView
* true - The view mode; false - The non-view mode
**/ *
*/
public void setViewMode(boolean isView) { public void setViewMode(boolean isView) {
if (isView) { if (isView) {
this.jComboBoxUsage.setEnabled(!isView); this.jComboBoxUsage.setEnabled(!isView);
@ -261,54 +285,55 @@ public class GuidsDlg extends IDialog {
} }
/** /**
This method initializes jContentPane * This method initializes jContentPane
*
@return javax.swing.JPanel jContentPane * @return javax.swing.JPanel jContentPane
*
**/ */
private JPanel getJContentPane() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jArchCheckBox = new ArchCheckBox(); jStarLabel1 = new StarLabel();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 110, 320, 20)); jStarLabel1.setLocation(new java.awt.Point(2, 10));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20)); jLabelC_Name = new JLabel();
jLabelC_Name.setText("Select GUID's C Name");
jLabelC_Name.setBounds(new java.awt.Rectangle(15, 10, 145, 20));
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(2, 35));
jLabelUsage = new JLabel(); jLabelUsage = new JLabel();
jLabelUsage.setText("Usage"); jLabelUsage.setText("Usage");
jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 20)); jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 145, 20));
jLabelC_Name = new JLabel();
jLabelC_Name.setText("C_Name");
jLabelC_Name.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 110, 140, 20));
jLabelArch.setText("Arch");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
jLabelFeatureFlag.setText("Feature Flag");
jLabelHelpText = new JLabel(); jLabelHelpText = new JLabel();
jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20)); jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 145, 20));
jLabelHelpText.setText("Help Text"); jLabelHelpText.setText("Help Text");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 145, 20));
jLabelFeatureFlag.setText("Feature Flag Expression");
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
jLabelArch.setText("Supported Architectures");
jArchCheckBox = new ArchCheckBox();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 130, 320, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setLayout(null); jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(490, 165)); jContentPane.setPreferredSize(new java.awt.Dimension(490, 165));
jContentPane.add(jStarLabel1, null);
jContentPane.add(jLabelC_Name, null); jContentPane.add(jLabelC_Name, null);
jContentPane.add(getJComboBoxCName(), null); jContentPane.add(getJComboBoxCName(), null);
jContentPane.add(jStarLabel2, null);
jContentPane.add(jLabelUsage, null); jContentPane.add(jLabelUsage, null);
jContentPane.add(getJComboBoxUsage(), null); jContentPane.add(getJComboBoxUsage(), null);
jContentPane.add(jLabelFeatureFlag, null);
jContentPane.add(jLabelArch, null);
jContentPane.add(getJTextFieldFeatureFlag(), null);
jStarLabel1 = new StarLabel();
jStarLabel1.setLocation(new java.awt.Point(0, 10));
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(0, 35));
jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null);
jContentPane.add(jLabelHelpText, null); jContentPane.add(jLabelHelpText, null);
jContentPane.add(getJTextFieldHelpText(), null); jContentPane.add(getJScrollPaneHelpText(), null);
jContentPane.add(jLabelFeatureFlag, null);
jContentPane.add(getJTextFieldFeatureFlag(), null);
jContentPane.add(jLabelArch, null);
jContentPane.add(jArchCheckBox, null); jContentPane.add(jArchCheckBox, null);
jContentPane.add(getJButtonOk(), null); jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null); jContentPane.add(getJButtonCancel(), null);
@ -317,15 +342,18 @@ public class GuidsDlg extends IDialog {
} }
/** /**
This method initializes Usage type * This method initializes Usage type
*
**/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllGuidDeclarationsFromWorkspace()); Tools.generateComboBoxByVector(jComboBoxCName, wt
.getAllGuidDeclarationsFromWorkspace());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());
} }
/* (non-Javadoc) /*
* (non-Javadoc)
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
* *
* Override actionPerformed to listen all actions * Override actionPerformed to listen all actions
@ -347,12 +375,12 @@ public class GuidsDlg extends IDialog {
} }
/** /**
Data validation for all fields * Data validation for all fields
*
@retval true - All datas are valid * @retval true - All datas are valid
@retval false - At least one data is invalid * @retval false - At least one data is invalid
*
**/ */
public boolean checkAdd() { public boolean checkAdd() {
// //
// Check if all fields have correct data types // Check if all fields have correct data types
@ -362,7 +390,8 @@ public class GuidsDlg extends IDialog {
// Check Name // Check Name
// //
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) { if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) { if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem()
.toString())) {
Log.wrn("Update Guids", "Incorrect data type for Guid Name"); Log.wrn("Update Guids", "Incorrect data type for Guid Name");
return false; return false;
} }
@ -387,13 +416,11 @@ public class GuidsDlg extends IDialog {
String arg2 = this.jTextFieldFeatureFlag.getText(); String arg2 = this.jTextFieldFeatureFlag.getText();
Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector(); Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
String arg4 = this.jTextFieldHelpText.getText(); String arg4 = this.jTextAreaHelpText.getText();
id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4); id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
return id; return id;
} } public GuidsIdentification getId() {
public GuidsIdentification getId() {
return id; return id;
} }

View File

@ -23,6 +23,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JTextArea;
import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
@ -36,12 +37,11 @@ import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification; import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification;
/** /**
The class is used to create, update Formset of MSA/MBD file * The class is used to create, update Hii Packages of the MSA file
It extends IInternalFrame *
* It extends IDialog
*
*/
**/
public class HiiPackagesDlg extends IDialog { public class HiiPackagesDlg extends IDialog {
// / // /
@ -76,7 +76,9 @@ public class HiiPackagesDlg extends IDialog {
private JLabel jLabelHelpText = null; private JLabel jLabelHelpText = null;
private JTextField jTextFieldHelpText = null; private JTextArea jTextAreaHelpText = null;
private JScrollPane jScrollPaneHelpText = null;
private ArchCheckBox jArchCheckBox = null; private ArchCheckBox jArchCheckBox = null;
@ -92,11 +94,12 @@ public class HiiPackagesDlg extends IDialog {
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
/** /**
This method initializes jTextFieldName *
* This method initializes jTextFieldName
@return javax.swing.JTextField jTextFieldName *
* @return javax.swing.JTextField jTextFieldName
**/ *
*/
private JTextField getJTextFieldName() { private JTextField getJTextFieldName() {
if (jTextFieldName == null) { if (jTextFieldName == null) {
jTextFieldName = new JTextField(); jTextFieldName = new JTextField();
@ -108,21 +111,25 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes jComboBoxUsage *
* This method initializes jComboBoxUsage
@return javax.swing.JComboBox jComboBoxUsage *
* @return javax.swing.JComboBox jComboBoxUsage
**/ *
*/
private JComboBox getJComboBoxUsage() { private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) { if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox(); jComboBoxUsage = new JComboBox();
jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20)); jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxUsage
.setToolTipText("<html><table><tr><td>ALWAYS_PRODUCED</td><td>Hii is always registered</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Some executions paths will require the Hii to be registered</td></tr></table></html>");
} }
return jComboBoxUsage; return jComboBoxUsage;
} }
/** /**
*
* This method initializes jTextFieldFeatureFlag * This method initializes jTextFieldFeatureFlag
* *
* @return javax.swing.JTextField * @return javax.swing.JTextField
@ -130,16 +137,20 @@ public class HiiPackagesDlg extends IDialog {
private JTextField getJTextFieldFeatureFlag() { private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) { if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField(); jTextFieldFeatureFlag = new JTextField();
jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20)); jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldFeatureFlag
.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
} }
return jTextFieldFeatureFlag; return jTextFieldFeatureFlag;
} }
/** /**
This method initializes jScrollPane *
* This method initializes jScrollPane
@return javax.swing.JScrollPane *
* @return javax.swing.JScrollPane
*
*/ */
private JScrollPane getJScrollPane() { private JScrollPane getJScrollPane() {
if (jScrollPane == null) { if (jScrollPane == null) {
@ -150,30 +161,52 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes jTextFieldHelpText *
* This method initializes jTextAreaHelpText
@return javax.swing.JTextField *
* @return javax.swing.JTextArea jTextAreaHelpText
**/ *
private JTextField getJTextFieldHelpText() { */
if (jTextFieldHelpText == null) { private JTextArea getJTextAreaHelpText() {
jTextFieldHelpText = new JTextField(); if (jTextAreaHelpText == null) {
jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20)); jTextAreaHelpText = new JTextArea();
jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20)); jTextAreaHelpText.setLineWrap(true);
jTextAreaHelpText.setWrapStyleWord(true);
} }
return jTextFieldHelpText; return jTextAreaHelpText;
} }
/** /**
This method initializes jButtonOk *
* This method initializes jScrollPaneHelpText
*
* @return javax.swing.JScrollPane
*
*/
private JScrollPane getJScrollPaneHelpText() {
if (jScrollPaneHelpText == null) {
jScrollPaneHelpText = new JScrollPane();
jScrollPaneHelpText
.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
jScrollPaneHelpText.setLocation(new java.awt.Point(160, 60));
jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
}
return jScrollPaneHelpText;
}
@return javax.swing.JButton /**
*
**/ * This method initializes jButtonOk
*
* @return javax.swing.JButton
*
*/
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); jButtonOk = new JButton();
jButtonOk.setBounds(new java.awt.Rectangle(290, 140, 90, 20)); jButtonOk.setBounds(new java.awt.Rectangle(290, 157, 90, 20));
jButtonOk.setText("Ok"); jButtonOk.setText("Ok");
jButtonOk.addActionListener(this); jButtonOk.addActionListener(this);
} }
@ -181,15 +214,16 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes jButtonCancel *
* This method initializes jButtonCancel
@return javax.swing.JButton *
* @return javax.swing.JButton
*
**/ **/
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); jButtonCancel = new JButton();
jButtonCancel.setBounds(new java.awt.Rectangle(390, 140, 90, 20)); jButtonCancel.setBounds(new java.awt.Rectangle(390, 157, 90, 20));
jButtonCancel.setText("Cancel"); jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this); jButtonCancel.addActionListener(this);
} }
@ -201,11 +235,12 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes this *
* This method initializes this
*
**/ **/
private void init() { private void init() {
this.setSize(508, 220); this.setSize(500, 230);
this.setContentPane(getJScrollPane()); this.setContentPane(getJScrollPane());
this.setTitle("Hii Packages"); this.setTitle("Hii Packages");
initFrame(); initFrame();
@ -214,11 +249,11 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this Fill values to all fields if these values are
Fill values to all fields if these values are not empty * not empty
*
@param inHiiPackagesId * @param inHiiPackagesId
*
**/ **/
private void init(HiiPackagesIdentification inHiiPackagesId) { private void init(HiiPackagesIdentification inHiiPackagesId) {
init(); init();
@ -227,29 +262,32 @@ public class HiiPackagesDlg extends IDialog {
if (this.id != null) { if (this.id != null) {
this.jTextFieldName.setText(id.getName()); this.jTextFieldName.setText(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
this.jTextFieldHelpText.setText(id.getHelp()); this.jTextAreaHelpText.setText(id.getHelp());
this.jTextFieldFeatureFlag.setText(id.getFeatureFlag()); this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
this.jArchCheckBox.setSelectedItems(id.getSupArchList()); this.jArchCheckBox.setSelectedItems(id.getSupArchList());
} }
} }
/** /**
This is the override edit constructor * This is the override edit constructor
*
@param inHiiPackagesIdentification * @param inHiiPackagesIdentification
@param iFrame * @param iFrame
*
**/ **/
public HiiPackagesDlg(HiiPackagesIdentification inHiiPackagesIdentification, IFrame iFrame) { public HiiPackagesDlg(HiiPackagesIdentification inHiiPackagesIdentification,
IFrame iFrame) {
super(iFrame, true); super(iFrame, true);
init(inHiiPackagesIdentification); init(inHiiPackagesIdentification);
} }
/** /**
Disable all components when the mode is view *
* Disable all components when the mode is view
@param isView true - The view mode; false - The non-view mode *
* @param isView
* true - The view mode; false - The non-view mode
*
**/ **/
public void setViewMode(boolean isView) { public void setViewMode(boolean isView) {
if (isView) { if (isView) {
@ -259,56 +297,58 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes jContentPane *
* This method initializes jContentPane
@return javax.swing.JPanel jContentPane *
* @return javax.swing.JPanel jContentPane
**/ *
*/
private JPanel getJContentPane() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jArchCheckBox = new ArchCheckBox(); jStarLabel1 = new StarLabel();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 110, 320, 20)); jStarLabel1.setLocation(new java.awt.Point(2, 10));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20)); jLabelName = new JLabel();
jLabelName.setText("Hii Package C Name");
jLabelName.setBounds(new java.awt.Rectangle(15, 10, 145, 20));
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(2, 35));
jLabelUsage = new JLabel(); jLabelUsage = new JLabel();
jLabelUsage.setText("Usage"); jLabelUsage.setText("Usage");
jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 20)); jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 145, 20));
jLabelName = new JLabel();
jLabelName.setText("Name");
jLabelName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 110, 140, 20));
jLabelArch.setText("Arch");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
jLabelFeatureFlag.setText("Feature Flag");
jLabelHelpText = new JLabel(); jLabelHelpText = new JLabel();
jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20)); jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 145, 20));
jLabelHelpText.setText("Help Text"); jLabelHelpText.setText("Help Text");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 145, 20));
jLabelFeatureFlag.setText("Feature Flag Expression");
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
jLabelArch.setText("Supported Architectures");
jArchCheckBox = new ArchCheckBox();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 130, 320, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setLayout(null); jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(490, 165)); jContentPane.setPreferredSize(new java.awt.Dimension(485, 185));
jContentPane.add(jLabelName, null);
jContentPane.add(jLabelUsage, null);
jContentPane.add(getJTextFieldName(), null);
jContentPane.add(getJComboBoxUsage(), null);
jContentPane.add(jLabelFeatureFlag, null);
jContentPane.add(jLabelArch, null);
jContentPane.add(getJTextFieldFeatureFlag(), null);
jStarLabel1 = new StarLabel();
jStarLabel1.setLocation(new java.awt.Point(0, 10));
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(0, 35));
jContentPane.add(jStarLabel1, null); jContentPane.add(jStarLabel1, null);
jContentPane.add(jLabelName, null);
jContentPane.add(getJTextFieldName(), null);
jContentPane.add(jStarLabel2, null); jContentPane.add(jStarLabel2, null);
jContentPane.add(jLabelUsage, null);
jContentPane.add(getJComboBoxUsage(), null);
jContentPane.add(jLabelHelpText, null); jContentPane.add(jLabelHelpText, null);
jContentPane.add(getJTextFieldHelpText(), null); jContentPane.add(getJScrollPaneHelpText(), null);
jContentPane.add(jLabelFeatureFlag, null);
jContentPane.add(getJTextFieldFeatureFlag(), null);
jContentPane.add(jLabelArch, null);
jContentPane.add(jArchCheckBox, null); jContentPane.add(jArchCheckBox, null);
jContentPane.add(getJButtonOk(), null); jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null); jContentPane.add(getJButtonCancel(), null);
} }
@ -316,14 +356,17 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
This method initializes Usage type *
* This method initializes Usage type
**/ *
*/
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHiiPackageUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHiiPackageUsage());
} }
/* (non-Javadoc) /*
* (non-Javadoc)
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
* *
* Override actionPerformed to listen all actions * Override actionPerformed to listen all actions
@ -345,12 +388,13 @@ public class HiiPackagesDlg extends IDialog {
} }
/** /**
Data validation for all fields *
* Data validation for all fields
@retval true - All datas are valid *
@retval false - At least one data is invalid * @retval true - All datas are valid
* @retval false - At least one data is invalid
**/ *
*/
public boolean checkAdd() { public boolean checkAdd() {
// //
// Check if all fields have correct data types // Check if all fields have correct data types
@ -360,13 +404,15 @@ public class HiiPackagesDlg extends IDialog {
// Check Hii Package Name // Check Hii Package Name
// //
if (isEmpty(this.jTextFieldName.getText())) { if (isEmpty(this.jTextFieldName.getText())) {
Log.wrn("Update Hii Packages", "Hii Package Name Record couldn't be empty"); Log.wrn("Update Hii Packages",
"Hii Package Name Record must not be empty");
return false; return false;
} }
if (!isEmpty(this.jTextFieldName.getText())) { if (!isEmpty(this.jTextFieldName.getText())) {
if (!DataValidation.isC_NameType(this.jTextFieldName.getText())) { if (!DataValidation.isC_NameType(this.jTextFieldName.getText())) {
Log.wrn("Update Hii Packages", "Incorrect data type for Hii Package Name"); Log.wrn("Update Hii Packages",
"Incorrect data type for Hii Package Name");
return false; return false;
} }
} }
@ -390,7 +436,7 @@ public class HiiPackagesDlg extends IDialog {
String arg2 = this.jTextFieldFeatureFlag.getText(); String arg2 = this.jTextFieldFeatureFlag.getText();
Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector(); Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
String arg4 = this.jTextFieldHelpText.getText(); String arg4 = this.jTextAreaHelpText.getText();
id = new HiiPackagesIdentification(arg0, arg1, arg2, arg3, arg4); id = new HiiPackagesIdentification(arg0, arg1, arg2, arg3, arg4);
return id; return id;

View File

@ -127,6 +127,7 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
jComboBoxUsage = new JComboBox(); jComboBoxUsage = new JComboBox();
jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20)); jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxUsage.setToolTipText("ALWAYS_CONSUMED is the only valid usage for type ProtocolNotify.");
} }
return jComboBoxUsage; return jComboBoxUsage;
} }
@ -155,7 +156,7 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
jComboBoxProtocolType.setBounds(new java.awt.Rectangle(160, 10, 320, 20)); jComboBoxProtocolType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxProtocolType.addItemListener(this); jComboBoxProtocolType.addItemListener(this);
jComboBoxProtocolType.setToolTipText("Select Protocol Type"); jComboBoxProtocolType.setToolTipText("<html>Select Protocol Type<br>Protocol Notify is a register protocol notify mechanism.");
} }
return jComboBoxProtocolType; return jComboBoxProtocolType;
} }
@ -170,6 +171,7 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
jComboBoxCName = new JComboBox(); jComboBoxCName = new JComboBox();
jComboBoxCName.setBounds(new java.awt.Rectangle(160, 35, 320, 20)); jComboBoxCName.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxCName.setToolTipText("Select Guid C Name of the Protocol");
} }
return jComboBoxCName; return jComboBoxCName;

View File

@ -1,6 +1,7 @@
/** @file /** @file
<<The file is used to create, update SystemTable in the MSA file>>
The file is used to create, update SystemTable of MSA/MBD file <<This dialog is used to add or edit a System Table entry in the MSA file.>>
Copyright (c) 2006, Intel Corporation Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -23,6 +24,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JTextArea;
import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
@ -37,12 +39,12 @@ import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemT
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
The class is used to create, update SystemTable of MSA/MBD file * The class is used to create, update SystemTable of MSA/MBD file It extends
It extends IInternalFrame * IInternalFrame
*
*
*
**/ */
public class SystemTablesDlg extends IDialog { public class SystemTablesDlg extends IDialog {
// / // /
@ -77,7 +79,9 @@ public class SystemTablesDlg extends IDialog {
private JLabel jLabelHelpText = null; private JLabel jLabelHelpText = null;
private JTextField jTextFieldHelpText = null; private JTextArea jTextAreaHelpText = null;
private JScrollPane jScrollPaneHelpText = null;
private ArchCheckBox jArchCheckBox = null; private ArchCheckBox jArchCheckBox = null;
@ -95,36 +99,39 @@ public class SystemTablesDlg extends IDialog {
private WorkspaceTools wt = new WorkspaceTools(); private WorkspaceTools wt = new WorkspaceTools();
/** /**
This method initializes jComboBoxUsage * This method initializes jComboBoxGuidC_Name
*
@return javax.swing.JComboBox jComboBoxUsage * @return javax.swing.JComboBox jComboBoxGuidC_Name
*
**/ */
private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox();
jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
}
return jComboBoxUsage;
}
/**
This method initializes jTextField
@return javax.swing.JTextField jTextFieldC_Name
**/
private JComboBox getJComboBoxGuidC_Name() { private JComboBox getJComboBoxGuidC_Name() {
if (jComboBoxGuidC_Name == null) { if (jComboBoxGuidC_Name == null) {
jComboBoxGuidC_Name = new JComboBox(); jComboBoxGuidC_Name = new JComboBox();
jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 10, 320, 20)); jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20)); jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Hob"); jComboBoxGuidC_Name
.setToolTipText("Select the GUID C Name of the System Table");
} }
return jComboBoxGuidC_Name; return jComboBoxGuidC_Name;
} }
/**
* This method initializes jComboBoxUsage
*
* @return javax.swing.JComboBox jComboBoxUsage
*
*/
private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox();
jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxUsage
.setToolTipText("<html><table><tr><td>ALWAYS_CONSUMED</td><td>Module requires a GUIDed entry in the system table</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module consumes a GUIDed entry in the system<br>table if it is present</td></tr><tr><td>ALWAYS_PRODUCED</td><td>Module always produces a GUIDed entry in the system table</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Module produces a GUIDed entry in the system table<br>for some of its execution flows.</td></tr></table></html>");
}
return jComboBoxUsage;
}
/** /**
* This method initializes jTextFieldFeatureFlag * This method initializes jTextFieldFeatureFlag
* *
@ -133,16 +140,17 @@ public class SystemTablesDlg extends IDialog {
private JTextField getJTextFieldFeatureFlag() { private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) { if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField(); jTextFieldFeatureFlag = new JTextField();
jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20)); jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
} }
return jTextFieldFeatureFlag; return jTextFieldFeatureFlag;
} }
/** /**
This method initializes jScrollPane * This method initializes jScrollPane
*
@return javax.swing.JScrollPane * @return javax.swing.JScrollPane
*/ */
private JScrollPane getJScrollPane() { private JScrollPane getJScrollPane() {
if (jScrollPane == null) { if (jScrollPane == null) {
@ -153,30 +161,46 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
This method initializes jTextFieldHelpText * This method initializes jTextAreaHelpText
*
@return javax.swing.JTextField * @return javax.swing.JTextArea
*
**/ */
private JTextField getJTextFieldHelpText() { private JTextArea getJTextAreaHelpText() {
if (jTextFieldHelpText == null) { if (jTextAreaHelpText == null) {
jTextFieldHelpText = new JTextField(); jTextAreaHelpText = new JTextArea();
jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20)); jTextAreaHelpText.setLineWrap(true);
jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20)); jTextAreaHelpText.setWrapStyleWord(true);
} }
return jTextFieldHelpText; return jTextAreaHelpText;
} }
/** /**
This method initializes jButtonOk * This method initializes jScrollPaneHelpText
*
@return javax.swing.JButton * @returns javax.swing.JScrollPane jScrollPaneHelpText
*/
**/ private JScrollPane getJScrollPaneHelpText(){
if (jScrollPaneHelpText == null){
jScrollPaneHelpText = new JScrollPane();
jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320,40));
jScrollPaneHelpText.setLocation(new java.awt.Point(160, 60));
jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
}
return jScrollPaneHelpText;
}
/**
* This method initializes jButtonOk
*
* @return javax.swing.JButton
*
*/
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); jButtonOk = new JButton();
jButtonOk.setBounds(new java.awt.Rectangle(290, 140, 90, 20)); jButtonOk.setBounds(new java.awt.Rectangle(290, 157, 90, 20));
jButtonOk.setText("Ok"); jButtonOk.setText("Ok");
jButtonOk.addActionListener(this); jButtonOk.addActionListener(this);
} }
@ -184,15 +208,15 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
This method initializes jButtonCancel * This method initializes jButtonCancel
*
@return javax.swing.JButton * @return javax.swing.JButton
*
**/ */
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); jButtonCancel = new JButton();
jButtonCancel.setBounds(new java.awt.Rectangle(390, 140, 90, 20)); jButtonCancel.setBounds(new java.awt.Rectangle(390, 157, 90, 20));
jButtonCancel.setText("Cancel"); jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this); jButtonCancel.addActionListener(this);
} }
@ -204,11 +228,11 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this
*
**/ */
private void init() { private void init() {
this.setSize(508, 215); this.setSize(500, 230);
this.setContentPane(getJScrollPane()); this.setContentPane(getJScrollPane());
this.setTitle("System Tables"); this.setTitle("System Tables");
initFrame(); initFrame();
@ -217,12 +241,12 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
This method initializes this * This method initializes this Fill values to all fields if these values are
Fill values to all fields if these values are not empty * not empty
*
@param inSystemTablesId * @param inSystemTablesId
*
**/ */
private void init(SystemTablesIdentification inSystemTablesId) { private void init(SystemTablesIdentification inSystemTablesId) {
init(); init();
this.id = inSystemTablesId; this.id = inSystemTablesId;
@ -230,30 +254,32 @@ public class SystemTablesDlg extends IDialog {
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
this.jTextFieldHelpText.setText(id.getHelp()); this.jTextAreaHelpText.setText(id.getHelp());
this.jTextFieldFeatureFlag.setText(id.getFeatureFlag()); this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
this.jArchCheckBox.setSelectedItems(id.getSupArchList()); this.jArchCheckBox.setSelectedItems(id.getSupArchList());
} }
} }
/** /**
This is the override edit constructor * This is the override edit constructor
*
@param inBootModesIdentification * @param inBootModesIdentification
@param iFrame * @param iFrame
*
**/ */
public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame) { public SystemTablesDlg(
SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame) {
super(iFrame, true); super(iFrame, true);
init(inSystemTablesIdentification); init(inSystemTablesIdentification);
} }
/** /**
Disable all components when the mode is view * Disable all components when the mode is view
*
@param isView true - The view mode; false - The non-view mode * @param isView
* true - The view mode; false - The non-view mode
**/ *
*/
public void setViewMode(boolean isView) { public void setViewMode(boolean isView) {
if (isView) { if (isView) {
this.jComboBoxUsage.setEnabled(!isView); this.jComboBoxUsage.setEnabled(!isView);
@ -261,35 +287,39 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
This method initializes jContentPane * This method initializes jContentPane
*
@return javax.swing.JPanel jContentPane * @return javax.swing.JPanel jContentPane
*
**/ */
private JPanel getJContentPane() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jLabelArch = new JLabel(); jStarLabel1 = new StarLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 110, 140, 20)); jStarLabel1.setLocation(new java.awt.Point(2, 10));
jLabelArch.setText("Arch"); jLabelEntry = new JLabel();
jArchCheckBox = new ArchCheckBox(); jLabelEntry.setText("Table's GUID C Name");
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 110, 320, 20)); jLabelEntry.setBounds(new java.awt.Rectangle(15, 10, 145, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20)); jStarLabel2 = new StarLabel();
jLabelFeatureFlag = new JLabel(); jStarLabel2.setLocation(new java.awt.Point(2, 35));
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
jLabelFeatureFlag.setText("Feature Flag");
jLabelUsage = new JLabel(); jLabelUsage = new JLabel();
jLabelUsage.setText("Usage"); jLabelUsage.setText("Usage");
jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 20)); jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 145, 20));
jLabelEntry = new JLabel();
jLabelEntry.setText("Guid C Name");
jLabelEntry.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
jLabelHelpText = new JLabel(); jLabelHelpText = new JLabel();
jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20)); jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 145, 20));
jLabelHelpText.setText("Help Text"); jLabelHelpText.setText("Help Text");
jLabelFeatureFlag = new JLabel();
jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 140, 20));
jLabelFeatureFlag.setText("Feature Flag Expression");
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
jLabelArch.setText("Supported Architectures");
jArchCheckBox = new ArchCheckBox();
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 130, 320, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setLayout(null); jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(490, 165)); jContentPane.setPreferredSize(new java.awt.Dimension(485, 185));
jContentPane.add(jLabelEntry, null); jContentPane.add(jLabelEntry, null);
jContentPane.add(jLabelFeatureFlag, null); jContentPane.add(jLabelFeatureFlag, null);
@ -298,16 +328,12 @@ public class SystemTablesDlg extends IDialog {
jContentPane.add(jLabelArch, null); jContentPane.add(jLabelArch, null);
jContentPane.add(jLabelUsage, null); jContentPane.add(jLabelUsage, null);
jContentPane.add(getJComboBoxUsage(), null); jContentPane.add(getJComboBoxUsage(), null);
jStarLabel1 = new StarLabel();
jStarLabel1.setBounds(new java.awt.Rectangle(0, 10, 10, 20));
jStarLabel2 = new StarLabel();
jStarLabel2.setBounds(new java.awt.Rectangle(0, 35, 10, 20));
jContentPane.add(jStarLabel1, null); jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null); jContentPane.add(jStarLabel2, null);
jContentPane.add(jLabelHelpText, null); jContentPane.add(jLabelHelpText, null);
jContentPane.add(getJTextFieldHelpText(), null); jContentPane.add(getJScrollPaneHelpText(), null);
jContentPane.add(jArchCheckBox, null); jContentPane.add(jArchCheckBox, null);
jContentPane.add(getJButtonOk(), null); jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null); jContentPane.add(getJButtonCancel(), null);
@ -316,15 +342,18 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
This method initializes Usage type * This method initializes Usage type
*
**/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());
Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace()); Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt
.getAllGuidDeclarationsFromWorkspace());
} }
/* (non-Javadoc) /*
* (non-Javadoc)
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
* *
* Override actionPerformed to listen all actions * Override actionPerformed to listen all actions
@ -346,12 +375,12 @@ public class SystemTablesDlg extends IDialog {
} }
/** /**
Data validation for all fields * Data validation for all fields
*
@retval true - All datas are valid * @retval true - All datas are valid
@retval false - At least one data is invalid * @retval false - At least one data is invalid
*
**/ */
public boolean checkAdd() { public boolean checkAdd() {
// //
// Check if all fields have correct data types // Check if all fields have correct data types
@ -376,7 +405,7 @@ public class SystemTablesDlg extends IDialog {
String arg2 = this.jTextFieldFeatureFlag.getText(); String arg2 = this.jTextFieldFeatureFlag.getText();
Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector(); Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
String arg4 = this.jTextFieldHelpText.getText(); String arg4 = this.jTextAreaHelpText.getText();
id = new SystemTablesIdentification(arg0, arg1, arg2, arg3, arg4); id = new SystemTablesIdentification(arg0, arg1, arg2, arg3, arg4);
return id; return id;