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%2FSourceFilesDlg.java;h=baed15e20afe8001362616aa9902c91ea54cfad7;hp=0be868f54ed52753fe3a3075e986d498b7f15588;hb=0c235b66d2459e2e95e1186d0ae963b022c733dd;hpb=f51ee52bcedf9294034930c89342458d91721251 diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java index 0be868f54e..baed15e20a 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java @@ -27,9 +27,11 @@ import javax.swing.JTextField; import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.DataValidation; +import org.tianocore.frameworkwizard.common.EnumerationData; import org.tianocore.frameworkwizard.common.Log; import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.ui.ArchCheckBox; +import org.tianocore.frameworkwizard.common.ui.IComboBox; import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.StarLabel; @@ -76,6 +78,8 @@ public class SourceFilesDlg extends IDialog { private JTextField jTextFieldToolCode = null; + private IComboBox iComboBoxToolCode = null; + private JTextField jTextFieldToolChainFamily = null; private JLabel jLabelFeatureFlag = null; @@ -83,7 +87,7 @@ public class SourceFilesDlg extends IDialog { private JTextField jTextFieldFeatureFlag = null; private ArchCheckBox jArchCheckBox = null; - + private JButton jButtonOk = null; private JButton jButtonCancel = null; @@ -95,6 +99,8 @@ public class SourceFilesDlg extends IDialog { private String msaFileName = ""; + private EnumerationData ed = new EnumerationData(); + /** This method initializes jTextFieldFileName @@ -156,6 +162,19 @@ public class SourceFilesDlg extends IDialog { return jTextFieldTagName; } + private IComboBox getIComboBoxToolCode() { + if (iComboBoxToolCode == null) { + iComboBoxToolCode = new IComboBox(); + iComboBoxToolCode.setBounds(new java.awt.Rectangle(140, 60, 340, 20)); + iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20)); + iComboBoxToolCode.setToolTipText("You may select a specific tool command from drop down list,
" + + "or you can DOUBLE-CLICK this fild to enter your customizing
" + + "tool command.
" + + "Press ENTER to save your input or press ESCAPE to quit"); + } + return iComboBoxToolCode; + } + /** * This method initializes jTextFieldToolCode * @@ -167,6 +186,7 @@ public class SourceFilesDlg extends IDialog { jTextFieldToolCode.setBounds(new java.awt.Rectangle(140, 60, 340, 20)); jTextFieldToolCode.setPreferredSize(new java.awt.Dimension(340, 20)); jTextFieldToolCode.setToolTipText("You may specify a specific tool command, such as ASM"); + jTextFieldToolCode.setVisible(false); } return jTextFieldToolCode; } @@ -256,6 +276,7 @@ public class SourceFilesDlg extends IDialog { this.setTitle("Source Files"); this.setViewMode(false); this.centerWindow(); + Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode()); } /** @@ -274,7 +295,32 @@ public class SourceFilesDlg extends IDialog { if (inSourceFilesIdentifications != null) { this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename()); this.jTextFieldTagName.setText(inSourceFilesIdentifications.getTagName()); - this.jTextFieldToolCode.setText(inSourceFilesIdentifications.getToolCode()); + + // + // Generate Tool Code selection list + // + Vector v = ed.getVToolCode(); + boolean isFind = false; + String strToolCode = inSourceFilesIdentifications.getToolCode(); + + // + // If the input value is not in the default list, add it to the list + // + if (strToolCode != null) { + for (int index = 0; index < v.size(); index++) { + if (v.elementAt(index).equals(strToolCode)) { + isFind = true; + break; + } + } + if (!isFind && !isEmpty(strToolCode)) { + v.addElement(strToolCode); + } + } + + Tools.generateComboBoxByVector(iComboBoxToolCode, v); + this.iComboBoxToolCode.setSelectedItem(strToolCode); + this.jTextFieldToolChainFamily.setText(inSourceFilesIdentifications.getToolChainFamily()); jTextFieldFeatureFlag.setText(inSourceFilesIdentifications.getFeatureFlag()); this.jArchCheckBox.setSelectedItems(inSourceFilesIdentifications.getSupArchList()); @@ -307,7 +353,7 @@ public class SourceFilesDlg extends IDialog { jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20)); jLabelFeatureFlag = new JLabel(); jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 110, 120, 20)); - jLabelFeatureFlag.setText("Feature Flag"); + jLabelFeatureFlag.setText("Feature Flag Expression"); jLabelToolCode = new JLabel(); jLabelToolCode.setBounds(new java.awt.Rectangle(15, 60, 120, 20)); jLabelToolCode.setText("Tool Code"); @@ -316,7 +362,7 @@ public class SourceFilesDlg extends IDialog { jLabelTagName.setText("Tag Name"); jLabelArch = new JLabel(); jLabelArch.setBounds(new java.awt.Rectangle(15, 135, 120, 20)); - jLabelArch.setText("Sup Arch List"); + jLabelArch.setText("Supported Architectures"); jLabelToolChainFamily = new JLabel(); jLabelToolChainFamily.setBounds(new java.awt.Rectangle(15, 85, 120, 20)); jLabelToolChainFamily.setText("Tool Chain Family"); @@ -341,6 +387,7 @@ public class SourceFilesDlg extends IDialog { jContentPane.add(getJTextFieldTagName(), null); jContentPane.add(jLabelToolCode, null); jContentPane.add(getJTextFieldToolCode(), null); + jContentPane.add(getIComboBoxToolCode(), null); jContentPane.add(getJTextFieldToolChainFamily(), null); jContentPane.add(jLabelFeatureFlag, null); jContentPane.add(getJTextFieldFeatureFlag(), null); @@ -380,13 +427,16 @@ public class SourceFilesDlg extends IDialog { String name = this.jTextFieldFileName.getText(); String s[] = name.split(";"); String tagName = this.jTextFieldTagName.getText(); - String toolCode = this.jTextFieldToolCode.getText(); + String toolCode = this.iComboBoxToolCode.getSelectedItem().toString(); + if (toolCode.equals(DataType.EMPTY_SELECT_ITEM)) { + toolCode = ""; + } String tcf = this.jTextFieldToolChainFamily.getText(); String featureFlag = this.jTextFieldFeatureFlag.getText(); Vector arch = this.jArchCheckBox.getSelectedItemsVector(); sfid = new SourceFilesIdentification[s.length]; for (int index = 0; index < s.length; index++) { - sfid[index] = new SourceFilesIdentification(s[index], tagName, toolCode, tcf, featureFlag, arch); + sfid[index] = new SourceFilesIdentification(s[index], tagName, toolCode, tcf, featureFlag, arch); } return sfid; }