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=6ca65fa04e7a96a97ec70ad70468878a74ac1645;hp=062d637384f9ede01a5ca2119881edbad23ddd70;hb=214b0d1914b48d651b25e58f321ddb77a46903b8;hpb=a929458e6682db26d87d4ebe80150e13820d3e50
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 062d637384..6ca65fa04e 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
@@ -1,6 +1,6 @@
/** @file
- The file is used to create, update SourceFile of MSA/MBD file
+ The file is used to create, update SourceFiles section of the MSA file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -35,14 +35,15 @@ 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;
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
+import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/**
- The class is used to create, update SourceFile of MSA/MBD file
- It extends IInternalFrame
-
-
-
+ * The class is used to create, update SourceFiles section of the MSA file
+ *
+ * It extends IDialog
+ *
**/
public class SourceFilesDlg extends IDialog {
@@ -100,6 +101,8 @@ public class SourceFilesDlg extends IDialog {
private String msaFileName = "";
private EnumerationData ed = new EnumerationData();
+
+ private WorkspaceTools wt = new WorkspaceTools();
/**
This method initializes jTextFieldFileName
@@ -110,7 +113,7 @@ public class SourceFilesDlg extends IDialog {
private JTextField getJTextFieldSourceFilesDirectory() {
if (jTextFieldFileName == null) {
jTextFieldFileName = new JTextField();
- jTextFieldFileName.setBounds(new java.awt.Rectangle(140, 10, 250, 20));
+ jTextFieldFileName.setBounds(new java.awt.Rectangle(168, 12, 250, 20));
jTextFieldFileName.setPreferredSize(new java.awt.Dimension(250, 20));
jTextFieldFileName.setToolTipText("Path is relative to the MSA file and must include the file name");
}
@@ -127,7 +130,7 @@ public class SourceFilesDlg extends IDialog {
if (jButtonOpenFile == null) {
jButtonOpenFile = new JButton();
jButtonOpenFile.setText("Browse");
- jButtonOpenFile.setBounds(new java.awt.Rectangle(395, 10, 85, 20));
+ jButtonOpenFile.setBounds(new java.awt.Rectangle(422, 12, 85, 20));
jButtonOpenFile.setPreferredSize(new java.awt.Dimension(85, 20));
jButtonOpenFile.addActionListener(this);
}
@@ -155,7 +158,7 @@ public class SourceFilesDlg extends IDialog {
private JTextField getJTextFieldTagName() {
if (jTextFieldTagName == null) {
jTextFieldTagName = new JTextField();
- jTextFieldTagName.setBounds(new java.awt.Rectangle(140, 35, 340, 20));
+ jTextFieldTagName.setBounds(new java.awt.Rectangle(168, 37, 340, 20));
jTextFieldTagName.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldTagName.setToolTipText("You may specify a specific tool chain tag name, such as BILL1");
}
@@ -165,10 +168,10 @@ public class SourceFilesDlg extends IDialog {
private IComboBox getIComboBoxToolCode() {
if (iComboBoxToolCode == null) {
iComboBoxToolCode = new IComboBox();
- iComboBoxToolCode.setBounds(new java.awt.Rectangle(140, 60, 340, 20));
+ iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 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
"
+ iComboBoxToolCode.setToolTipText("You may select a specific tool command from drop down list,
"
+ + "or you can DOUBLE-CLICK this field to enter your customized
"
+ "tool command.
"
+ "Press ENTER to save your input or press ESCAPE to quit");
}
@@ -183,7 +186,7 @@ public class SourceFilesDlg extends IDialog {
private JTextField getJTextFieldToolCode() {
if (jTextFieldToolCode == null) {
jTextFieldToolCode = new JTextField();
- jTextFieldToolCode.setBounds(new java.awt.Rectangle(140, 60, 340, 20));
+ jTextFieldToolCode.setBounds(new java.awt.Rectangle(168, 62, 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);
@@ -199,7 +202,7 @@ public class SourceFilesDlg extends IDialog {
private JTextField getJTextFieldToolChainFamily() {
if (jTextFieldToolChainFamily == null) {
jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(140, 85, 340, 20));
+ jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(168, 87, 340, 20));
jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldToolChainFamily.setToolTipText("You may specify a specific tool chain family, such as GCC");
}
@@ -214,9 +217,10 @@ public class SourceFilesDlg extends IDialog {
private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(140, 110, 340, 20));
+ jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 137, 340, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldFeatureFlag.setToolTipText("RESERVED FOR FUTURE USE");
+ jTextFieldFeatureFlag.setEnabled(false);
}
return jTextFieldFeatureFlag;
}
@@ -230,7 +234,7 @@ public class SourceFilesDlg extends IDialog {
private JButton getJButtonOk() {
if (jButtonOk == null) {
jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 165, 90, 20));
+ jButtonOk.setBounds(new java.awt.Rectangle(317, 172, 90, 20));
jButtonOk.setText("Ok");
jButtonOk.addActionListener(this);
}
@@ -246,7 +250,7 @@ public class SourceFilesDlg extends IDialog {
private JButton getJButtonCancel() {
if (jButtonCancel == null) {
jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 165, 90, 20));
+ jButtonCancel.setBounds(new java.awt.Rectangle(412, 172, 90, 20));
jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this);
}
@@ -261,9 +265,9 @@ public class SourceFilesDlg extends IDialog {
This is the default constructor
**/
- public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, String fileName) {
+ public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true);
- init(inSourceFilesIdentification, fileName);
+ init(inSourceFilesIdentification, mid);
}
/**
@@ -271,11 +275,12 @@ public class SourceFilesDlg extends IDialog {
**/
private void init() {
- this.setSize(510, 240);
+ this.setSize(525, 240);
this.setContentPane(getJScrollPane());
this.setTitle("Source Files");
this.setViewMode(false);
this.centerWindow();
+ Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
}
/**
@@ -286,10 +291,14 @@ public class SourceFilesDlg extends IDialog {
@param inSourceFiles The input data of SourceFilesDocument.SourceFiles
**/
- private void init(SourceFilesIdentification inSourceFilesIdentifications, String fileName) {
+ private void init(SourceFilesIdentification inSourceFilesIdentifications, ModuleIdentification mid) {
init();
- //this.sfid = inSourceFilesIdentifications;
- this.msaFileName = fileName;
+ this.msaFileName = mid.getPath();
+
+ //
+ // Init arch with module's arch
+ //
+ this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (inSourceFilesIdentifications != null) {
this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename());
@@ -348,30 +357,31 @@ public class SourceFilesDlg extends IDialog {
private JPanel getJContentPane() {
if (jContentPane == null) {
jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(140, 135, 340, 20));
+ jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 340, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20));
jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 110, 120, 20));
+ jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 137, 155, 20));
jLabelFeatureFlag.setText("Feature Flag Expression");
+ jLabelFeatureFlag.setEnabled(false);
jLabelToolCode = new JLabel();
- jLabelToolCode.setBounds(new java.awt.Rectangle(15, 60, 120, 20));
+ jLabelToolCode.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
jLabelToolCode.setText("Tool Code");
jLabelTagName = new JLabel();
- jLabelTagName.setBounds(new java.awt.Rectangle(15, 35, 120, 20));
+ jLabelTagName.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
jLabelTagName.setText("Tag Name");
jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(15, 135, 120, 20));
+ jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 155, 20));
jLabelArch.setText("Supported Architectures");
jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setBounds(new java.awt.Rectangle(15, 85, 120, 20));
+ jLabelToolChainFamily.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
jLabelToolChainFamily.setText("Tool Chain Family");
jLabelFileName = new JLabel();
jLabelFileName.setText("File Name");
- jLabelFileName.setBounds(new java.awt.Rectangle(15, 10, 120, 20));
+ jLabelFileName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
jContentPane = new JPanel();
jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 185));
+ jContentPane.setPreferredSize(new java.awt.Dimension(505, 192));
jContentPane.add(jLabelFileName, null);
jContentPane.add(getJTextFieldSourceFilesDirectory(), null);
@@ -452,7 +462,7 @@ public class SourceFilesDlg extends IDialog {
// Check Filename
//
if (isEmpty(this.jTextFieldFileName.getText())) {
- Log.wrn("Update Source Files", "File Name couldn't be empty");
+ Log.wrn("Update Source Files", "File Name must be entered!");
return false;
}
if (!DataValidation.isFilename(this.jTextFieldFileName.getText())) {