summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-25 01:44:06 +0000
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-08-25 01:44:06 +0000
commit2e482fb5d525d71f4457c3996150255b85d670e2 (patch)
treece257ea1e29014f46036df7d7e7471d88d14e001
parent3658f95e1a73626ff1cdb9cde3676ebc1edc3523 (diff)
downloadedk2-platforms-2e482fb5d525d71f4457c3996150255b85d670e2.tar.xz
Started cleaning up the Build Options screen so that we can add some additional information for the command line arguments that need to be put into the <BuildOptions><Options><Option> lines.
Re-ordered the content in the file, removed the layout from the Options tab. No changes to functionality were made, just look & feel. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1384 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java2110
1 files changed, 1182 insertions, 928 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
index f292d38c1c..257699915b 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
@@ -15,6 +15,7 @@
package org.tianocore.frameworkwizard.platform.ui;
import java.awt.BorderLayout;
+import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
@@ -48,6 +49,7 @@ import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
+import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import java.io.File;
import java.util.ArrayList;
@@ -60,154 +62,307 @@ import javax.swing.JSplitPane;
public class FpdBuildOptions extends IInternalFrame {
+ private final int oneRowHeight = 20;
+
+ private final int twoRowHeight = 40;
+
+ private final int threeRowHeight = 60;
+
+ private final int sepHeight = 6;
+
+ private final int sepWidth = 10;
+
+ private final int buttonWidth = 90;
+
+ private final int rowOne = 12;
+
+ private final int dialogWidth = 600;
+
+ private final int rowTwo = rowOne + oneRowHeight + sepHeight;
+
+ private final int rowThree = rowTwo + oneRowHeight + sepHeight;
+
+ private final int rowFour = rowThree + oneRowHeight + sepHeight;
+
+ private final int rowFive = rowFour + oneRowHeight + sepHeight;
+
+ private final int rowSix = rowFive + oneRowHeight + sepHeight;
+
+ private final int rowSeven = rowSix + oneRowHeight + sepHeight;
+
+ private final int buttonRow = rowSeven + oneRowHeight + sepHeight + sepHeight;
+
+ private final int dialogHeight = buttonRow + twoRowHeight + twoRowHeight;
+
+ private final int lastButtonXLoc = dialogWidth - buttonWidth - sepWidth;
+
+ private final int next2LastButtonLoc = lastButtonXLoc - buttonWidth - sepWidth;
+
+ private final int firstButtonLoc = next2LastButtonLoc - buttonWidth - sepWidth;
+
+ private final int starColumn = 2;
+
+ private final int labelColumn = 12;
+
+ private final int fieldColumn = 168;
+
+ private final int labelWidth = 155;
+
+ private final int fieldWidth = 320;
+
private static final long serialVersionUID = 1L;
+
static JFrame frame;
+
private JPanel jContentPane = null;
- private JPanel jPanelContentSouth = null;
- private JPanel jPanelContentNorth = null;
- private JPanel jPanelContentWest = null;
- private JPanel jPanelContentEast = null;
+
+ // private JPanel jPanelContentSouth = null;
+
+ // private JPanel jPanelContentNorth = null;
+
+ // private JPanel jPanelContentWest = null;
+
+ // private JPanel jPanelContentEast = null;
+
private JTabbedPane jTabbedPane = null;
+
private JPanel jPanelUserDef = null;
+
private JPanel jPanelUserDefNorth = null;
+
private JPanel jPanelUserDefCenter = null;
+
private JTextField jTextFieldAntTaskFile = null;
+
private JLabel jLabelAntTaskId = null;
+
private JTextField jTextFieldAntTaskId = null;
+
private JButton jButtonAntTaskAdd = null;
+
private JButton jButtonAntTaskDel = null;
+
private JTextField jTextFieldAntCmdOpts = null;
+
private JScrollPane jScrollPaneAntTasks = null;
+
private JTable jTableAntTasks = null;
+
private DefaultTableModel ffsTableModel = null;
+
private DefaultTableModel sectionsTableModel = null;
+
private DefaultTableModel sectionTableModel = null;
+
private DefaultTableModel subsectionsTableModel = null;
+
private DefaultTableModel antTaskTableModel = null;
+
private DefaultTableModel ffsAttributesTableModel = null;
+
private DefaultTableModel optionsTableModel = null;
+
private JPanel jPanelFfsTab = null;
+
private JPanel jPanelFfsTabCenter = null;
+
private JPanel jPanelFfsTabCenterN = null;
+
private JPanel jPanelFfsTabCenterS = null;
+
private JLabel jLabelFfsKey = null;
+
private JTextField jTextFieldFfsKey = null;
+
private JButton jButtonFfsAdd = null;
+
private JButton jButtonFfsDel = null;
+
private JScrollPane jScrollPaneFfsAttribs = null;
+
private JTable jTableFfsAttribs = null;
+
private JPanel jPanelOptionsTab = null;
+
private JLabel jLabelOptionContents = null;
+
private JTextField jTextFieldOptionContents = null;
+
private JLabel jLabelToolChainFamily = null;
+
private JLabel jLabelSupArch = null;
+
private JLabel jLabelToolCmd = null;
+
private JTextField jTextFieldToolCmd = null;
+
private JScrollPane jScrollPaneOptions = null;
+
private JTable jTableOptions = null;
+
+ private JLabel jTitle = null;
+
private JButton jButtonOptionsAdd = null;
+
private JButton jButtonOptionsDel = null;
+
private JButton jButtonFfsAttribNew = null;
+
private JButton jButtonFfsAttribRemove = null;
+
private FpdFileContents ffc = null;
+
private OpeningPlatformType docConsole = null;
+
+ private JPanel jArchitectureSelections = null;
+
private JCheckBox jCheckBoxIA32 = null;
+
private JCheckBox jCheckBoxIpf = null;
+
private JCheckBox jCheckBoxX64 = null;
+
private JCheckBox jCheckBoxEBC = null;
+
private JCheckBox jCheckBoxARM = null;
+
private JCheckBox jCheckBoxPPC = null;
+
private JLabel jLabelBuildTargets = null;
+
private JTextField jTextFieldBuildTargets = null;
+
private JTextField jTextFieldTagName = null;
+
private JLabel jLabelTagName = null;
+
private int selectedRow = -1;
+
private JLabel jLabelAntTaskFile = null;
+
private JLabel jLabelAntCmdOpts = null;
+
private JScrollPane jScrollPaneFfs = null;
+
private JTable jTableFfs = null;
+
private JLabel jLabelFfsSection = null;
+
private JScrollPane jScrollPaneFfsSection = null;
+
private JTable jTableFfsSection = null;
+
private JLabel jLabelFfsSubSections = null;
+
private JScrollPane jScrollPaneFfsSubSection = null;
+
private JTable jTableFfsSubSection = null;
+
private JLabel jLabelEncapType = null;
+
private JTextField jTextFieldEncapType = null;
+
private JPanel jPanelFfsAttribButtonGroup = null;
+
private JLabel jLabelFfsAttribs = null;
+
private JButton jButtonFfsSectionNew = null;
+
private JButton jButtonFfsSectionRemove = null;
+
private JButton jButtonFfsSubSectionNew = null;
+
private JButton jButtonFfsSubSectionRemove = null;
+
private JLabel jLabelFfsSections = null;
+
private JButton jButtonFfsSectionsNew = null;
+
private JButton jButtonFfsSectionsRemove = null;
+
private JScrollPane jScrollPaneFfsSections = null;
+
private JTable jTableFfsSections = null;
+
private JButton jButtonAntTaskFileBrowse = null;
+
private JTextField jTextFieldToolChainFamily = null;
+
private JSplitPane jSplitPaneFfsC = null;
+
private JPanel jPanelFfsCTop = null;
+
private JSplitPane jSplitPaneFfsCBottom = null;
+
private JPanel jPanelFfsCBottomTop = null;
+
private JPanel jPanelFfsCBottomBottom = null;
+
private JPanel jPanelSectionN = null;
+
private JPanel jPanelSectionC = null;
+
private JPanel jPanelSectionsN = null;
+
private JPanel jPanelSectionsC = null;
+
private JPanel jPanelSubSectionN = null;
+
private JPanel jPanelSubSectionC = null;
+
private JPanel jPanelOptionsContainer = null;
+
private JPanel jPanelUserDefCenterN = null;
+
private JPanel jPanelUserDefCenterC = null;
+
/**
* This method initializes jPanel
*
* @return javax.swing.JPanel
+ private JPanel getJPanelContentSouth() {
+ if (jPanelContentSouth == null) {
+ jPanelContentSouth = new JPanel();
+ }
+ return jPanelContentSouth;
+ }
*/
- private JPanel getJPanelContentSouth() {
- if (jPanelContentSouth == null) {
- jPanelContentSouth = new JPanel();
- }
- return jPanelContentSouth;
- }
/**
* This method initializes jPanel1
*
* @return javax.swing.JPanel
+ private JPanel getJPanelContentNorth() {
+ if (jPanelContentNorth == null) {
+ jPanelContentNorth = new JPanel();
+ }
+ return jPanelContentNorth;
+ }
*/
- private JPanel getJPanelContentNorth() {
- if (jPanelContentNorth == null) {
- jPanelContentNorth = new JPanel();
- }
- return jPanelContentNorth;
- }
/**
* This method initializes jPanel2
*
* @return javax.swing.JPanel
+ private JPanel getJPanelContentWest() {
+ if (jPanelContentWest == null) {
+ jPanelContentWest = new JPanel();
+ }
+ return jPanelContentWest;
+ }
*/
- private JPanel getJPanelContentWest() {
- if (jPanelContentWest == null) {
- jPanelContentWest = new JPanel();
- }
- return jPanelContentWest;
- }
/**
* This method initializes jPanel3
*
* @return javax.swing.JPanel
+ private JPanel getJPanelContentEast() {
+ if (jPanelContentEast == null) {
+ jPanelContentEast = new JPanel();
+ }
+ return jPanelContentEast;
+ }
*/
- private JPanel getJPanelContentEast() {
- if (jPanelContentEast == null) {
- jPanelContentEast = new JPanel();
- }
- return jPanelContentEast;
- }
/**
* This method initializes jTabbedPane
@@ -217,239 +372,96 @@ public class FpdBuildOptions extends IInternalFrame {
private JTabbedPane getJTabbedPane() {
if (jTabbedPane == null) {
jTabbedPane = new JTabbedPane();
- jTabbedPane.addTab("FFS", null, getJPanelFfsTab(), null);
- jTabbedPane.addTab("Options", null, getJPanelOptionsTab(), null);
+ jTabbedPane.addTab("Flash Filesystem Options", null, getJPanelFfsTab(), null);
+ jTabbedPane.addTab("Tool Arguments", null, getJPanelOptionsTab(), null);
jTabbedPane.addTab("User Defined ANT Tasks", null, getJPanelUserDef(), null);
}
return jTabbedPane;
}
-
/**
- * This method initializes jPanel8
- *
- * @return javax.swing.JPanel
+ * This method initializes this
+ *
+ * @return void
*/
- private JPanel getJPanelUserDef() {
- if (jPanelUserDef == null) {
- jPanelUserDef = new JPanel();
- jPanelUserDef.setLayout(new BorderLayout());
- jPanelUserDef.add(getJPanelUserDefNorth(), java.awt.BorderLayout.NORTH);
- jPanelUserDef.add(getJPanelUserDefCenter(), java.awt.BorderLayout.CENTER);
-
- }
- return jPanelUserDef;
+ private void initialize() {
+ this.setSize(722, 577);
+ this.setTitle("Platform Build Options");
+ this.setContentPane(getJContentPane());
}
/**
- * This method initializes jPanel9
- *
- * @return javax.swing.JPanel
+ * This method initializes jContentPane
+ *
+ * @return javax.swing.JPanel
*/
- private JPanel getJPanelUserDefNorth() {
- if (jPanelUserDefNorth == null) {
- jLabelAntTaskFile = new JLabel();
- jLabelAntTaskFile.setText("ANT Task File");
- jLabelAntTaskFile.setPreferredSize(new java.awt.Dimension(80,20));
- FlowLayout flowLayout8 = new FlowLayout();
- flowLayout8.setAlignment(java.awt.FlowLayout.CENTER);
- jLabelAntTaskId = new JLabel();
- jLabelAntTaskId.setText("ID");
- jPanelUserDefNorth = new JPanel();
- jPanelUserDefNorth.setLayout(flowLayout8);
- jPanelUserDefNorth.add(jLabelAntTaskFile, null);
- jPanelUserDefNorth.add(getJTextFieldAntTaskFile(), null);
- jPanelUserDefNorth.add(getJButtonAntTaskFileBrowse(), null);
- jPanelUserDefNorth.add(jLabelAntTaskId, null);
- jPanelUserDefNorth.add(getJTextFieldAntTaskId(), null);
+ private JPanel getJContentPane() {
+ if (jContentPane == null) {
+ jContentPane = new JPanel();
+ jContentPane.setLayout(new BorderLayout());
+ // jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
+ // jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
+ // jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
+ // jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
+ jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
}
- return jPanelUserDefNorth;
+ return jContentPane;
}
/**
- * This method initializes jPanel11
- *
- * @return javax.swing.JPanel
+ * @param args
*/
- private JPanel getJPanelUserDefCenter() {
- if (jPanelUserDefCenter == null) {
- jLabelAntCmdOpts = new JLabel();
- jLabelAntCmdOpts.setText("ANT Command Options");
- jLabelAntCmdOpts.setPreferredSize(new java.awt.Dimension(131,20));
- jPanelUserDefCenter = new JPanel();
- jPanelUserDefCenter.setLayout(new BorderLayout());
-
- jPanelUserDefCenter.add(getJPanelUserDefCenterN(), java.awt.BorderLayout.NORTH);
- jPanelUserDefCenter.add(getJPanelUserDefCenterC(), java.awt.BorderLayout.CENTER);
- }
- return jPanelUserDefCenter;
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+ new FpdBuildOptions().setVisible(true);
}
/**
- * This method initializes jTextField2
- *
- * @return javax.swing.JTextField
+ * This is the default constructor
*/
- private JTextField getJTextFieldAntTaskFile() {
- if (jTextFieldAntTaskFile == null) {
- jTextFieldAntTaskFile = new JTextField();
- jTextFieldAntTaskFile.setPreferredSize(new java.awt.Dimension(200,20));
- }
- return jTextFieldAntTaskFile;
+ public FpdBuildOptions() {
+ super();
+ initialize();
+ this.setVisible(true);
}
- /**
- * This method initializes jTextField3
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldAntTaskId() {
- if (jTextFieldAntTaskId == null) {
- jTextFieldAntTaskId = new JTextField();
- jTextFieldAntTaskId.setPreferredSize(new java.awt.Dimension(100,20));
- }
- return jTextFieldAntTaskId;
+ public FpdBuildOptions(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
+ this();
+ ffc = new FpdFileContents(fpd);
+ init(ffc);
}
- /**
- * This method initializes jButton4
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAntTaskAdd() {
- if (jButtonAntTaskAdd == null) {
- jButtonAntTaskAdd = new JButton();
- jButtonAntTaskAdd.setPreferredSize(new java.awt.Dimension(90,20));
- jButtonAntTaskAdd.setText("Add");
- jButtonAntTaskAdd.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (!DataValidation.isInt(jTextFieldAntTaskId.getText()) || jTextFieldAntTaskId.getText().length() != 8) {
- JOptionPane.showMessageDialog(frame, "ID must be an 8-digit integer.");
- return;
- }
- Object[] o = {jTextFieldAntTaskId.getText(), null, null};
- o[1] = jTextFieldAntTaskFile.getText();
- o[2] = jTextFieldAntCmdOpts.getText();
- ffc.genBuildOptionsUserDefAntTask(o[0]+"", o[1]+"", o[2]+"");
- antTaskTableModel.addRow(o);
- docConsole.setSaved(false);
- }
- });
- }
- return jButtonAntTaskAdd;
+ public FpdBuildOptions(OpeningPlatformType opt) {
+ this(opt.getXmlFpd());
+ docConsole = opt;
}
- /**
- * This method initializes jButton5
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAntTaskDel() {
- if (jButtonAntTaskDel == null) {
- jButtonAntTaskDel = new JButton();
- jButtonAntTaskDel.setPreferredSize(new java.awt.Dimension(90,20));
- jButtonAntTaskDel.setText("Delete");
- jButtonAntTaskDel.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (selectedRow >= 0) {
- docConsole.setSaved(false);
- antTaskTableModel.removeRow(selectedRow);
- ffc.removeBuildOptionsUserDefAntTask(selectedRow);
- }
+ private void init(FpdFileContents ffc) {
+ initOptionTable();
+ initAntTaskTable();
+ initFfsTable();
+ this.addInternalFrameListener(new InternalFrameAdapter() {
+ public void internalFrameDeactivated(InternalFrameEvent e) {
+ if (jTableFfs.isEditing()) {
+ jTableFfs.getCellEditor().stopCellEditing();
}
- });
- }
- return jButtonAntTaskDel;
- }
-
- /**
- * This method initializes jTextField4
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldAntCmdOpts() {
- if (jTextFieldAntCmdOpts == null) {
- jTextFieldAntCmdOpts = new JTextField();
- jTextFieldAntCmdOpts.setPreferredSize(new java.awt.Dimension(270,20));
- jTextFieldAntCmdOpts.setEnabled(true);
- }
- return jTextFieldAntCmdOpts;
- }
-
- /**
- * This method initializes jScrollPane2
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneAntTasks() {
- if (jScrollPaneAntTasks == null) {
- jScrollPaneAntTasks = new JScrollPane();
- jScrollPaneAntTasks.setPreferredSize(new java.awt.Dimension(600,400));
- jScrollPaneAntTasks.setViewportView(getJTableAntTasks());
- }
- return jScrollPaneAntTasks;
- }
-
- /**
- * This method initializes jTable2
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableAntTasks() {
- if (jTableAntTasks == null) {
- antTaskTableModel = new DefaultTableModel();
- jTableAntTasks = new JTable(antTaskTableModel);
- jTableAntTasks.setRowHeight(20);
- antTaskTableModel.addColumn("ID");
- antTaskTableModel.addColumn("Filename");
- antTaskTableModel.addColumn("ANT Command Options");
-
- jTableAntTasks.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableAntTasks.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- selectedRow = -1;
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
- }
+ if (jTableFfsSection.isEditing()) {
+ jTableFfsSection.getCellEditor().stopCellEditing();
}
- });
-
- jTableAntTasks.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 id = m.getValueAt(row, 0) + "";
- String file = m.getValueAt(row, 1) + "";
- String execOrder = m.getValueAt(row, 2) + "";
- if (id.length() == 0) {
- return;
- }
- if (file.length() == 0 && execOrder.length() == 0){
- return;
- }
- if (file.length() == 0) {
- file = null;
- }
- if (execOrder.length() == 0) {
- execOrder = null;
- }
- ffc.updateBuildOptionsUserDefAntTask(row, id, file, execOrder);
-
- }
+ if (jTableAntTasks.isEditing()) {
+ jTableAntTasks.getCellEditor().stopCellEditing();
}
- });
- }
- return jTableAntTasks;
+ if (jTableFfsSubSection.isEditing()) {
+ jTableFfsSubSection.getCellEditor().stopCellEditing();
+ }
+ if (jTableFfsAttribs.isEditing()) {
+ jTableFfsAttribs.getCellEditor().stopCellEditing();
+ }
+ if (jTableOptions.isEditing()) {
+ jTableOptions.getCellEditor().stopCellEditing();
+ }
+ }
+ });
}
/**
@@ -522,7 +534,7 @@ public class FpdBuildOptions extends IInternalFrame {
flowLayout6.setVgap(20);
flowLayout6.setAlignment(java.awt.FlowLayout.CENTER);
jPanelFfsTabCenterS = new JPanel();
- jPanelFfsTabCenterS.setPreferredSize(new java.awt.Dimension(491,130));
+ jPanelFfsTabCenterS.setPreferredSize(new java.awt.Dimension(491, 130));
jPanelFfsTabCenterS.setLayout(flowLayout6);
jPanelFfsTabCenterS.add(jLabelFfsAttribs, null);
jPanelFfsTabCenterS.add(getJScrollPaneFfsAttribs(), null);
@@ -539,14 +551,14 @@ public class FpdBuildOptions extends IInternalFrame {
private JTextField getJTextFieldFfsKey() {
if (jTextFieldFfsKey == null) {
jTextFieldFfsKey = new JTextField();
- jTextFieldFfsKey.setPreferredSize(new java.awt.Dimension(100,20));
+ jTextFieldFfsKey.setPreferredSize(new java.awt.Dimension(100, 20));
jTextFieldFfsKey.setEditable(true);
jTextFieldFfsKey.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
if (jTableFfs.getSelectedRow() < 0) {
return;
}
-// ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());
+ // ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());
}
});
}
@@ -561,7 +573,7 @@ public class FpdBuildOptions extends IInternalFrame {
private JButton getJButtonFfsAdd() {
if (jButtonFfsAdd == null) {
jButtonFfsAdd = new JButton();
- jButtonFfsAdd.setPreferredSize(new java.awt.Dimension(70,20));
+ jButtonFfsAdd.setPreferredSize(new java.awt.Dimension(70, 20));
jButtonFfsAdd.setText("Add");
jButtonFfsAdd.addActionListener(new AbstractAction() {
/**
@@ -571,7 +583,7 @@ public class FpdBuildOptions extends IInternalFrame {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (jTextFieldFfsKey.getText().length() > 0) {
- String[] row = {jTextFieldFfsKey.getText()};
+ String[] row = { jTextFieldFfsKey.getText() };
ffsTableModel.addRow(row);
docConsole.setSaved(false);
ffc.genBuildOptionsFfs(jTextFieldFfsKey.getText(), jTextFieldEncapType.getText());
@@ -590,7 +602,7 @@ public class FpdBuildOptions extends IInternalFrame {
private JButton getJButtonFfsDel() {
if (jButtonFfsDel == null) {
jButtonFfsDel = new JButton();
- jButtonFfsDel.setPreferredSize(new java.awt.Dimension(70,20));
+ jButtonFfsDel.setPreferredSize(new java.awt.Dimension(70, 20));
jButtonFfsDel.setText("Delete");
jButtonFfsDel.addActionListener(new AbstractAction() {
/**
@@ -598,7 +610,7 @@ public class FpdBuildOptions extends IInternalFrame {
*/
private static final long serialVersionUID = -4002678939178194476L;
- public void actionPerformed(ActionEvent arg0){
+ public void actionPerformed(ActionEvent arg0) {
if (jTableFfs.getSelectedRow() < 0) {
return;
}
@@ -619,7 +631,7 @@ public class FpdBuildOptions extends IInternalFrame {
private JScrollPane getJScrollPaneFfsAttribs() {
if (jScrollPaneFfsAttribs == null) {
jScrollPaneFfsAttribs = new JScrollPane();
- jScrollPaneFfsAttribs.setPreferredSize(new java.awt.Dimension(350,100));
+ jScrollPaneFfsAttribs.setPreferredSize(new java.awt.Dimension(350, 100));
jScrollPaneFfsAttribs.setViewportView(getJTableFfsAttribs());
}
return jScrollPaneFfsAttribs;
@@ -634,26 +646,26 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTableFfsAttribs == null) {
ffsAttributesTableModel = new DefaultTableModel();
jTableFfsAttribs = new JTable(ffsAttributesTableModel);
- jTableFfsAttribs.setPreferredSize(new java.awt.Dimension(400,80));
+ jTableFfsAttribs.setPreferredSize(new java.awt.Dimension(400, 80));
jTableFfsAttribs.setRowHeight(20);
ffsAttributesTableModel.addColumn("Name");
ffsAttributesTableModel.addColumn("Value");
-
+
jTableFfsAttribs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTableFfsAttribs.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){
+ TableModel m = (TableModel) arg0.getSource();
+ if (arg0.getType() == TableModelEvent.UPDATE) {
//ToDo Data Validition check.
String name = m.getValueAt(row, 0) + "";
String value = m.getValueAt(row, 1) + "";
-
+
if (name.length() == 0) {
return;
}
- if (value.length() == 0){
+ if (value.length() == 0) {
return;
}
docConsole.setSaved(false);
@@ -665,267 +677,27 @@ public class FpdBuildOptions extends IInternalFrame {
return jTableFfsAttribs;
}
- /**
- * This method initializes jPanel20
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelOptionsTab() {
- if (jPanelOptionsTab == null) {
- jLabelTagName = new JLabel();
- jLabelTagName.setText("Tag Name");
- FlowLayout flowLayout9 = new FlowLayout();
- flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
- jLabelBuildTargets = new JLabel();
- jLabelBuildTargets.setText("Build Targets");
- jLabelToolCmd = new JLabel();
- jLabelToolCmd.setText("Tool Command");
- jLabelSupArch = new JLabel();
- jLabelSupArch.setText("Supported Arch");
- jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setText("Tool Chain Family");
- jLabelOptionContents = new JLabel();
- jLabelOptionContents.setText("Option Contents");
- jPanelOptionsTab = new JPanel();
- jPanelOptionsTab.setLayout(flowLayout9);
- jPanelOptionsTab.add(getJPanelOptionsContainer(), null);
- jPanelOptionsTab.add(getJScrollPaneOptions(), null);
-
- }
- return jPanelOptionsTab;
- }
-
- /**
- * This method initializes jTextField7
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldOptionContents() {
- if (jTextFieldOptionContents == null) {
- jTextFieldOptionContents = new JTextField();
- jTextFieldOptionContents.setPreferredSize(new java.awt.Dimension(300,20));
- }
- return jTextFieldOptionContents;
- }
-
- /**
- * This method initializes jTextField8
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolCmd() {
- if (jTextFieldToolCmd == null) {
- jTextFieldToolCmd = new JTextField();
- jTextFieldToolCmd.setPreferredSize(new java.awt.Dimension(110,20));
- }
- return jTextFieldToolCmd;
- }
-
- /**
- * This method initializes jScrollPane6
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneOptions() {
- if (jScrollPaneOptions == null) {
- jScrollPaneOptions = new JScrollPane();
- jScrollPaneOptions.setPreferredSize(new java.awt.Dimension(650,400));
- jScrollPaneOptions.setViewportView(getJTableOptions());
- }
- return jScrollPaneOptions;
- }
-
- /**
- * This method initializes jTable5
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableOptions() {
- if (jTableOptions == null) {
- optionsTableModel = new DefaultTableModel();
- jTableOptions = new JTable(optionsTableModel);
- jTableOptions.setRowHeight(20);
- optionsTableModel.addColumn("BuildTargets");
- optionsTableModel.addColumn("ToolChainFamily");
- optionsTableModel.addColumn("SupportedArch");
- optionsTableModel.addColumn("ToolCommand");
- optionsTableModel.addColumn("TagName");
- optionsTableModel.addColumn("Contents");
-
-// TableColumn toolFamilyCol = jTable5.getColumnModel().getColumn(1);
-// JComboBox cb = new JComboBox();
-// cb.addItem("MSFT");
-// cb.addItem("GCC");
-// cb.addItem("CYGWIN");
-// cb.addItem("INTEL");
-// toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
- Vector<String> vArch = new Vector<String>();
- vArch.add("IA32");
- vArch.add("X64");
- vArch.add("IPF");
- vArch.add("EBC");
- vArch.add("ARM");
- vArch.add("PPC");
- jTableOptions.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch));
- jTableOptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- selectedRow = -1;
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTableOptions.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 archs = m.getValueAt(row, 2) + "";
- Vector<Object> supArch = null;
- if (archs.length() > 0) {
- supArch = new Vector<Object>();
- String[] sArray1 = archs.split("( )+");
- for (int i = 0; i < sArray1.length; ++i) {
- supArch.add(sArray1[i]);
- }
- }
-
- String toolCmd = m.getValueAt(row, 3) + "";
- String tagName = m.getValueAt(row, 4) + "";
- String contents = m.getValueAt(row, 5) + "";
- docConsole.setSaved(false);
- ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);
- }
- }
- });
- }
- return jTableOptions;
- }
-
- /**
- * This method initializes jButton10
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOptionsAdd() {
- if (jButtonOptionsAdd == null) {
- jButtonOptionsAdd = new JButton();
- jButtonOptionsAdd.setText("Add");
- jButtonOptionsAdd.setPreferredSize(new java.awt.Dimension(90,20));
- jButtonOptionsAdd.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- boolean[] boolArray = {jCheckBoxIA32.isSelected(),jCheckBoxIpf.isSelected(),jCheckBoxX64.isSelected(),
- jCheckBoxEBC.isSelected(),jCheckBoxARM.isSelected(),jCheckBoxPPC.isSelected()};
- String s = boolToList(boolArray);
- Object[] o = {jTextFieldBuildTargets.getText(), jTextFieldToolChainFamily.getText(), s,
- jTextFieldToolCmd.getText(), jTextFieldTagName.getText(), jTextFieldOptionContents.getText()};
- optionsTableModel.addRow(o);
- docConsole.setSaved(false);
- ffc.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets.getText()), jTextFieldToolChainFamily.getText(), jTextFieldTagName.getText(), jTextFieldToolCmd.getText(), stringToVector(s), jTextFieldOptionContents.getText());
- }
- });
- }
- return jButtonOptionsAdd;
- }
-
- private Vector<Object> stringToVector(String s) {
- String[] sArray = s.split(" ");
- Vector<Object> v = null;
- if (s.length() > 0) {
- v = new Vector<Object>();
- for (int i = 0; i < sArray.length; ++i) {
- v.add(sArray[i]);
- }
- }
- return v;
- }
-
- private String boolToList (boolean[] bool) {
- String s = " ";
- if (bool[0]) {
- s += "IA32 ";
- }
- if (bool[1]) {
- s += "IPF ";
- }
- if (bool[2]) {
- s += "X64 ";
- }
- if (bool[3]) {
- s += "EBC ";
- }
- if (bool[4]) {
- s += "ARM ";
- }
- if (bool[5]) {
- s += "PPC ";
- }
- if (s == " ") {
- s += "IA32";
+ private void initFfsTable() {
+ int ffsCount = ffc.getBuildOptionsFfsCount();
+ if (ffsCount < 0) {
+ return;
}
- return s.trim();
- }
-
- /**
- * This method initializes jButton11
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOptionsDel() {
- if (jButtonOptionsDel == null) {
- jButtonOptionsDel = new JButton();
- jButtonOptionsDel.setText("Delete");
- jButtonOptionsDel.setPreferredSize(new java.awt.Dimension(90,20));
- jButtonOptionsDel.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (selectedRow >= 0) {
- optionsTableModel.removeRow(selectedRow);
- docConsole.setSaved(false);
- ffc.removeBuildOptionsOpt(selectedRow);
- }
- }
- });
+ String[][] saa = new String[ffsCount][1];
+ ffc.getBuildOptionsFfsKey(saa);
+ for (int i = 0; i < saa.length; ++i) {
+ ffsTableModel.addRow(saa[i]);
}
- return jButtonOptionsDel;
}
/**
- * This method initializes jButton17
- *
- * @return javax.swing.JButton
+ * This method initializes jButton17
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsAttribNew() {
if (jButtonFfsAttribNew == null) {
jButtonFfsAttribNew = new JButton();
- jButtonFfsAttribNew.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsAttribNew.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsAttribNew.setText("New");
jButtonFfsAttribNew.addActionListener(new AbstractAction() {
/**
@@ -933,11 +705,11 @@ public class FpdBuildOptions extends IInternalFrame {
*/
private static final long serialVersionUID = 1L;
- public void actionPerformed(ActionEvent arg0){
+ public void actionPerformed(ActionEvent arg0) {
if (jTableFfs.getSelectedRow() < 0) {
return;
}
- Object[] o = {"", ""};
+ Object[] o = { "", "" };
ffsAttributesTableModel.addRow(o);
docConsole.setSaved(false);
ffc.genBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), "", "");
@@ -948,29 +720,30 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton18
- *
- * @return javax.swing.JButton
+ * This method initializes jButton18
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsAttribRemove() {
if (jButtonFfsAttribRemove == null) {
jButtonFfsAttribRemove = new JButton();
- jButtonFfsAttribRemove.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsAttribRemove.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsAttribRemove.setText("Remove");
- jButtonFfsAttribRemove.addActionListener(new AbstractAction(){
+ jButtonFfsAttribRemove.addActionListener(new AbstractAction() {
/**
*
*/
private static final long serialVersionUID = 1L;
- public void actionPerformed(ActionEvent arg0){
+ public void actionPerformed(ActionEvent arg0) {
if (jTableFfs.getSelectedRow() < 0) {
return;
}
- if (jTableFfsAttribs.getSelectedRow() >= 0){
+ if (jTableFfsAttribs.getSelectedRow() >= 0) {
docConsole.setSaved(false);
ffsAttributesTableModel.removeRow(jTableFfsAttribs.getSelectedRow());
- ffc.removeBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), jTableFfsAttribs.getSelectedRow());
+ ffc.removeBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(),
+ jTableFfsAttribs.getSelectedRow());
}
}
});
@@ -979,133 +752,23 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jCheckBox9
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIA32() {
- if (jCheckBoxIA32 == null) {
- jCheckBoxIA32 = new JCheckBox();
- jCheckBoxIA32.setPreferredSize(new java.awt.Dimension(50,20));
- jCheckBoxIA32.setText("IA32");
- }
- return jCheckBoxIA32;
- }
-
- /**
- * This method initializes jCheckBox10
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setPreferredSize(new java.awt.Dimension(50,20));
- jCheckBoxIpf.setText("IPF");
- }
- return jCheckBoxIpf;
- }
-
- /**
- * This method initializes jCheckBox11
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setPreferredSize(new java.awt.Dimension(47,20));
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBox12
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxEBC() {
- if (jCheckBoxEBC == null) {
- jCheckBoxEBC = new JCheckBox();
- jCheckBoxEBC.setPreferredSize(new java.awt.Dimension(50,20));
- jCheckBoxEBC.setText("EBC");
- }
- return jCheckBoxEBC;
- }
-
- /**
- * This method initializes jCheckBox13
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxARM() {
- if (jCheckBoxARM == null) {
- jCheckBoxARM = new JCheckBox();
- jCheckBoxARM.setPreferredSize(new java.awt.Dimension(55,20));
- jCheckBoxARM.setText("ARM");
- }
- return jCheckBoxARM;
- }
-
- /**
- * This method initializes jCheckBox14
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPPC() {
- if (jCheckBoxPPC == null) {
- jCheckBoxPPC = new JCheckBox();
- jCheckBoxPPC.setPreferredSize(new java.awt.Dimension(50,20));
- jCheckBoxPPC.setText("PPC");
- }
- return jCheckBoxPPC;
- }
-
- /**
- * This method initializes jTextField12
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldBuildTargets() {
- if (jTextFieldBuildTargets == null) {
- jTextFieldBuildTargets = new JTextField();
- jTextFieldBuildTargets.setPreferredSize(new java.awt.Dimension(150,20));
- }
- return jTextFieldBuildTargets;
- }
-
- /**
- * This method initializes jTextField13
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTagName() {
- if (jTextFieldTagName == null) {
- jTextFieldTagName = new JTextField();
- jTextFieldTagName.setPreferredSize(new java.awt.Dimension(140,20));
- }
- return jTextFieldTagName;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
+ * This method initializes jScrollPane
+ *
+ * @return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPaneFfs() {
if (jScrollPaneFfs == null) {
jScrollPaneFfs = new JScrollPane();
- jScrollPaneFfs.setPreferredSize(new java.awt.Dimension(150,419));
+ jScrollPaneFfs.setPreferredSize(new java.awt.Dimension(150, 419));
jScrollPaneFfs.setViewportView(getJTableFfs());
}
return jScrollPaneFfs;
}
/**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
+ * This method initializes jTable
+ *
+ * @return javax.swing.JTable
*/
private JTable getJTableFfs() {
if (jTableFfs == null) {
@@ -1114,25 +777,24 @@ public class FpdBuildOptions extends IInternalFrame {
jTableFfs = new JTable(ffsTableModel);
jTableFfs.setShowGrid(false);
jTableFfs.setRowHeight(20);
-
+
jTableFfs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFfs.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
+ jTableFfs.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
-
- if (e.getValueIsAdjusting()){
+
+ if (e.getValueIsAdjusting()) {
return;
}
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
+ ListSelectionModel lsm = (ListSelectionModel) e.getSource();
if (lsm.isSelectionEmpty()) {
return;
- }
- else{
+ } else {
int row = lsm.getMinSelectionIndex();
sectionTableModel.setRowCount(0);
sectionsTableModel.setRowCount(0);
subsectionsTableModel.setRowCount(0);
ffsAttributesTableModel.setRowCount(0);
- String[] sArray = {"", ""};
+ String[] sArray = { "", "" };
LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
ArrayList<String> alSections = new ArrayList<String>();
ArrayList<String> alSection = new ArrayList<String>();
@@ -1140,36 +802,36 @@ public class FpdBuildOptions extends IInternalFrame {
jTextFieldFfsKey.setText(sArray[0]);
jTextFieldEncapType.setText(sArray[1]);
for (int i = 0; i < alSection.size(); ++i) {
- String[] sectionRow = {alSection.get(i)};
+ String[] sectionRow = { alSection.get(i) };
sectionTableModel.addRow(sectionRow);
}
for (int j = 0; j < alSections.size(); ++j) {
- String[] sectionsRow = {alSections.get(j)};
+ String[] sectionsRow = { alSections.get(j) };
sectionsTableModel.addRow(sectionsRow);
}
- if (lhm.size() <= 0 ) {
+ if (lhm.size() <= 0) {
return;
}
Set<String> keySet = lhm.keySet();
Iterator<String> is = keySet.iterator();
- while(is.hasNext()) {
+ while (is.hasNext()) {
String key = is.next();
- String[] attribRow = {key, lhm.get(key)};
+ String[] attribRow = { key, lhm.get(key) };
ffsAttributesTableModel.addRow(attribRow);
}
}
}
});
-
+
jTableFfs.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){
+ TableModel m = (TableModel) arg0.getSource();
+ if (arg0.getType() == TableModelEvent.UPDATE) {
//ToDo Data Validition check.
String id = m.getValueAt(row, 0) + "";
-
+
if (id.length() == 0) {
return;
}
@@ -1183,29 +845,29 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
+ * This method initializes jScrollPane1
+ *
+ * @return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPaneFfsSection() {
if (jScrollPaneFfsSection == null) {
jScrollPaneFfsSection = new JScrollPane();
- jScrollPaneFfsSection.setPreferredSize(new java.awt.Dimension(500,80));
+ jScrollPaneFfsSection.setPreferredSize(new java.awt.Dimension(500, 80));
jScrollPaneFfsSection.setViewportView(getJTableFfsSection());
}
return jScrollPaneFfsSection;
}
/**
- * This method initializes jTable1
- *
- * @return javax.swing.JTable
+ * This method initializes jTable1
+ *
+ * @return javax.swing.JTable
*/
private JTable getJTableFfsSection() {
if (jTableFfsSection == null) {
sectionTableModel = new DefaultTableModel();
sectionTableModel.addColumn("SectionType");
-
+
jTableFfsSection = new JTable(sectionTableModel);
jTableFfsSection.setRowHeight(20);
JComboBox cb = new JComboBox();
@@ -1223,9 +885,9 @@ public class FpdBuildOptions extends IInternalFrame {
cb.addItem("EFI_SECTION_COMPATIBILITY16");
cb.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
jTableFfsSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));
-
+
jTableFfsSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
+
jTableFfsSection.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent arg0) {
// TODO Auto-generated method stub
@@ -1233,12 +895,12 @@ public class FpdBuildOptions extends IInternalFrame {
return;
}
int row = arg0.getFirstRow();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
+ TableModel m = (TableModel) arg0.getSource();
+ if (arg0.getType() == TableModelEvent.UPDATE) {
//ToDo Data Validition check.
String type = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row, type);
+ ffc.updateBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row, type);
}
}
});
@@ -1247,23 +909,23 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jScrollPane3
- *
- * @return javax.swing.JScrollPane
+ * This method initializes jScrollPane3
+ *
+ * @return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPaneFfsSubSection() {
if (jScrollPaneFfsSubSection == null) {
jScrollPaneFfsSubSection = new JScrollPane();
- jScrollPaneFfsSubSection.setPreferredSize(new java.awt.Dimension(500,90));
+ jScrollPaneFfsSubSection.setPreferredSize(new java.awt.Dimension(500, 90));
jScrollPaneFfsSubSection.setViewportView(getJTableFfsSubSection());
}
return jScrollPaneFfsSubSection;
}
/**
- * This method initializes jTable3
- *
- * @return javax.swing.JTable
+ * This method initializes jTable3
+ *
+ * @return javax.swing.JTable
*/
private JTable getJTableFfsSubSection() {
if (jTableFfsSubSection == null) {
@@ -1287,7 +949,7 @@ public class FpdBuildOptions extends IInternalFrame {
cb.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
jTableFfsSubSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));
jTableFfsSubSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
+
jTableFfsSubSection.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent arg0) {
// TODO Auto-generated method stub
@@ -1295,12 +957,13 @@ public class FpdBuildOptions extends IInternalFrame {
return;
}
int row = arg0.getFirstRow();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
+ TableModel m = (TableModel) arg0.getSource();
+ if (arg0.getType() == TableModelEvent.UPDATE) {
//ToDo Data Validition check.
String type = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), row, type);
+ ffc.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(),
+ jTableFfsSections.getSelectedRow(), row, type);
}
}
});
@@ -1309,14 +972,14 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
+ * This method initializes jTextField
+ *
+ * @return javax.swing.JTextField
*/
private JTextField getJTextFieldEncapType() {
if (jTextFieldEncapType == null) {
jTextFieldEncapType = new JTextField();
- jTextFieldEncapType.setPreferredSize(new java.awt.Dimension(100,20));
+ jTextFieldEncapType.setPreferredSize(new java.awt.Dimension(100, 20));
jTextFieldEncapType.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
if (jTableFfs.getSelectedRow() < 0) {
@@ -1330,14 +993,14 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanel4
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelFfsAttribButtonGroup() {
if (jPanelFfsAttribButtonGroup == null) {
jPanelFfsAttribButtonGroup = new JPanel();
- jPanelFfsAttribButtonGroup.setPreferredSize(new java.awt.Dimension(100,100));
+ jPanelFfsAttribButtonGroup.setPreferredSize(new java.awt.Dimension(100, 100));
jPanelFfsAttribButtonGroup.add(getJButtonFfsAttribNew(), null);
jPanelFfsAttribButtonGroup.add(getJButtonFfsAttribRemove(), null);
}
@@ -1345,14 +1008,14 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
+ * This method initializes jButton
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsSectionNew() {
if (jButtonFfsSectionNew == null) {
jButtonFfsSectionNew = new JButton();
- jButtonFfsSectionNew.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsSectionNew.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsSectionNew.setText("New");
jButtonFfsSectionNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
@@ -1360,7 +1023,7 @@ public class FpdBuildOptions extends IInternalFrame {
return;
}
docConsole.setSaved(false);
- String[] row = {"EFI_SECTION_RAW"};
+ String[] row = { "EFI_SECTION_RAW" };
sectionTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row[0]);
}
@@ -1370,16 +1033,16 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton1
- *
- * @return javax.swing.JButton
+ * This method initializes jButton1
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsSectionRemove() {
if (jButtonFfsSectionRemove == null) {
jButtonFfsSectionRemove = new JButton();
- jButtonFfsSectionRemove.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsSectionRemove.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsSectionRemove.setText("Remove");
-
+
jButtonFfsSectionRemove.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (jTableFfs.getSelectedRow() < 0 || jTableFfsSection.getSelectedRow() < 0) {
@@ -1387,7 +1050,8 @@ public class FpdBuildOptions extends IInternalFrame {
}
docConsole.setSaved(false);
sectionTableModel.removeRow(jTableFfsSection.getSelectedRow());
- ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSection.getSelectedRow());
+ ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(),
+ jTableFfsSection.getSelectedRow());
}
});
}
@@ -1395,14 +1059,14 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
+ * This method initializes jButton2
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsSubSectionNew() {
if (jButtonFfsSubSectionNew == null) {
jButtonFfsSubSectionNew = new JButton();
- jButtonFfsSubSectionNew.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsSubSectionNew.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsSubSectionNew.setText("New");
jButtonFfsSubSectionNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
@@ -1410,10 +1074,11 @@ public class FpdBuildOptions extends IInternalFrame {
return;
}
docConsole.setSaved(false);
- String[] row = {"EFI_SECTION_RAW"};
+ String[] row = { "EFI_SECTION_RAW" };
subsectionsTableModel.addRow(row);
- ffc.genBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), row[0]);
-
+ ffc.genBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(),
+ jTableFfsSections.getSelectedRow(), row[0]);
+
}
});
}
@@ -1421,23 +1086,26 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton3
- *
- * @return javax.swing.JButton
+ * This method initializes jButton3
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsSubSectionRemove() {
if (jButtonFfsSubSectionRemove == null) {
jButtonFfsSubSectionRemove = new JButton();
- jButtonFfsSubSectionRemove.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsSubSectionRemove.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsSubSectionRemove.setText("Remove");
jButtonFfsSubSectionRemove.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0 || jTableFfsSubSection.getSelectedRow() < 0) {
+ if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0
+ || jTableFfsSubSection.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
subsectionsTableModel.removeRow(jTableFfsSubSection.getSelectedRow());
- ffc.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), jTableFfsSubSection.getSelectedRow());
+ ffc.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(),
+ jTableFfsSections.getSelectedRow(),
+ jTableFfsSubSection.getSelectedRow());
}
});
}
@@ -1445,14 +1113,14 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton6
- *
- * @return javax.swing.JButton
+ * This method initializes jButton6
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsSectionsNew() {
if (jButtonFfsSectionsNew == null) {
jButtonFfsSectionsNew = new JButton();
- jButtonFfsSectionsNew.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsSectionsNew.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsSectionsNew.setText("New");
jButtonFfsSectionsNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
@@ -1460,7 +1128,7 @@ public class FpdBuildOptions extends IInternalFrame {
return;
}
docConsole.setSaved(false);
- String[] row = {""};
+ String[] row = { "" };
sectionsTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), "");
}
@@ -1470,14 +1138,14 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton7
- *
- * @return javax.swing.JButton
+ * This method initializes jButton7
+ *
+ * @return javax.swing.JButton
*/
private JButton getJButtonFfsSectionsRemove() {
if (jButtonFfsSectionsRemove == null) {
jButtonFfsSectionsRemove = new JButton();
- jButtonFfsSectionsRemove.setPreferredSize(new java.awt.Dimension(80,20));
+ jButtonFfsSectionsRemove.setPreferredSize(new java.awt.Dimension(80, 20));
jButtonFfsSectionsRemove.setText("Remove");
jButtonFfsSectionsRemove.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
@@ -1486,31 +1154,27 @@ public class FpdBuildOptions extends IInternalFrame {
}
docConsole.setSaved(false);
sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow());
- ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow());
+ ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(),
+ jTableFfsSections.getSelectedRow());
}
});
}
return jButtonFfsSectionsRemove;
}
- /**
- * This method initializes jScrollPane4
- *
- * @return javax.swing.JScrollPane
- */
private JScrollPane getJScrollPaneFfsSections() {
if (jScrollPaneFfsSections == null) {
jScrollPaneFfsSections = new JScrollPane();
- jScrollPaneFfsSections.setPreferredSize(new java.awt.Dimension(500,80));
+ jScrollPaneFfsSections.setPreferredSize(new java.awt.Dimension(500, 80));
jScrollPaneFfsSections.setViewportView(getJTableFfsSections());
}
return jScrollPaneFfsSections;
}
/**
- * This method initializes jTable6
- *
- * @return javax.swing.JTable
+ * This method initializes jTable6
+ *
+ * @return javax.swing.JTable
*/
private JTable getJTableFfsSections() {
if (jTableFfsSections == null) {
@@ -1519,16 +1183,15 @@ public class FpdBuildOptions extends IInternalFrame {
jTableFfsSections = new JTable(sectionsTableModel);
jTableFfsSections.setRowHeight(20);
jTableFfsSections.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFfsSections.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
+ jTableFfsSections.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
+ if (e.getValueIsAdjusting()) {
return;
}
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
+ ListSelectionModel lsm = (ListSelectionModel) e.getSource();
if (lsm.isSelectionEmpty()) {
return;
- }
- else{
+ } else {
int sectionsRow = lsm.getMinSelectionIndex();
if (jTableFfs.getSelectedRow() < 0) {
return;
@@ -1537,19 +1200,19 @@ public class FpdBuildOptions extends IInternalFrame {
ArrayList<String> al = new ArrayList<String>();
ffc.getBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), sectionsRow, al);
for (int i = 0; i < al.size(); ++i) {
- String[] subsectionRow = {al.get(i)};
+ String[] subsectionRow = { al.get(i) };
subsectionsTableModel.addRow(subsectionRow);
}
}
}
});
-
+
jTableFfsSections.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){
+ TableModel m = (TableModel) arg0.getSource();
+ if (arg0.getType() == TableModelEvent.UPDATE) {
//ToDo Data Validition check.
String encapType = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
@@ -1562,70 +1225,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jButton12
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAntTaskFileBrowse() {
- if (jButtonAntTaskFileBrowse == null) {
- jButtonAntTaskFileBrowse = new JButton();
- jButtonAntTaskFileBrowse.setPreferredSize(new Dimension(90, 20));
- jButtonAntTaskFileBrowse.setText("Browse");
- jButtonAntTaskFileBrowse.addActionListener(new AbstractAction() {
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent arg0) {
- //
- // Select files from current workspace
- //
- String dirPrefix = System.getenv("WORKSPACE");
- JFileChooser chooser = new JFileChooser(dirPrefix);
- File theFile = null;
- String headerDest = null;
-
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- int retval = chooser.showOpenDialog(frame);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- theFile = chooser.getSelectedFile();
- String file = theFile.getPath();
- if (!file.startsWith(dirPrefix)) {
- JOptionPane.showMessageDialog(frame, "You can only select files in current package!");
- return;
- }
- }
- else {
- return;
- }
-
- headerDest = theFile.getPath();
- jTextFieldAntTaskFile.setText(headerDest.substring(dirPrefix.length()).replace('\\', '/'));
-
- }
-
- });
- }
- return jButtonAntTaskFileBrowse;
- }
-
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolChainFamily() {
- if (jTextFieldToolChainFamily == null) {
- jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(85,20));
- }
- return jTextFieldToolChainFamily;
- }
-
- /**
- * This method initializes jSplitPaneFfsC
- *
- * @return javax.swing.JSplitPane
+ * This method initializes jSplitPaneFfsC
+ *
+ * @return javax.swing.JSplitPane
*/
private JSplitPane getJSplitPaneFfsC() {
if (jSplitPaneFfsC == null) {
@@ -1640,9 +1242,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelFfsCTop
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelFfsCTop
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelFfsCTop() {
if (jPanelFfsCTop == null) {
@@ -1655,9 +1257,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jSplitPaneFfsCBottom
- *
- * @return javax.swing.JSplitPane
+ * This method initializes jSplitPaneFfsCBottom
+ *
+ * @return javax.swing.JSplitPane
*/
private JSplitPane getJSplitPaneFfsCBottom() {
if (jSplitPaneFfsCBottom == null) {
@@ -1672,9 +1274,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelFfsCBottomTop
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelFfsCBottomTop
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelFfsCBottomTop() {
if (jPanelFfsCBottomTop == null) {
@@ -1687,9 +1289,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelFfsCBottomBottom
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelFfsCBottomBottom
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelFfsCBottomBottom() {
if (jPanelFfsCBottomBottom == null) {
@@ -1702,9 +1304,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelSectionN
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelSectionN
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelSectionN() {
if (jPanelSectionN == null) {
@@ -1719,9 +1321,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelSectionC
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelSectionC
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelSectionC() {
if (jPanelSectionC == null) {
@@ -1732,9 +1334,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelSectionsN
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelSectionsN
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelSectionsN() {
if (jPanelSectionsN == null) {
@@ -1749,9 +1351,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelSectionsC
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelSectionsC
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelSectionsC() {
if (jPanelSectionsC == null) {
@@ -1762,9 +1364,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelSubSectionN
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelSubSectionN
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelSubSectionN() {
if (jPanelSubSectionN == null) {
@@ -1779,9 +1381,9 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelSubSectionC
- *
- * @return javax.swing.JPanel
+ * This method initializes jPanelSubSectionC
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelSubSectionC() {
if (jPanelSubSectionC == null) {
@@ -1792,35 +1394,99 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * This method initializes jPanelOptionsContainer
+ * The following section contains all Build Options content
+ */
+
+ /**
+ * This method initializes jPanelOptionsTab
*
- * @return javax.swing.JPanel
+ * This is the main Options screen
+ *
+ * @return javax.swing.JPanel jPanelOptionsTab
+ */
+ private JPanel getJPanelOptionsTab() {
+ if (jPanelOptionsTab == null) {
+ // This container holds the Options Tab content
+
+ // FlowLayout flowLayout9 = new FlowLayout();
+ // flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
+
+ jPanelOptionsTab = new JPanel();
+ jPanelOptionsTab.setBounds(new java.awt.Rectangle(0, 0, dialogWidth * 2, dialogHeight * 3));
+ jPanelOptionsTab.setPreferredSize(new java.awt.Dimension(dialogWidth + 10, (dialogHeight * 3) + 10));
+ jPanelOptionsTab.setAutoscrolls(true);
+ jPanelOptionsTab.setLocation(0, 0);
+ jPanelOptionsTab.setLayout(null);
+ jPanelOptionsTab.add(getJPanelOptionsContainer(), null);
+ jPanelOptionsTab.add(getJScrollPaneOptions(), null);
+
+ }
+ return jPanelOptionsTab;
+ }
+
+ /**
+ * This method initializes jPanelOptionsContainer
+ *
+ * @return javax.swing.JPanel
*/
private JPanel getJPanelOptionsContainer() {
if (jPanelOptionsContainer == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
+ jLabelTagName = new JLabel();
+ jLabelTagName.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
+ jLabelTagName.setLocation(new java.awt.Point(labelColumn, rowOne));
+ jLabelTagName.setText("Tag Name");
+ jLabelBuildTargets = new JLabel();
+ jLabelBuildTargets.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
+ jLabelBuildTargets.setLocation(new java.awt.Point(labelColumn, rowTwo));
+ jLabelBuildTargets.setText("Build Targets");
+ jLabelToolCmd = new JLabel();
+ jLabelToolCmd.setBounds(new java.awt.Rectangle(labelColumn, rowThree, labelWidth, oneRowHeight));
+ jLabelToolCmd.setLocation(new java.awt.Point(labelColumn, rowThree));
+ jLabelToolCmd.setText("Tool Command");
+ jLabelSupArch = new JLabel();
+ jLabelSupArch.setBounds(new java.awt.Rectangle(labelColumn, rowFour, labelWidth, oneRowHeight));
+ jLabelSupArch.setLocation(new java.awt.Point(labelColumn, rowFour));
+ jLabelSupArch.setText("Supported Architectures");
+ jLabelToolChainFamily = new JLabel();
+ jLabelToolChainFamily.setBounds(new java.awt.Rectangle(labelColumn, rowFive, labelWidth, oneRowHeight));
+ jLabelToolChainFamily.setLocation(new java.awt.Point(labelColumn, rowFive));
+ jLabelToolChainFamily.setText("Tool Chain Family");
+
+ jLabelOptionContents = new JLabel();
+ jLabelOptionContents.setBounds(new java.awt.Rectangle(labelColumn, rowSix, labelWidth, oneRowHeight));
+ jLabelOptionContents.setLocation(new java.awt.Point(labelColumn, rowSix));
+ jLabelOptionContents.setText("Option Contents");
+
jPanelOptionsContainer = new JPanel();
- jPanelOptionsContainer.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
- jPanelOptionsContainer.setLayout(flowLayout);
- jPanelOptionsContainer.setPreferredSize(new java.awt.Dimension(650,100));
+
+ jPanelOptionsContainer.setLayout(null);
+
+ jPanelOptionsContainer.setLocation(new java.awt.Point(2, 2));
+ jPanelOptionsContainer.setBounds(new java.awt.Rectangle(2, 2, dialogWidth * 2, dialogHeight));
+ jPanelOptionsContainer.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));
+ /*
+ jPanelOptionsContainer
+ .setBorder(javax.swing.BorderFactory
+ .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
+*/
+ jPanelOptionsContainer.add(jLabelTagName, null);
+ jPanelOptionsContainer.add(getJTextFieldTagName(), null);
+
jPanelOptionsContainer.add(jLabelBuildTargets, null);
jPanelOptionsContainer.add(getJTextFieldBuildTargets(), null);
+
jPanelOptionsContainer.add(jLabelToolChainFamily, null);
jPanelOptionsContainer.add(getJTextFieldToolChainFamily(), null);
+
jPanelOptionsContainer.add(jLabelToolCmd, null);
jPanelOptionsContainer.add(getJTextFieldToolCmd(), null);
+
jPanelOptionsContainer.add(jLabelSupArch, null);
- jPanelOptionsContainer.add(getJCheckBoxIA32(), null);
- jPanelOptionsContainer.add(getJCheckBoxIpf(), null);
- jPanelOptionsContainer.add(getJCheckBoxX64(), null);
- jPanelOptionsContainer.add(getJCheckBoxEBC(), null);
- jPanelOptionsContainer.add(getJCheckBoxARM(), null);
- jPanelOptionsContainer.add(getJCheckBoxPPC(), null);
- jPanelOptionsContainer.add(jLabelTagName, null);
- jPanelOptionsContainer.add(getJTextFieldTagName(), null);
+ jPanelOptionsContainer.add(getArchitectureSelections(), null);
+
jPanelOptionsContainer.add(jLabelOptionContents, null);
jPanelOptionsContainer.add(getJTextFieldOptionContents(), null);
+
jPanelOptionsContainer.add(getJButtonOptionsAdd(), null);
jPanelOptionsContainer.add(getJButtonOptionsDel(), null);
}
@@ -1828,6 +1494,475 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
+ * This method initializes jTextFieldOptionTagName Row 1
+ *
+ * @return javax.swing.JTextField
+ */
+ private JTextField getJTextFieldTagName() {
+ if (jTextFieldTagName == null) {
+ jTextFieldTagName = new JTextField();
+ jTextFieldTagName.setBounds(new java.awt.Rectangle(fieldColumn, rowOne, fieldWidth, oneRowHeight));
+ jTextFieldTagName.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
+ jTextFieldTagName.setLocation(new java.awt.Point(fieldColumn, rowOne));
+ }
+ return jTextFieldTagName;
+ }
+
+ /**
+ * This method initializes jTextFieldBuildTargets Row 2
+ *
+ * @return javax.swing.JTextField jTextFieldBuildTargets
+ */
+ private JTextField getJTextFieldBuildTargets() {
+ if (jTextFieldBuildTargets == null) {
+ jTextFieldBuildTargets = new JTextField();
+ jTextFieldBuildTargets.setBounds(new java.awt.Rectangle(fieldColumn, rowTwo, fieldWidth, oneRowHeight));
+ jTextFieldBuildTargets.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
+ jTextFieldBuildTargets.setLocation(new java.awt.Point(fieldColumn, rowTwo));
+ }
+ return jTextFieldBuildTargets;
+ }
+
+ /**
+ * This method initializes jTextFieldToolCmd Row 3
+ *
+ * This should be a dropdown box of command codes from tools_def.txt
+ *
+ * @return javax.swing.JTextField jTextFieldToolCmd
+ */
+ private JTextField getJTextFieldToolCmd() {
+ if (jTextFieldToolCmd == null) {
+ jTextFieldToolCmd = new JTextField();
+ jTextFieldToolCmd.setBounds(new java.awt.Rectangle(fieldColumn, rowThree, fieldWidth, oneRowHeight));
+ jTextFieldToolCmd.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
+ jTextFieldToolCmd.setLocation(new java.awt.Point(fieldColumn, rowThree));
+ }
+ return jTextFieldToolCmd;
+ }
+
+ /**
+ * This method initializes jArchitectureSelections Row 4
+ *
+ * @return jArchitectureSelections
+ */
+ private JPanel getArchitectureSelections() {
+ if (jArchitectureSelections == null) {
+ jArchitectureSelections = new JPanel();
+ jArchitectureSelections.setLayout(null);
+ jArchitectureSelections.add(getJCheckBoxIA32(), null);
+ jArchitectureSelections.add(getJCheckBoxX64(), null);
+ jArchitectureSelections.add(getJCheckBoxIpf(), null);
+ jArchitectureSelections.add(getJCheckBoxEBC(), null);
+ jArchitectureSelections.add(getJCheckBoxARM(), null);
+ jArchitectureSelections.add(getJCheckBoxPPC(), null);
+ jArchitectureSelections.setBounds(new java.awt.Rectangle(fieldColumn, rowFour, fieldWidth, oneRowHeight));
+ jArchitectureSelections.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
+ jArchitectureSelections.setLocation(new java.awt.Point(fieldColumn, rowFour));
+ }
+ return jArchitectureSelections;
+ }
+
+ /**
+ * This method initializes jCheckBoxIA32
+ *
+ * @return javax.swing.JCheckBox jCheckBoxIA32
+ */
+ private JCheckBox getJCheckBoxIA32() {
+ if (jCheckBoxIA32 == null) {
+ jCheckBoxIA32 = new JCheckBox();
+ jCheckBoxIA32.setBounds(new java.awt.Rectangle(0, 0, 55, 20));
+ jCheckBoxIA32.setText("IA32");
+ }
+ return jCheckBoxIA32;
+ }
+
+ /**
+ * This method initializes jCheckBoxX64
+ *
+ * @return javax.swing.JCheckBox jCheckBoxX64
+ */
+ private JCheckBox getJCheckBoxX64() {
+ if (jCheckBoxX64 == null) {
+ jCheckBoxX64 = new JCheckBox();
+ jCheckBoxX64.setText("X64");
+ jCheckBoxX64.setBounds(new java.awt.Rectangle(55, 0, 53, 20));
+ }
+ return jCheckBoxX64;
+ }
+
+ /**
+ * This method initializes jCheckBoxIpf
+ *
+ * @return javax.swing.JCheckBox jCheckBoxIpf
+ */
+ private JCheckBox getJCheckBoxIpf() {
+ if (jCheckBoxIpf == null) {
+ jCheckBoxIpf = new JCheckBox();
+ jCheckBoxIpf.setBounds(new java.awt.Rectangle(108, 0, 52, 20));
+ jCheckBoxIpf.setText("IPF");
+ }
+ return jCheckBoxIpf;
+ }
+
+
+ /**
+ * This method initializes jCheckBoxEBC
+ *
+ * @return javax.swing.JCheckBox jCheckBoxEBC
+ */
+ private JCheckBox getJCheckBoxEBC() {
+ if (jCheckBoxEBC == null) {
+ jCheckBoxEBC = new JCheckBox();
+ jCheckBoxEBC.setBounds(new java.awt.Rectangle(160, 0, 53, 20));
+ jCheckBoxEBC.setText("EBC");
+ }
+ return jCheckBoxEBC;
+ }
+
+ /**
+ * This method initializes jCheckBoxARM
+ *
+ * @return javax.swing.JCheckBox jCheckBoxARM
+ */
+ private JCheckBox getJCheckBoxARM() {
+ if (jCheckBoxARM == null) {
+ jCheckBoxARM = new JCheckBox();
+ jCheckBoxARM.setBounds(new java.awt.Rectangle(213, 0, 54, 20));
+ jCheckBoxARM.setText("ARM");
+ }
+ return jCheckBoxARM;
+ }
+
+ /**
+ * This method initializes jCheckBoxPPC
+ *
+ * @return javax.swing.JCheckBox jCheckBoxPPC
+ */
+ private JCheckBox getJCheckBoxPPC() {
+ if (jCheckBoxPPC == null) {
+ jCheckBoxPPC = new JCheckBox();
+ jCheckBoxPPC.setBounds(new java.awt.Rectangle(267, 0, 53, 20));
+ jCheckBoxPPC.setText("PPC");
+ }
+ return jCheckBoxPPC;
+ }
+
+ /**
+ * This method initializes jTextFieldToolChainFamily Row 5
+ *
+ * This should be a drop down for MSFT, INTEL, GCC or USER_DEFINED
+ *
+ * @return javax.swing.JTextField
+ */
+ private JTextField getJTextFieldToolChainFamily() {
+ if (jTextFieldToolChainFamily == null) {
+ jTextFieldToolChainFamily = new JTextField();
+ jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(fieldColumn, rowFive, fieldWidth, oneRowHeight));
+ jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
+ jTextFieldToolChainFamily.setLocation(new java.awt.Point(fieldColumn, rowFive));
+ }
+ return jTextFieldToolChainFamily;
+ }
+
+ /**
+ * This method initializes jTextFieldOptionContents Row 6
+ *
+ * This is where we should put the checkbox & entry data for the command arguments
+ *
+ * @return javax.swing.JTextField
+ */
+ private JTextField getJTextFieldOptionContents() {
+ if (jTextFieldOptionContents == null) {
+ jTextFieldOptionContents = new JTextField();
+ jTextFieldOptionContents.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
+ jTextFieldOptionContents.setBounds(fieldColumn, rowSix, fieldWidth, oneRowHeight);
+ jTextFieldOptionContents.setLocation(new java.awt.Point(fieldColumn, rowSix));
+ }
+ return jTextFieldOptionContents;
+ }
+
+ /**
+ * This method initializes jButtonOptionsAdd
+ *
+ * Add entry from the top screen to the table
+ *
+ * @return javax.swing.JButton jButtonOptionsAdd
+ */
+ private JButton getJButtonOptionsAdd() {
+ if (jButtonOptionsAdd == null) {
+ jButtonOptionsAdd = new JButton();
+ jButtonOptionsAdd.setText("Add");
+
+ jButtonOptionsAdd.setPreferredSize(new java.awt.Dimension(buttonWidth, oneRowHeight));
+ jButtonOptionsAdd.setBounds(new java.awt.Rectangle(firstButtonLoc, buttonRow, buttonWidth, oneRowHeight));
+ jButtonOptionsAdd.setLocation(new java.awt.Point(firstButtonLoc, buttonRow));
+ jButtonOptionsAdd.addActionListener(new AbstractAction() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public void actionPerformed(java.awt.event.ActionEvent e) {
+ boolean[] boolArray = { jCheckBoxIA32.isSelected(), jCheckBoxIpf.isSelected(),
+ jCheckBoxX64.isSelected(), jCheckBoxEBC.isSelected(),
+ jCheckBoxARM.isSelected(), jCheckBoxPPC.isSelected() };
+ String s = boolToList(boolArray);
+ Object[] o = { jTextFieldBuildTargets.getText(), jTextFieldToolChainFamily.getText(), s,
+ jTextFieldToolCmd.getText(), jTextFieldTagName.getText(),
+ jTextFieldOptionContents.getText() };
+ optionsTableModel.addRow(o);
+ docConsole.setSaved(false);
+ ffc.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets.getText()),
+ jTextFieldToolChainFamily.getText(), jTextFieldTagName.getText(),
+ jTextFieldToolCmd.getText(), stringToVector(s),
+ jTextFieldOptionContents.getText());
+ }
+ });
+ }
+ return jButtonOptionsAdd;
+ }
+
+ /**
+ * This method initializes jButtonOptionsDel
+ *
+ * Remove a line from the table below
+ *
+ * @return javax.swing.JButton jButtonOptionsDel
+ */
+ private JButton getJButtonOptionsDel() {
+ if (jButtonOptionsDel == null) {
+ jButtonOptionsDel = new JButton();
+ jButtonOptionsDel.setText("Delete");
+ jButtonOptionsDel.setPreferredSize(new java.awt.Dimension(buttonWidth, oneRowHeight));
+ jButtonOptionsDel.setBounds(new java.awt.Rectangle(next2LastButtonLoc, buttonRow, buttonWidth, oneRowHeight));
+ jButtonOptionsDel.setLocation(new java.awt.Point(next2LastButtonLoc, buttonRow));
+ jButtonOptionsDel.addActionListener(new AbstractAction() {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public void actionPerformed(java.awt.event.ActionEvent e) {
+ if (selectedRow >= 0) {
+ optionsTableModel.removeRow(selectedRow);
+ docConsole.setSaved(false);
+ ffc.removeBuildOptionsOpt(selectedRow);
+ }
+ }
+ });
+ }
+ return jButtonOptionsDel;
+ }
+
+ /**
+ * This method initializes jScrollPaneOptions
+ * Contains the Table and is located below the data entry section
+ * @return javax.swing.JScrollPane jScrollPaneOptoins
+ */
+ private JScrollPane getJScrollPaneOptions() {
+ if (jScrollPaneOptions == null) {
+ jScrollPaneOptions = new JScrollPane();
+ jScrollPaneOptions.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight * 2));
+ jScrollPaneOptions.setBounds(new java.awt.Rectangle(2, (dialogHeight * 2) + 2, dialogWidth * 2, dialogHeight * 2));
+ jScrollPaneOptions.setLocation(new java.awt.Point(2, dialogHeight + 2));
+
+ jScrollPaneOptions.setViewportView(getJTableOptions());
+ }
+ return jScrollPaneOptions;
+ }
+
+ /**
+ * This method initializes jTableOptions
+ *
+ * @return javax.swing.JTable jTableOptions
+ */
+ private JTable getJTableOptions() {
+ if (jTableOptions == null) {
+ jTitle = new JLabel();
+ jTitle.setText("Current Option Configuration Lines");
+ jTitle.setBounds(2, 2, labelWidth, oneRowHeight);
+
+ optionsTableModel = new DefaultTableModel();
+ jTableOptions = new JTable(optionsTableModel);
+ jTableOptions.setRowHeight(20);
+ optionsTableModel.addColumn("Build Targets");
+ optionsTableModel.addColumn("Tool Chain Family");
+ optionsTableModel.addColumn("Supported Architectures");
+ optionsTableModel.addColumn("Tool Command Code");
+ optionsTableModel.addColumn("TagName");
+ optionsTableModel.addColumn("Contents");
+
+ javax.swing.table.TableColumn toolFamilyCol = jTableOptions.getColumnModel().getColumn(1);
+ JComboBox cb = new JComboBox();
+ cb.addItem("MSFT");
+ cb.addItem("GCC");
+ cb.addItem("CYGWIN");
+ cb.addItem("INTEL");
+ cb.addItem("USER_DEFINED");
+ toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
+ Vector<String> vArch = new Vector<String>();
+ vArch.add("IA32");
+ vArch.add("X64");
+ vArch.add("IPF");
+ vArch.add("EBC");
+ vArch.add("ARM");
+ vArch.add("PPC");
+ jTableOptions.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch));
+ jTableOptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ jTableOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ selectedRow = -1;
+ if (e.getValueIsAdjusting()) {
+ return;
+ }
+ ListSelectionModel lsm = (ListSelectionModel) e.getSource();
+ if (lsm.isSelectionEmpty()) {
+ return;
+ } else {
+ selectedRow = lsm.getMinSelectionIndex();
+ }
+ }
+ });
+
+ jTableOptions.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 archs = m.getValueAt(row, 2) + "";
+ Vector<Object> supArch = null;
+ if (archs.length() > 0) {
+ supArch = new Vector<Object>();
+ String[] sArray1 = archs.split("( )+");
+ for (int i = 0; i < sArray1.length; ++i) {
+ supArch.add(sArray1[i]);
+ }
+ }
+
+ String toolCmd = m.getValueAt(row, 3) + "";
+ String tagName = m.getValueAt(row, 4) + "";
+ String contents = m.getValueAt(row, 5) + "";
+ docConsole.setSaved(false);
+ ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);
+ }
+ }
+ });
+ }
+ return jTableOptions;
+ }
+
+ private Vector<Object> stringToVector(String s) {
+ String[] sArray = s.split(" ");
+ Vector<Object> v = null;
+ if (s.length() > 0) {
+ v = new Vector<Object>();
+ for (int i = 0; i < sArray.length; ++i) {
+ v.add(sArray[i]);
+ }
+ }
+ return v;
+ }
+
+ private String boolToList(boolean[] bool) {
+ String s = " ";
+ if (bool[0]) {
+ s += "IA32 ";
+ }
+ if (bool[1]) {
+ s += "IPF ";
+ }
+ if (bool[2]) {
+ s += "X64 ";
+ }
+ if (bool[3]) {
+ s += "EBC ";
+ }
+ if (bool[4]) {
+ s += "ARM ";
+ }
+ if (bool[5]) {
+ s += "PPC ";
+ }
+ if (s == " ") {
+ s += "IA32";
+ }
+ return s.trim();
+ }
+
+ private void initOptionTable() {
+ if (ffc.getBuildOptionsOptCount() == 0) {
+ //ToDo get default options from *.txt file
+ return;
+ }
+ String[][] saa = new String[ffc.getBuildOptionsOptCount()][6];
+ ffc.getBuildOptionsOpts(saa);
+ for (int i = 0; i < saa.length; ++i) {
+ optionsTableModel.addRow(saa[i]);
+ }
+ }
+
+
+ /**
+ * Everything below should pertain to the ANT Task Tab
+ */
+
+ /**
+ * This method initializes jButton12
+ *
+ * @return javax.swing.JButton
+ */
+ private JButton getJButtonAntTaskFileBrowse() {
+ if (jButtonAntTaskFileBrowse == null) {
+ jButtonAntTaskFileBrowse = new JButton();
+ jButtonAntTaskFileBrowse.setPreferredSize(new Dimension(buttonWidth, oneRowHeight));
+ jButtonAntTaskFileBrowse.setText("Browse");
+ jButtonAntTaskFileBrowse.addActionListener(new AbstractAction() {
+ private static final long serialVersionUID = 1L;
+
+ public void actionPerformed(ActionEvent arg0) {
+ //
+ // Select files from current workspace
+ //
+ String dirPrefix = System.getenv("WORKSPACE");
+ JFileChooser chooser = new JFileChooser(dirPrefix);
+ File theFile = null;
+ String headerDest = null;
+
+ chooser.setMultiSelectionEnabled(false);
+ chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+ int retval = chooser.showOpenDialog(frame);
+ if (retval == JFileChooser.APPROVE_OPTION) {
+
+ theFile = chooser.getSelectedFile();
+ String file = theFile.getPath();
+ if (!file.startsWith(dirPrefix)) {
+ JOptionPane.showMessageDialog(frame, "You can only select files in current package!");
+ return;
+ }
+ } else {
+ return;
+ }
+
+ headerDest = theFile.getPath();
+ jTextFieldAntTaskFile.setText(headerDest.substring(dirPrefix.length()).replace('\\', '/'));
+
+ }
+
+ });
+ }
+ return jButtonAntTaskFileBrowse;
+ }
+
+ /**
* This method initializes jPanelUserDefCenterN
*
* @return javax.swing.JPanel
@@ -1857,73 +1992,232 @@ public class FpdBuildOptions extends IInternalFrame {
}
/**
- * @param args
+ * This method initializes jPanel8
+ *
+ * @return javax.swing.JPanel
*/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- new FpdBuildOptions().setVisible(true);
+ private JPanel getJPanelUserDef() {
+ if (jPanelUserDef == null) {
+ jPanelUserDef = new JPanel();
+ jPanelUserDef.setLayout(new BorderLayout());
+ jPanelUserDef.add(getJPanelUserDefNorth(), java.awt.BorderLayout.NORTH);
+ jPanelUserDef.add(getJPanelUserDefCenter(), java.awt.BorderLayout.CENTER);
+
+ }
+ return jPanelUserDef;
}
/**
- * This is the default constructor
+ * This method initializes jPanel9
+ *
+ * @return javax.swing.JPanel
*/
- public FpdBuildOptions() {
- super();
- initialize();
- this.setVisible(true);
+ private JPanel getJPanelUserDefNorth() {
+ if (jPanelUserDefNorth == null) {
+ jLabelAntTaskFile = new JLabel();
+ jLabelAntTaskFile.setText("ANT Task File");
+ jLabelAntTaskFile.setPreferredSize(new java.awt.Dimension(80, 20));
+ FlowLayout flowLayout8 = new FlowLayout();
+ flowLayout8.setAlignment(java.awt.FlowLayout.CENTER);
+ jLabelAntTaskId = new JLabel();
+ jLabelAntTaskId.setText("ID");
+ jPanelUserDefNorth = new JPanel();
+ jPanelUserDefNorth.setLayout(flowLayout8);
+ jPanelUserDefNorth.add(jLabelAntTaskFile, null);
+ jPanelUserDefNorth.add(getJTextFieldAntTaskFile(), null);
+ jPanelUserDefNorth.add(getJButtonAntTaskFileBrowse(), null);
+ jPanelUserDefNorth.add(jLabelAntTaskId, null);
+ jPanelUserDefNorth.add(getJTextFieldAntTaskId(), null);
+ }
+ return jPanelUserDefNorth;
}
-
- public FpdBuildOptions(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- this();
- ffc = new FpdFileContents(fpd);
- init(ffc);
+
+ /**
+ * This method initializes jPanel11
+ *
+ * @return javax.swing.JPanel
+ */
+ private JPanel getJPanelUserDefCenter() {
+ if (jPanelUserDefCenter == null) {
+ jLabelAntCmdOpts = new JLabel();
+ jLabelAntCmdOpts.setText("ANT Command Options");
+ jLabelAntCmdOpts.setPreferredSize(new java.awt.Dimension(131, 20));
+ jPanelUserDefCenter = new JPanel();
+ jPanelUserDefCenter.setLayout(new BorderLayout());
+
+ jPanelUserDefCenter.add(getJPanelUserDefCenterN(), java.awt.BorderLayout.NORTH);
+ jPanelUserDefCenter.add(getJPanelUserDefCenterC(), java.awt.BorderLayout.CENTER);
+ }
+ return jPanelUserDefCenter;
}
-
- public FpdBuildOptions(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
+
+ /**
+ * This method initializes jTextField2
+ *
+ * @return javax.swing.JTextField
+ */
+ private JTextField getJTextFieldAntTaskFile() {
+ if (jTextFieldAntTaskFile == null) {
+ jTextFieldAntTaskFile = new JTextField();
+ jTextFieldAntTaskFile.setPreferredSize(new java.awt.Dimension(200, 20));
+ }
+ return jTextFieldAntTaskFile;
}
- private void init(FpdFileContents ffc) {
- initOptionTable();
- initAntTaskTable();
- initFfsTable();
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTableFfs.isEditing()) {
- jTableFfs.getCellEditor().stopCellEditing();
- }
- if (jTableFfsSection.isEditing()) {
- jTableFfsSection.getCellEditor().stopCellEditing();
- }
- if (jTableAntTasks.isEditing()) {
- jTableAntTasks.getCellEditor().stopCellEditing();
- }
- if (jTableFfsSubSection.isEditing()) {
- jTableFfsSubSection.getCellEditor().stopCellEditing();
- }
- if (jTableFfsAttribs.isEditing()) {
- jTableFfsAttribs.getCellEditor().stopCellEditing();
+ /**
+ * This method initializes jTextField3
+ *
+ * @return javax.swing.JTextField
+ */
+ private JTextField getJTextFieldAntTaskId() {
+ if (jTextFieldAntTaskId == null) {
+ jTextFieldAntTaskId = new JTextField();
+ jTextFieldAntTaskId.setPreferredSize(new java.awt.Dimension(100, 20));
+ }
+ return jTextFieldAntTaskId;
+ }
+
+ /**
+ * This method initializes jButton4
+ *
+ * @return javax.swing.JButton
+ */
+ private JButton getJButtonAntTaskAdd() {
+ if (jButtonAntTaskAdd == null) {
+ jButtonAntTaskAdd = new JButton();
+ jButtonAntTaskAdd.setPreferredSize(new java.awt.Dimension(90, 20));
+ jButtonAntTaskAdd.setText("Add");
+ jButtonAntTaskAdd.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if (!DataValidation.isInt(jTextFieldAntTaskId.getText())
+ || jTextFieldAntTaskId.getText().length() != 8) {
+ JOptionPane.showMessageDialog(frame, "ID must be an 8-digit integer.");
+ return;
+ }
+ Object[] o = { jTextFieldAntTaskId.getText(), null, null };
+ o[1] = jTextFieldAntTaskFile.getText();
+ o[2] = jTextFieldAntCmdOpts.getText();
+ ffc.genBuildOptionsUserDefAntTask(o[0] + "", o[1] + "", o[2] + "");
+ antTaskTableModel.addRow(o);
+ docConsole.setSaved(false);
}
- if (jTableOptions.isEditing()) {
- jTableOptions.getCellEditor().stopCellEditing();
+ });
+ }
+ return jButtonAntTaskAdd;
+ }
+
+ /**
+ * This method initializes jButton5
+ *
+ * @return javax.swing.JButton
+ */
+ private JButton getJButtonAntTaskDel() {
+ if (jButtonAntTaskDel == null) {
+ jButtonAntTaskDel = new JButton();
+ jButtonAntTaskDel.setPreferredSize(new java.awt.Dimension(90, 20));
+ jButtonAntTaskDel.setText("Delete");
+ jButtonAntTaskDel.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if (selectedRow >= 0) {
+ docConsole.setSaved(false);
+ antTaskTableModel.removeRow(selectedRow);
+ ffc.removeBuildOptionsUserDefAntTask(selectedRow);
+ }
}
- }
- });
+ });
+ }
+ return jButtonAntTaskDel;
}
-
- private void initOptionTable() {
- if (ffc.getBuildOptionsOptCount() == 0) {
- //ToDo get default options from *.txt file
- return;
+
+ /**
+ * This method initializes jTextField4
+ *
+ * @return javax.swing.JTextField
+ */
+ private JTextField getJTextFieldAntCmdOpts() {
+ if (jTextFieldAntCmdOpts == null) {
+ jTextFieldAntCmdOpts = new JTextField();
+ jTextFieldAntCmdOpts.setPreferredSize(new java.awt.Dimension(270, 20));
+ jTextFieldAntCmdOpts.setEnabled(true);
}
- String[][] saa = new String[ffc.getBuildOptionsOptCount()][6];
- ffc.getBuildOptionsOpts(saa);
- for (int i = 0; i < saa.length; ++i) {
- optionsTableModel.addRow(saa[i]);
+ return jTextFieldAntCmdOpts;
+ }
+
+ /**
+ * This method initializes jScrollPane2
+ *
+ * @return javax.swing.JScrollPane
+ */
+ private JScrollPane getJScrollPaneAntTasks() {
+ if (jScrollPaneAntTasks == null) {
+ jScrollPaneAntTasks = new JScrollPane();
+ jScrollPaneAntTasks.setPreferredSize(new java.awt.Dimension(600, 400));
+ jScrollPaneAntTasks.setViewportView(getJTableAntTasks());
}
+ return jScrollPaneAntTasks;
}
-
+
+ /**
+ * This method initializes jTable2
+ *
+ * @return javax.swing.JTable
+ */
+ private JTable getJTableAntTasks() {
+ if (jTableAntTasks == null) {
+ antTaskTableModel = new DefaultTableModel();
+ jTableAntTasks = new JTable(antTaskTableModel);
+ jTableAntTasks.setRowHeight(20);
+ antTaskTableModel.addColumn("ID");
+ antTaskTableModel.addColumn("Filename");
+ antTaskTableModel.addColumn("ANT Command Options");
+
+ jTableAntTasks.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ jTableAntTasks.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ selectedRow = -1;
+ if (e.getValueIsAdjusting()) {
+ return;
+ }
+ ListSelectionModel lsm = (ListSelectionModel) e.getSource();
+ if (lsm.isSelectionEmpty()) {
+ return;
+ } else {
+ selectedRow = lsm.getMinSelectionIndex();
+ }
+ }
+ });
+
+ jTableAntTasks.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 id = m.getValueAt(row, 0) + "";
+ String file = m.getValueAt(row, 1) + "";
+ String execOrder = m.getValueAt(row, 2) + "";
+ if (id.length() == 0) {
+ return;
+ }
+ if (file.length() == 0 && execOrder.length() == 0) {
+ return;
+ }
+ if (file.length() == 0) {
+ file = null;
+ }
+ if (execOrder.length() == 0) {
+ execOrder = null;
+ }
+ ffc.updateBuildOptionsUserDefAntTask(row, id, file, execOrder);
+
+ }
+ }
+ });
+ }
+ return jTableAntTasks;
+ }
+
private void initAntTaskTable() {
if (ffc.getBuildOptionsUserDefAntTaskCount() == 0) {
return;
@@ -1934,45 +2228,5 @@ public class FpdBuildOptions extends IInternalFrame {
antTaskTableModel.addRow(saa[i]);
}
}
-
- private void initFfsTable(){
- int ffsCount = ffc.getBuildOptionsFfsCount();
- if (ffsCount < 0) {
- return;
- }
- String[][] saa = new String[ffsCount][1];
- ffc.getBuildOptionsFfsKey(saa);
- for (int i = 0; i < saa.length; ++i) {
- ffsTableModel.addRow(saa[i]);
- }
- }
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(722, 577);
- this.setTitle("FPD Build Options");
- this.setContentPane(getJContentPane());
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
- jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
- jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
- jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
- jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-} // @jve:decl-index=0:visual-constraint="10,10"
+} // @jve:decl-index=0:visual-constraint="10,10"