Add ModuleSA BuildOptions

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@737 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-07-04 08:11:49 +00:00
parent df282395d7
commit 1800d80f22
4 changed files with 312 additions and 34 deletions

View File

@ -15,10 +15,8 @@
package org.tianocore.frameworkwizard.platform.ui; package org.tianocore.frameworkwizard.platform.ui;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JDialog;
import javax.swing.JTabbedPane; import javax.swing.JTabbedPane;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JLabel; import javax.swing.JLabel;
@ -26,18 +24,13 @@ import java.awt.FlowLayout;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.ButtonGroup;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
import javax.swing.DefaultListModel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JRadioButton;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameEvent;
@ -51,11 +44,11 @@ import javax.swing.table.TableModel;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import java.awt.CardLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Set; import java.util.Set;
import java.util.Vector;
public class FpdBuildOptions extends IInternalFrame { public class FpdBuildOptions extends IInternalFrame {
@ -109,7 +102,6 @@ public class FpdBuildOptions extends IInternalFrame {
private JTable jTable5 = null; private JTable jTable5 = null;
private JButton jButton10 = null; private JButton jButton10 = null;
private JButton jButton11 = null; private JButton jButton11 = null;
private DefaultListModel listModel = new DefaultListModel();
private JButton jButton17 = null; private JButton jButton17 = null;
private JButton jButton18 = null; private JButton jButton18 = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
@ -856,9 +848,22 @@ public class FpdBuildOptions extends IInternalFrame {
TableModel m = (TableModel)arg0.getSource(); TableModel m = (TableModel)arg0.getSource();
if (arg0.getType() == TableModelEvent.UPDATE){ if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check. //ToDo Data Validition check.
String targetName = m.getValueAt(row, 0) + ""; String targets = m.getValueAt(row, 0) + "";
Vector<Object> targetName = new Vector<Object>();
String[] sArray = targets.split("( )+");
for (int i = 0; i < sArray.length; ++i) {
targetName.add(sArray[i]);
}
String toolChain = m.getValueAt(row, 1) + ""; String toolChain = m.getValueAt(row, 1) + "";
String supArch = m.getValueAt(row, 2) + ""; String archs = m.getValueAt(row, 2) + "";
Vector<Object> supArch = new Vector<Object>();
String[] sArray1 = archs.split("( )+");
for (int i = 0; i < sArray1.length; ++i) {
supArch.add(sArray1[i]);
}
if (supArch.size() == 0) {
supArch.add("IA32");
}
String toolCmd = m.getValueAt(row, 3) + ""; String toolCmd = m.getValueAt(row, 3) + "";
String tagName = m.getValueAt(row, 4) + ""; String tagName = m.getValueAt(row, 4) + "";
String contents = m.getValueAt(row, 5) + ""; String contents = m.getValueAt(row, 5) + "";
@ -893,13 +898,23 @@ public class FpdBuildOptions extends IInternalFrame {
Object[] o = {jTextField12.getText(), jComboBox2.getSelectedItem(), s, Object[] o = {jTextField12.getText(), jComboBox2.getSelectedItem(), s,
jTextField8.getText(), jTextField13.getText(), jTextField7.getText()}; jTextField8.getText(), jTextField13.getText(), jTextField7.getText()};
optionsTableModel.addRow(o); optionsTableModel.addRow(o);
ffc.genBuildOptionsOpt(jTextField12.getText(), jComboBox2.getSelectedItem()+"", jTextField13.getText(), jTextField8.getText(), s, jTextField7.getText());
ffc.genBuildOptionsOpt(stringToVector(jTextField12.getText()), jComboBox2.getSelectedItem()+"", jTextField13.getText(), jTextField8.getText(), stringToVector(s), jTextField7.getText());
} }
}); });
} }
return jButton10; return jButton10;
} }
private Vector<Object> stringToVector(String s) {
String[] sArray = s.split(" ");
Vector<Object> v = new Vector<Object>();
for (int i = 0; i < sArray.length; ++i) {
v.add(sArray[i]);
}
return v;
}
private String boolToList (boolean[] bool) { private String boolToList (boolean[] bool) {
String s = " "; String s = " ";
if (bool[0]) { if (bool[0]) {
@ -920,7 +935,9 @@ public class FpdBuildOptions extends IInternalFrame {
if (bool[5]) { if (bool[5]) {
s += "PPC "; s += "PPC ";
} }
if (s == " ") {
s += "IA32";
}
return s.trim(); return s.trim();
} }

View File

@ -391,6 +391,149 @@ public class FpdFileContents {
instance.setPackageVersion(pv); instance.setPackageVersion(pv);
} }
public String getFvBinding(String moduleKey){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa == null || msa.getModuleSaBuildOptions() == null) {
return null;
}
return msa.getModuleSaBuildOptions().getFvBinding();
}
public void setFvBinding(String moduleKey, String fvBinding){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa == null ) {
return;
}
if(msa.getModuleSaBuildOptions() == null){
msa.addNewModuleSaBuildOptions().setFvBinding(fvBinding);
return;
}
msa.getModuleSaBuildOptions().setFvBinding(fvBinding);
}
public String getFfsFileNameGuid(String moduleKey){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa == null || msa.getModuleSaBuildOptions() == null) {
return null;
}
return msa.getModuleSaBuildOptions().getFfsFileNameGuid();
}
public void setFfsFileNameGuid(String moduleKey, String fileGuid){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa == null ) {
return;
}
if(msa.getModuleSaBuildOptions() == null){
msa.addNewModuleSaBuildOptions().setFfsFileNameGuid(fileGuid);
return;
}
msa.getModuleSaBuildOptions().setFfsFileNameGuid(fileGuid);
}
public String getFfsFormatKey(String moduleKey){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa == null || msa.getModuleSaBuildOptions() == null) {
return null;
}
return msa.getModuleSaBuildOptions().getFfsFormatKey();
}
public void setFfsFormatKey(String moduleKey, String ffsKey){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa == null ) {
return;
}
if(msa.getModuleSaBuildOptions() == null){
msa.addNewModuleSaBuildOptions().setFfsFormatKey(ffsKey);
return;
}
msa.getModuleSaBuildOptions().setFvBinding(ffsKey);
}
public void getModuleSAOptions(String moduleKey, String[][] saa) {
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null
|| msa.getModuleSaBuildOptions().getOptions().getOptionList() == null) {
return ;
}
List<OptionDocument.Option> lOpt = msa.getModuleSaBuildOptions().getOptions().getOptionList();
ListIterator li = lOpt.listIterator();
int i = 0;
while(li.hasNext()) {
OptionDocument.Option opt = (OptionDocument.Option)li.next();
if (opt.getBuildTargets() != null) {
saa[i][0] = listToString(opt.getBuildTargets());
}
saa[i][1] = opt.getToolChainFamily();
if (opt.getSupArchList() != null){
saa[i][2] = listToString(opt.getSupArchList());
}
saa[i][3] = opt.getToolCode();
saa[i][4] = opt.getTagName();
saa[i][5] = opt.getStringValue();
++i;
}
}
public int getModuleSAOptionsCount(String moduleKey){
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null
|| msa.getModuleSaBuildOptions().getOptions().getOptionList() == null) {
return 0;
}
return msa.getModuleSaBuildOptions().getOptions().getOptionList().size();
}
public void genModuleSAOptionsOpt(String moduleKey, Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa.getModuleSaBuildOptions() == null) {
msa.addNewModuleSaBuildOptions();
}
if (msa.getModuleSaBuildOptions().getOptions() == null){
msa.getModuleSaBuildOptions().addNewOptions();
}
OptionDocument.Option opt = msa.getModuleSaBuildOptions().getOptions().addNewOption();
setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
}
public void removeModuleSAOptionsOpt(String moduleKey, int i) {
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null) {
return ;
}
OptionsDocument.Options opts = msa.getModuleSaBuildOptions().getOptions();
XmlCursor cursor = opts.newCursor();
if (cursor.toFirstChild()) {
for (int j = 0; j < i; ++j){
cursor.toNextSibling();
}
cursor.removeXml();
}
cursor.dispose();
}
public void updateModuleSAOptionsOpt(String moduleKey, int i, Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
if (msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null) {
return ;
}
OptionsDocument.Options opts = msa.getModuleSaBuildOptions().getOptions();
XmlCursor cursor = opts.newCursor();
if (cursor.toFirstChild()) {
for (int j = 0; j < i; ++j){
cursor.toNextSibling();
}
OptionDocument.Option opt = (OptionDocument.Option)cursor.getObject();
setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
}
cursor.dispose();
}
/**add pcd information of module mi to a ModuleSA. /**add pcd information of module mi to a ModuleSA.
* @param mi * @param mi
* @param moduleSa if null, generate a new ModuleSA. * @param moduleSa if null, generate a new ModuleSA.
@ -1050,7 +1193,7 @@ public class FpdFileContents {
++i; ++i;
} }
} }
public void genBuildOptionsOpt(String buildTargets, String toolChain, String tagName, String toolCmd, String archList, String contents) { public void genBuildOptionsOpt(Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
OptionsDocument.Options opts = getfpdBuildOpts().getOptions(); OptionsDocument.Options opts = getfpdBuildOpts().getOptions();
if (opts == null) { if (opts == null) {
opts = getfpdBuildOpts().addNewOptions(); opts = getfpdBuildOpts().addNewOptions();
@ -1059,18 +1202,15 @@ public class FpdFileContents {
setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt); setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
} }
private void setBuildOptionsOpt(String buildTargets, String toolChain, String tagName, String toolCmd, String archList, String contents, OptionDocument.Option opt){ private void setBuildOptionsOpt(Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents, OptionDocument.Option opt){
opt.setStringValue(contents); opt.setStringValue(contents);
// opt.setBuildTargets(buildTargets);
opt.setBuildTargets(buildTargets);
opt.setToolChainFamily(toolChain); opt.setToolChainFamily(toolChain);
opt.setTagName(tagName); opt.setTagName(tagName);
opt.setToolCode(toolCmd); opt.setToolCode(toolCmd);
String[] s = archList.split(" ");
ArrayList<String> al = new ArrayList<String>(); opt.setSupArchList(archList);
for (int i = 0; i < s.length; ++i) {
al.add(s[i]);
}
opt.setSupArchList(al);
} }
public void removeBuildOptionsOpt(int i){ public void removeBuildOptionsOpt(int i){
@ -1090,7 +1230,7 @@ public class FpdFileContents {
cursor.dispose(); cursor.dispose();
} }
public void updateBuildOptionsOpt(int i, String buildTargets, String toolChain, String tagName, String toolCmd, String archList, String contents) { public void updateBuildOptionsOpt(int i, Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
XmlObject o = getfpdBuildOpts().getOptions(); XmlObject o = getfpdBuildOpts().getOptions();
if (o == null) { if (o == null) {
return; return;
@ -1374,8 +1514,8 @@ public class FpdFileContents {
while(li.hasNext()) { while(li.hasNext()) {
BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next(); BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next();
if (section.isSetSectionType()) { if (section.isSetSectionType()) {
al.add(section.getSectionType().toString()); al.add(section.getSectionType().toString());
} }
} }
} }
@ -2002,7 +2142,7 @@ public class FpdFileContents {
} }
private String listToString(List<String> l) { private String listToString(List l) {
if (l == null) { if (l == null) {
return null; return null;
} }

View File

@ -23,7 +23,6 @@ import javax.swing.JTabbedPane;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import org.tianocore.FvImagesDocument;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -36,7 +35,6 @@ import java.awt.event.ComponentEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
@ -719,11 +717,11 @@ public class FpdFlash extends IInternalFrame {
if (jPanel5 == null) { if (jPanel5 == null) {
//ToDo add ButtonGroup for RadioButtons //ToDo add ButtonGroup for RadioButtons
jLabel6 = new JLabel(); jLabel6 = new JLabel();
jLabel6.setEnabled(false); jLabel6.setEnabled(true);
jLabel6.setText("Value"); jLabel6.setText("Value");
jLabel6.setPreferredSize(new Dimension(38, 20)); jLabel6.setPreferredSize(new Dimension(38, 20));
jLabel5 = new JLabel(); jLabel5 = new JLabel();
jLabel5.setEnabled(false); jLabel5.setEnabled(true);
jLabel5.setText("Name"); jLabel5.setText("Name");
jLabel5.setPreferredSize(new Dimension(38, 20)); jLabel5.setPreferredSize(new Dimension(38, 20));
jPanel5 = new JPanel(); jPanel5 = new JPanel();
@ -924,7 +922,7 @@ public class FpdFlash extends IInternalFrame {
public void itemStateChanged(ItemEvent arg0) { public void itemStateChanged(ItemEvent arg0) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
boolean selected = jCheckBox3.isSelected(); // boolean selected = jCheckBox3.isSelected();
if (!jCheckBox2.isSelected() || jComboBox.getSelectedIndex() == 0) { if (!jCheckBox2.isSelected() || jComboBox.getSelectedIndex() == 0) {
return; return;
@ -1086,7 +1084,7 @@ public class FpdFlash extends IInternalFrame {
private JTextField getJTextField4() { private JTextField getJTextField4() {
if (jTextField4 == null) { if (jTextField4 == null) {
jTextField4 = new JTextField(); jTextField4 = new JTextField();
jTextField4.setEnabled(false); jTextField4.setEnabled(true);
jTextField4.setPreferredSize(new Dimension(100, 20)); jTextField4.setPreferredSize(new Dimension(100, 20));
} }
return jTextField4; return jTextField4;
@ -1100,7 +1098,7 @@ public class FpdFlash extends IInternalFrame {
private JTextField getJTextField5() { private JTextField getJTextField5() {
if (jTextField5 == null) { if (jTextField5 == null) {
jTextField5 = new JTextField(); jTextField5 = new JTextField();
jTextField5.setEnabled(false); jTextField5.setEnabled(true);
jTextField5.setPreferredSize(new Dimension(100, 20)); jTextField5.setPreferredSize(new Dimension(100, 20));
} }
return jTextField5; return jTextField5;

View File

@ -36,6 +36,8 @@ import java.util.Iterator;
import java.util.ListIterator; import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Vector;
import javax.swing.JTextField; import javax.swing.JTextField;
public class FpdModuleSA extends JDialog implements ActionListener { public class FpdModuleSA extends JDialog implements ActionListener {
@ -82,6 +84,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
private LibraryTableModel model1 = null; private LibraryTableModel model1 = null;
private LibraryTableModel model2 = null; private LibraryTableModel model2 = null;
private LibraryTableModel model3 = null; private LibraryTableModel model3 = null;
private DefaultTableModel optionsTableModel = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private String moduleKey = null; private String moduleKey = null;
private HashMap<String, ArrayList<String>> classInstanceMap = null; private HashMap<String, ArrayList<String>> classInstanceMap = null;
@ -96,6 +99,8 @@ public class FpdModuleSA extends JDialog implements ActionListener {
private JTextField jTextField2 = null; private JTextField jTextField2 = null;
private JScrollPane jScrollPane6 = null; private JScrollPane jScrollPane6 = null;
private JTable jTable4 = null; private JTable jTable4 = null;
private JButton jButton4 = null;
private JButton jButton5 = null;
/** /**
* This is the default constructor * This is the default constructor
*/ */
@ -150,6 +155,21 @@ public class FpdModuleSA extends JDialog implements ActionListener {
// display library classes that need to be resolved. also potential instances for them. // display library classes that need to be resolved. also potential instances for them.
// //
resolveLibraryInstances(key); resolveLibraryInstances(key);
//
// display module SA options
//
String fvBinding = ffc.getFvBinding(key);
if (fvBinding != null) {
jTextField.setText(fvBinding);
}
String fileGuid = ffc.getFfsFileNameGuid(key);
if (fileGuid != null) {
jTextField1.setText(fileGuid);
}
String ffsKey = ffc.getFfsFormatKey(key);
if (ffsKey != null) {
jTextField2.setText(ffsKey);
}
} }
private void resolveLibraryInstances(String key) { private void resolveLibraryInstances(String key) {
@ -995,6 +1015,8 @@ public class FpdModuleSA extends JDialog implements ActionListener {
jPanel8.add(jLabel8, null); jPanel8.add(jLabel8, null);
jPanel8.add(getJTextField2(), null); jPanel8.add(getJTextField2(), null);
jPanel8.add(getJScrollPane6(), null); jPanel8.add(getJScrollPane6(), null);
jPanel8.add(getJButton4(), null);
jPanel8.add(getJButton5(), null);
} }
return jPanel8; return jPanel8;
} }
@ -1007,6 +1029,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTextField == null) { if (jTextField == null) {
jTextField = new JTextField(); jTextField = new JTextField();
jTextField.setPreferredSize(new java.awt.Dimension(100,20)); jTextField.setPreferredSize(new java.awt.Dimension(100,20));
jTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
ffc.setFvBinding(moduleKey, jTextField.getText());
}
});
} }
return jTextField; return jTextField;
} }
@ -1019,6 +1046,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTextField1 == null) { if (jTextField1 == null) {
jTextField1 = new JTextField(); jTextField1 = new JTextField();
jTextField1.setPreferredSize(new java.awt.Dimension(100,20)); jTextField1.setPreferredSize(new java.awt.Dimension(100,20));
jTextField1.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
ffc.setFfsFileNameGuid(moduleKey, jTextField1.getText());
}
});
} }
return jTextField1; return jTextField1;
} }
@ -1031,6 +1063,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTextField2 == null) { if (jTextField2 == null) {
jTextField2 = new JTextField(); jTextField2 = new JTextField();
jTextField2.setPreferredSize(new java.awt.Dimension(100,20)); jTextField2.setPreferredSize(new java.awt.Dimension(100,20));
jTextField2.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
ffc.setFfsFormatKey(moduleKey, jTextField2.getText());
}
});
} }
return jTextField2; return jTextField2;
} }
@ -1054,10 +1091,96 @@ public class FpdModuleSA extends JDialog implements ActionListener {
*/ */
private JTable getJTable4() { private JTable getJTable4() {
if (jTable4 == null) { if (jTable4 == null) {
jTable4 = new JTable(); optionsTableModel = new DefaultTableModel();
optionsTableModel.addColumn("BuildTargets");
optionsTableModel.addColumn("ToolChainFamily");
optionsTableModel.addColumn("TagName");
optionsTableModel.addColumn("ToolCode");
optionsTableModel.addColumn("SupportedArchs");
optionsTableModel.addColumn("Contents");
jTable4 = new JTable(optionsTableModel);
jTable4.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable4.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent arg0) {
// TODO Auto-generated method stub
int row = arg0.getFirstRow();
TableModel m = (TableModel)arg0.getSource();
if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check.
String targets = m.getValueAt(row, 0) + "";
Vector<Object> targetName = new Vector<Object>();
String[] sArray = targets.split(" ");
for (int i = 0; i < sArray.length; ++i) {
targetName.add(sArray[i]);
}
String toolChain = m.getValueAt(row, 1) + "";
String tagName = m.getValueAt(row, 2) + "";
String toolCode = m.getValueAt(row, 3) + "";
String archs = m.getValueAt(row, 4) + "";
Vector<Object> supArch = new Vector<Object>();
String[] sArray1 = archs.split(" ");
for (int i = 0; i < sArray1.length; ++i) {
supArch.add(sArray1[i]);
}
if (supArch.size() == 0) {
supArch.add("IA32");
}
String contents = m.getValueAt(row, 5) + "";
ffc.updateModuleSAOptionsOpt(moduleKey, row, targetName, toolChain, tagName, toolCode, supArch, contents);
}
}
});
} }
return jTable4; return jTable4;
} }
/**
* This method initializes jButton4
*
* @return javax.swing.JButton
*/
private JButton getJButton4() {
if (jButton4 == null) {
jButton4 = new JButton();
jButton4.setPreferredSize(new java.awt.Dimension(80,20));
jButton4.setText("New");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
String[] row = {"", "", "", "", "IA32", ""};
optionsTableModel.addRow(row);
Vector<Object> v = new Vector<Object>();
Vector<Object> v1 = new Vector<Object>();
v1.add("IA32");
ffc.genModuleSAOptionsOpt(moduleKey, v, "", "", "", v1, "");
}
});
}
return jButton4;
}
/**
* This method initializes jButton5
*
* @return javax.swing.JButton
*/
private JButton getJButton5() {
if (jButton5 == null) {
jButton5 = new JButton();
jButton5.setPreferredSize(new java.awt.Dimension(80,20));
jButton5.setText("Delete");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (jTable4.getSelectedRow() < 0) {
return;
}
ffc.removeModuleSAOptionsOpt(moduleKey, jTable4.getSelectedRow());
optionsTableModel.removeRow(jTable4.getSelectedRow());
}
});
}
return jButton5;
}
} // @jve:decl-index=0:visual-constraint="10,10" } // @jve:decl-index=0:visual-constraint="10,10"