X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fmodule%2Fui%2Fdialog%2FGuidsDlg.java;h=3c1e37037f9d0285a463cd64eb2472f93bf5bb4c;hp=24d8f942d3ba28a411b74078e37882975532af01;hb=a19466adcb3939cd5fb8f919f000c04a0fe0b6f1;hpb=ed1665f26835816c3ef05ef5eadd30bff1ec4829 diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java index 24d8f942d3..3c1e37037f 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java @@ -1,6 +1,5 @@ /** @file - - The file is used to create, update Guids of MSA/MBD file + <> Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials @@ -23,6 +22,7 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; +import javax.swing.JTextArea; import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataValidation; @@ -37,21 +37,20 @@ import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentific import org.tianocore.frameworkwizard.workspace.WorkspaceTools; /** - The class is used to create, update Guids of MSA/MBD file - It extends IInternalFrame - - - - **/ + * The class is used to create, update Guids of the MSA file + * + * It extends IDialog + * + */ public class GuidsDlg extends IDialog { - /// - /// Define class Serial Version UID - /// + // / + // / Define class Serial Version UID + // / private static final long serialVersionUID = 6710858997766979803L; // - //Define class members + // Define class members // private JPanel jContentPane = null; @@ -77,7 +76,9 @@ public class GuidsDlg extends IDialog { private JLabel jLabelHelpText = null; - private JTextField jTextFieldHelpText = null; + private JTextArea jTextAreaHelpText = null; + + private JScrollPane jScrollPaneHelpText = null; private ArchCheckBox jArchCheckBox = null; @@ -95,54 +96,64 @@ public class GuidsDlg extends IDialog { private WorkspaceTools wt = new WorkspaceTools(); /** - This method initializes jTextFieldC_Name - - @return javax.swing.JTextField jTextFieldC_Name - - **/ + * This method initializes jTextFieldC_Name + * + * @return javax.swing.JTextField jTextFieldC_Name + * + */ private JComboBox getJComboBoxCName() { if (jComboBoxCName == null) { jComboBoxCName = new JComboBox(); - jComboBoxCName.setBounds(new java.awt.Rectangle(160, 10, 320, 20)); + jComboBoxCName.setBounds(new java.awt.Rectangle(168, 12, 320, 20)); jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20)); + jComboBoxCName.setToolTipText("Select the C Name of the GUID"); } return jComboBoxCName; } /** - This method initializes jComboBoxUsage - - @return javax.swing.JComboBox jComboBoxUsage - - **/ + * 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.setBounds(new java.awt.Rectangle(168, 37, 320, 20)); jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20)); + jComboBoxUsage + .setToolTipText("" + + "" + + "" + + "" + + "" + + "" + + "
ALWAYS_CONSUMEDModule always consumes the GUID
SOMETIMES_CONSUMEDModule will use the GUID only if it is present
ALWAYS_PRODUCEDModule always produces the GUID
SOMETIMES_PRODUCEDModule will sometimes produce the GUID
DEFAULTDefault is the the GUID that specified the
instance of the package
"); } return jComboBoxUsage; } /** - This method initializes jTextFieldFeatureFlag - - @return javax.swing.JTextField - - **/ + * This method initializes jTextFieldFeatureFlag + * + * @return javax.swing.JTextField + * + */ private JTextField getJTextFieldFeatureFlag() { if (jTextFieldFeatureFlag == null) { jTextFieldFeatureFlag = new JTextField(); - jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20)); + jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 107, 320, 20)); jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20)); + jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE"); } return jTextFieldFeatureFlag; } /** - This method initializes jScrollPane - - @return javax.swing.JScrollPane + * This method initializes jScrollPane + * + * @return javax.swing.JScrollPane */ private JScrollPane getJScrollPane() { if (jScrollPane == null) { @@ -153,30 +164,48 @@ public class GuidsDlg extends IDialog { } /** - This method initializes jTextFieldHelpText - - @return javax.swing.JTextField - - **/ - private JTextField getJTextFieldHelpText() { - if (jTextFieldHelpText == null) { - jTextFieldHelpText = new JTextField(); - jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20)); - jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20)); + * This method initializes jTextAreaHelpText + * + * @return javax.swing.JTextArea + * + */ + private JTextArea getJTextAreaHelpText() { + if (jTextAreaHelpText == null) { + jTextAreaHelpText = new JTextArea(); + jTextAreaHelpText.setLineWrap(true); + jTextAreaHelpText.setWrapStyleWord(true); } - return jTextFieldHelpText; + return jTextAreaHelpText; } /** - This method initializes jButtonOk - - @return javax.swing.JButton - + * + * This method initializes jScrollPaneHelpText + * + * @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(168, 62)); + jScrollPaneHelpText.setViewportView(getJTextAreaHelpText()); + } + return jScrollPaneHelpText; + } + + /** + * This method initializes jButtonOk + * + * @return javax.swing.JButton + * + */ private JButton getJButtonOk() { if (jButtonOk == null) { jButtonOk = new JButton(); - jButtonOk.setBounds(new java.awt.Rectangle(290, 140, 90, 20)); + jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20)); jButtonOk.setText("Ok"); jButtonOk.addActionListener(this); } @@ -184,15 +213,15 @@ public class GuidsDlg extends IDialog { } /** - This method initializes jButtonCancel - - @return javax.swing.JButton - - **/ + * This method initializes jButtonCancel + * + * @return javax.swing.JButton + * + */ private JButton getJButtonCancel() { if (jButtonCancel == null) { jButtonCancel = new JButton(); - jButtonCancel.setBounds(new java.awt.Rectangle(390, 140, 90, 20)); + jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20)); jButtonCancel.setText("Cancel"); jButtonCancel.addActionListener(this); } @@ -204,11 +233,12 @@ public class GuidsDlg extends IDialog { } /** - This method initializes this - - **/ + * + * This method initializes this + * + */ private void init() { - this.setSize(500, 200); + this.setSize(505, 235); this.setContentPane(getJScrollPane()); this.setTitle("Guids"); initFrame(); @@ -217,12 +247,13 @@ public class GuidsDlg extends IDialog { } /** - This method initializes this - Fill values to all fields if these values are not empty - - @param inGuidsId - - **/ + * + * This method initializes this Fill values to all fields if these values are + * not empty + * + * @param inGuidsId + * + */ private void init(GuidsIdentification inGuidsId) { init(); this.id = inGuidsId; @@ -230,30 +261,31 @@ public class GuidsDlg extends IDialog { if (this.id != null) { this.jComboBoxCName.setSelectedItem(id.getName()); this.jComboBoxUsage.setSelectedItem(id.getUsage()); - this.jTextFieldHelpText.setText(id.getHelp()); + this.jTextAreaHelpText.setText(id.getHelp()); this.jTextFieldFeatureFlag.setText(id.getFeatureFlag()); this.jArchCheckBox.setSelectedItems(id.getSupArchList()); } } /** - This is the override edit constructor - - @param inGuidsIdentification - @param iFrame - - **/ + * This is the override edit constructor + * + * @param inGuidsIdentification + * @param iFrame + * + */ public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) { super(iFrame, true); init(inGuidsIdentification); } /** - Disable all components when the mode is view - - @param isView true - The view mode; false - The non-view mode - - **/ + * Disable all components when the mode is view + * + * @param isView + * true - The view mode; false - The non-view mode + * + */ public void setViewMode(boolean isView) { if (isView) { this.jComboBoxUsage.setEnabled(!isView); @@ -261,54 +293,55 @@ public class GuidsDlg extends IDialog { } /** - This method initializes jContentPane - - @return javax.swing.JPanel jContentPane - - **/ + * This method initializes jContentPane + * + * @return javax.swing.JPanel jContentPane + * + */ private JPanel getJContentPane() { if (jContentPane == null) { - jArchCheckBox = new ArchCheckBox(); - jArchCheckBox.setBounds(new java.awt.Rectangle(160, 110, 320, 20)); - jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20)); + jStarLabel1 = new StarLabel(); + jStarLabel1.setLocation(new java.awt.Point(2, 12)); + jLabelC_Name = new JLabel(); + jLabelC_Name.setText("Select GUID's C Name"); + jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 155, 20)); + + jStarLabel2 = new StarLabel(); + jStarLabel2.setLocation(new java.awt.Point(2, 37)); jLabelUsage = new JLabel(); jLabelUsage.setText("Usage"); - jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 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"); + jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20)); + jLabelHelpText = new JLabel(); - jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20)); + jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20)); jLabelHelpText.setText("Help Text"); + jLabelFeatureFlag = new JLabel(); + jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 107, 155, 20)); + jLabelFeatureFlag.setText("Feature Flag Expression"); + + jLabelArch = new JLabel(); + jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20)); + jLabelArch.setText("Supported Architectures"); + jArchCheckBox = new ArchCheckBox(); + jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20)); + jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20)); + jContentPane = new JPanel(); jContentPane.setLayout(null); - jContentPane.setPreferredSize(new java.awt.Dimension(490, 165)); + jContentPane.setPreferredSize(new java.awt.Dimension(480, 180)); + jContentPane.add(jStarLabel1, null); jContentPane.add(jLabelC_Name, null); jContentPane.add(getJComboBoxCName(), null); + jContentPane.add(jStarLabel2, null); jContentPane.add(jLabelUsage, null); jContentPane.add(getJComboBoxUsage(), null); + jContentPane.add(jLabelHelpText, null); + jContentPane.add(getJScrollPaneHelpText(), 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(getJTextFieldHelpText(), null); + jContentPane.add(jLabelArch, null); jContentPane.add(jArchCheckBox, null); jContentPane.add(getJButtonOk(), null); jContentPane.add(getJButtonCancel(), null); @@ -317,17 +350,19 @@ public class GuidsDlg extends IDialog { } /** - This method initializes Usage type - - **/ + * This method initializes Usage type + * + */ private void initFrame() { Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllGuidDeclarationsFromWorkspace()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage()); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) - * + * * Override actionPerformed to listen all actions * */ @@ -347,19 +382,19 @@ public class GuidsDlg extends IDialog { } /** - Data validation for all fields - - @retval true - All datas are valid - @retval false - At least one data is invalid - - **/ + * Data validation for all fields + * + * @retval true - All datas are valid + * @retval false - At least one data is invalid + * + */ public boolean checkAdd() { // - // Check if all fields have correct data types + // Check if all fields have correct data types // // - // Check Name + // Check Name // if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) { if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) { @@ -387,7 +422,7 @@ public class GuidsDlg extends IDialog { String arg2 = this.jTextFieldFeatureFlag.getText(); Vector arg3 = this.jArchCheckBox.getSelectedItemsVector(); - String arg4 = this.jTextFieldHelpText.getText(); + String arg4 = this.jTextAreaHelpText.getText(); id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4); return id;