mirror of https://github.com/acidanthera/audk.git
1. Fix EDKT314 Display module source/binary in a radio box
2. Fix EDKT279 Genertate Guilds.xref by wizard tools 3. Fix a typo error in SourceFilesDlg.java git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1604 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b8d0bba047
commit
b63cc1b617
|
@ -22,6 +22,9 @@ import java.awt.event.KeyListener;
|
|||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
@ -306,6 +309,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
///
|
||||
private static FrameworkWizardUI fwui = null;
|
||||
|
||||
private JMenuItem jMenuItemToolsGenerateGuidsXref = null;
|
||||
|
||||
/**
|
||||
If the class hasn't an instnace, new one.
|
||||
|
||||
|
@ -431,7 +436,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
jMenuFile.add(getJMenuItemFileSaveAs());
|
||||
jMenuFile.add(getJMenuItemFileSaveAll());
|
||||
jMenuFile.addSeparator();
|
||||
|
||||
|
||||
jMenuFile.add(getJMenuItemFileRefresh());
|
||||
jMenuFile.addSeparator();
|
||||
|
||||
|
@ -784,6 +789,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
|
||||
jMenuTools.add(getJMenuItemToolsToolChainConfiguration());
|
||||
jMenuTools.add(getJMenuItemToolsBuildPreferences());
|
||||
jMenuTools.addSeparator();
|
||||
|
||||
jMenuTools.add(getJMenuItemToolsGenerateGuidsXref());
|
||||
}
|
||||
return jMenuTools;
|
||||
}
|
||||
|
@ -1758,6 +1766,21 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
return jMenuItemEditFindLibraryInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes jMenuItemProjectGenerateGuidsXref
|
||||
*
|
||||
* @return javax.swing.JMenuItem
|
||||
*/
|
||||
private JMenuItem getJMenuItemToolsGenerateGuidsXref() {
|
||||
if (jMenuItemToolsGenerateGuidsXref == null) {
|
||||
jMenuItemToolsGenerateGuidsXref = new JMenuItem();
|
||||
jMenuItemToolsGenerateGuidsXref.setText("Generate guids.xref");
|
||||
jMenuItemToolsGenerateGuidsXref.setMnemonic('G');
|
||||
jMenuItemToolsGenerateGuidsXref.addActionListener(this);
|
||||
}
|
||||
return jMenuItemToolsGenerateGuidsXref;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.tianocore.packaging.common.ui.IFrame#main(java.lang.String[])
|
||||
*
|
||||
|
@ -1884,7 +1907,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
if (arg0.getSource() == this.jMenuItemFileSaveAll) {
|
||||
this.saveAll();
|
||||
}
|
||||
|
||||
|
||||
if (arg0.getSource() == this.jMenuItemFileRefresh) {
|
||||
this.closeAll();
|
||||
this.refresh();
|
||||
|
@ -1951,6 +1974,10 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
this.setupToolChainConfiguration();
|
||||
}
|
||||
|
||||
if (arg0.getSource() == this.jMenuItemToolsGenerateGuidsXref) {
|
||||
this.generateGuidsXref();
|
||||
}
|
||||
|
||||
if (arg0.getSource() == this.jMenuItemHelpAbout) {
|
||||
About a = new About(this, true);
|
||||
int result = a.showDialog();
|
||||
|
@ -2625,9 +2652,12 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
IDefaultMutableTreeNode belongNode = null;
|
||||
|
||||
try {
|
||||
id = iTree.getSelectNode().getId();
|
||||
intCategory = iTree.getSelectCategory();
|
||||
belongNode = iTree.getSelectNode().getBelongNode();
|
||||
//
|
||||
// Get selected tree node
|
||||
//
|
||||
if (iTree.getSelectNode() != null) {
|
||||
id = iTree.getSelectNode().getId();
|
||||
}
|
||||
|
||||
//
|
||||
// If id is null, return directly
|
||||
|
@ -2636,6 +2666,9 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
return;
|
||||
}
|
||||
|
||||
intCategory = iTree.getSelectCategory();
|
||||
belongNode = iTree.getSelectNode().getBelongNode();
|
||||
|
||||
//
|
||||
// If the node is not opened yet
|
||||
// Insert top level elements first
|
||||
|
@ -3585,4 +3618,57 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Search whole workspace and find all module's name and guid, and save them to a file
|
||||
|
||||
**/
|
||||
private void generateGuidsXref() {
|
||||
//
|
||||
// Init File Chooser
|
||||
//
|
||||
JFileChooser fc = new JFileChooser();
|
||||
fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
|
||||
fc.setSelectedFile(new File(Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
|
||||
+ DataType.GUIDS_XREF_FILE_NAME));
|
||||
fc.setMultiSelectionEnabled(false);
|
||||
|
||||
//
|
||||
// Get guids xref and save to file
|
||||
//
|
||||
int result = fc.showOpenDialog(new JPanel());
|
||||
if (result == JFileChooser.APPROVE_OPTION) {
|
||||
Vector<String> v = wt.getAllModuleGuidXref();
|
||||
if (v.size() < 1) {
|
||||
Log.wrn("No guids found!!!");
|
||||
return;
|
||||
}
|
||||
File f = fc.getSelectedFile();
|
||||
if (!f.exists()) {
|
||||
try {
|
||||
f.createNewFile();
|
||||
} catch (IOException e) {
|
||||
Log.wrn("Fail to create file", e.getMessage());
|
||||
Log.err("Fail to create file when generating guids.xref", e.getMessage());
|
||||
}
|
||||
}
|
||||
FileWriter fw = null;
|
||||
BufferedWriter bw = null;
|
||||
try {
|
||||
fw = new FileWriter(f);
|
||||
bw = new BufferedWriter(fw);
|
||||
for (int index = 0; index < v.size(); index++) {
|
||||
bw.write(v.get(index));
|
||||
bw.newLine();
|
||||
}
|
||||
bw.flush();
|
||||
fw.flush();
|
||||
bw.close();
|
||||
fw.close();
|
||||
} catch (IOException e) {
|
||||
Log.wrn("Fail to write file", e.getMessage());
|
||||
Log.err("Fail to write file when generating guids.xref", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -279,4 +279,9 @@ public class DataType {
|
|||
public final static String PROTOCOL_TYPE_PROTOCOL = "Protocol";
|
||||
|
||||
public final static String PROTOCOL_TYPE_PROTOCOL_NOTIFY = "Protocol Notify";
|
||||
|
||||
//
|
||||
// The default file name for guids.xref file
|
||||
//
|
||||
public final static String GUIDS_XREF_FILE_NAME = "guids.xref";
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.awt.event.ComponentEvent;
|
|||
import java.awt.event.FocusEvent;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
|
@ -44,6 +45,7 @@ import org.tianocore.frameworkwizard.common.Tools;
|
|||
import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
|
||||
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
|
||||
import org.tianocore.frameworkwizard.common.ui.StarLabel;
|
||||
import javax.swing.JRadioButton;
|
||||
|
||||
/**
|
||||
The class is used to create, update MsaHeader of MSA file
|
||||
|
@ -123,8 +125,6 @@ public class MsaHeader extends IInternalFrame {
|
|||
|
||||
private JLabel jLabelBinaryModule = null;
|
||||
|
||||
private JComboBox jComboBoxBinaryModule = null;
|
||||
|
||||
private JLabel jLabelOutputFileBasename = null;
|
||||
|
||||
private JTextField jTextFieldOutputFileBasename = null;
|
||||
|
@ -194,6 +194,10 @@ public class MsaHeader extends IInternalFrame {
|
|||
|
||||
private EnumerationData ed = new EnumerationData();
|
||||
|
||||
private JRadioButton jRadioButtonBinaryModuleTrue = null;
|
||||
|
||||
private JRadioButton jRadioButtonBinaryModuleFalse = null;
|
||||
|
||||
/**
|
||||
* This method initializes jCheckBoxIa32
|
||||
*
|
||||
|
@ -599,29 +603,6 @@ public class MsaHeader extends IInternalFrame {
|
|||
return jTextAreaCopyright;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes jComboBoxBinaryModule
|
||||
*
|
||||
* @return javax.swing.JComboBox
|
||||
*/
|
||||
private JComboBox getJComboBoxBinaryModule() {
|
||||
if (jComboBoxBinaryModule == null) {
|
||||
jComboBoxBinaryModule = new JComboBox();
|
||||
jComboBoxBinaryModule.setBounds(new java.awt.Rectangle(valueCol, 480, valueWidth, 20));
|
||||
jComboBoxBinaryModule.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
|
||||
jComboBoxBinaryModule.addFocusListener(this);
|
||||
jComboBoxBinaryModule.setToolTipText("<html>Modules are either source modules <br>"
|
||||
+ "which can be compiled or binary <br>"
|
||||
+ "modules which are linked. <br>"
|
||||
+ "A module cannot contain both. <br>"
|
||||
+ "The GUID numbers should be identical <br>"
|
||||
+ "for a binary and source MSA, <br>"
|
||||
+ "however the BINARY MSA should have <br>"
|
||||
+ "a higher version number.</html>");
|
||||
}
|
||||
return jComboBoxBinaryModule;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes jTextFieldOutputFileBasename
|
||||
*
|
||||
|
@ -798,9 +779,9 @@ public class MsaHeader extends IInternalFrame {
|
|||
this.setSelectedItems(Tools.convertListToVector(md.getSupportedArchitectures()));
|
||||
}
|
||||
if (md.getBinaryModule()) {
|
||||
this.jComboBoxBinaryModule.setSelectedIndex(1);
|
||||
this.jRadioButtonBinaryModuleTrue.setSelected(true);
|
||||
} else {
|
||||
this.jComboBoxBinaryModule.setSelectedIndex(0);
|
||||
this.jRadioButtonBinaryModuleFalse.setSelected(true);
|
||||
}
|
||||
if (md.getOutputFileBasename() != null) {
|
||||
this.jTextFieldOutputFileBasename.setText(md.getOutputFileBasename());
|
||||
|
@ -917,7 +898,6 @@ public class MsaHeader extends IInternalFrame {
|
|||
jContentPane.add(jLabelOutputFileBasename, null);
|
||||
jContentPane.add(getJTextFieldOutputFileBasename(), null);
|
||||
jContentPane.add(jLabelBinaryModule, null);
|
||||
jContentPane.add(getJComboBoxBinaryModule(), null);
|
||||
jContentPane.add(jLabelArch, null);
|
||||
|
||||
jStarLabel1 = new StarLabel();
|
||||
|
@ -963,11 +943,15 @@ public class MsaHeader extends IInternalFrame {
|
|||
jContentPane.add(getJCheckBoxArm(), null);
|
||||
jContentPane.add(getJCheckBoxPpc(), null);
|
||||
|
||||
|
||||
jContentPane.add(getJCheckBoxPcd(), null);
|
||||
jContentPane.add(getJComboBoxPcdIsDriver(), null);
|
||||
|
||||
jContentPane.add(getJCheckBoxFlashMap(), null);
|
||||
|
||||
ButtonGroup bg = new ButtonGroup();
|
||||
jContentPane.add(getJRadioButtonBinaryModuleTrue(), null);
|
||||
jContentPane.add(getJRadioButtonBinaryModuleFalse(), null);
|
||||
bg.add(getJRadioButtonBinaryModuleTrue());
|
||||
bg.add(getJRadioButtonBinaryModuleFalse());
|
||||
}
|
||||
return jContentPane;
|
||||
}
|
||||
|
@ -1146,7 +1130,6 @@ public class MsaHeader extends IInternalFrame {
|
|||
private void initFrame() {
|
||||
EnumerationData ed = new EnumerationData();
|
||||
Tools.generateComboBoxByVector(jComboBoxModuleType, ed.getVModuleType());
|
||||
Tools.generateComboBoxByVector(jComboBoxBinaryModule, ed.getVBoolean());
|
||||
this.setSelectedItems(ed.getVSupportedArchitectures());
|
||||
}
|
||||
|
||||
|
@ -1186,15 +1169,14 @@ public class MsaHeader extends IInternalFrame {
|
|||
Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);
|
||||
// Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);
|
||||
// Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);
|
||||
// Tools.resizeComponentWidth(this.jComboBoxBinaryModule, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth);
|
||||
// Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);
|
||||
Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);
|
||||
|
||||
Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth,
|
||||
DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON - 5);
|
||||
DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
|
||||
}
|
||||
|
||||
public void focusLost(FocusEvent arg0) {
|
||||
|
@ -1391,14 +1373,21 @@ public class MsaHeader extends IInternalFrame {
|
|||
//
|
||||
// Check Binary Module Type
|
||||
//
|
||||
if (arg0.getSource() == this.jComboBoxBinaryModule) {
|
||||
if (jComboBoxBinaryModule.getSelectedItem().toString().equals(DataType.TRUE)) {
|
||||
if (arg0.getSource() == this.jRadioButtonBinaryModuleTrue) {
|
||||
if (jRadioButtonBinaryModuleTrue.isSelected()) {
|
||||
if (md.getBinaryModule()) {
|
||||
return;
|
||||
} else {
|
||||
md.setBinaryModule(true);
|
||||
}
|
||||
} else if (jComboBoxBinaryModule.getSelectedItem().toString().equals(DataType.FALSE)) {
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check Binary Module Type
|
||||
//
|
||||
if (arg0.getSource() == this.jRadioButtonBinaryModuleFalse) {
|
||||
if (jRadioButtonBinaryModuleFalse.isSelected()) {
|
||||
if (md.getBinaryModule()) {
|
||||
md.setBinaryModule(false);
|
||||
} else {
|
||||
|
@ -1618,5 +1607,51 @@ public class MsaHeader extends IInternalFrame {
|
|||
}
|
||||
return jCheckBoxFlashMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method initializes jRadioButtonBinaryModuleTrue
|
||||
*
|
||||
* @return javax.swing.JRadioButton
|
||||
*/
|
||||
private JRadioButton getJRadioButtonBinaryModuleTrue() {
|
||||
if (jRadioButtonBinaryModuleTrue == null) {
|
||||
jRadioButtonBinaryModuleTrue = new JRadioButton();
|
||||
jRadioButtonBinaryModuleTrue.setBounds(new java.awt.Rectangle(valueCol, 480, 140, 20));
|
||||
jRadioButtonBinaryModuleTrue.setText("True");
|
||||
jRadioButtonBinaryModuleTrue.setSelected(true);
|
||||
jRadioButtonBinaryModuleTrue.addFocusListener(this);
|
||||
jRadioButtonBinaryModuleTrue.setToolTipText("<html>Modules are either source modules <br>"
|
||||
+ "which can be compiled or binary <br>"
|
||||
+ "modules which are linked. <br>"
|
||||
+ "A module cannot contain both. <br>"
|
||||
+ "The GUID numbers should be identical <br>"
|
||||
+ "for a binary and source MSA, <br>"
|
||||
+ "however the BINARY MSA should have <br>"
|
||||
+ "a higher version number.</html>");
|
||||
}
|
||||
return jRadioButtonBinaryModuleTrue;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes jRadioButtonBinaryModuleFalse
|
||||
*
|
||||
* @return javax.swing.JRadioButton
|
||||
*/
|
||||
private JRadioButton getJRadioButtonBinaryModuleFalse() {
|
||||
if (jRadioButtonBinaryModuleFalse == null) {
|
||||
jRadioButtonBinaryModuleFalse = new JRadioButton();
|
||||
jRadioButtonBinaryModuleFalse.setBounds(new java.awt.Rectangle(valueCol + 140, 480, 140, 20));
|
||||
jRadioButtonBinaryModuleFalse.setText("False");
|
||||
jRadioButtonBinaryModuleFalse.addFocusListener(this);
|
||||
jRadioButtonBinaryModuleFalse.setToolTipText("<html>Modules are either source modules <br>"
|
||||
+ "which can be compiled or binary <br>"
|
||||
+ "modules which are linked. <br>"
|
||||
+ "A module cannot contain both. <br>"
|
||||
+ "The GUID numbers should be identical <br>"
|
||||
+ "for a binary and source MSA, <br>"
|
||||
+ "however the BINARY MSA should have <br>"
|
||||
+ "a higher version number.</html>");
|
||||
}
|
||||
return jRadioButtonBinaryModuleFalse;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ public class SourceFilesDlg extends IDialog {
|
|||
iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
|
||||
iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
|
||||
iComboBoxToolCode.setToolTipText("<html>You may select a specific tool command from drop down list,<br>"
|
||||
+ "or you can DOUBLE-CLICK this feild to enter your customized<br>"
|
||||
+ "or you can DOUBLE-CLICK this field to enter your customized<br>"
|
||||
+ "tool command.<br>"
|
||||
+ "Press ENTER to save your input or press ESCAPE to quit</html>");
|
||||
}
|
||||
|
|
|
@ -804,4 +804,13 @@ public class WorkspaceTools {
|
|||
}
|
||||
return vpid;
|
||||
}
|
||||
|
||||
public Vector<String> getAllModuleGuidXref() {
|
||||
Vector<String> v = new Vector<String>();
|
||||
for (int index = 0; index < GlobalData.openingModuleList.size(); index++) {
|
||||
ModuleIdentification id = GlobalData.openingModuleList.getOpeningModuleByIndex(index).getId();
|
||||
v.addElement(id.getGuid() + " " + id.getName());
|
||||
}
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue