Remove all recommended lib instances logic in SpdLibClassDecls.java as recommmended instances are not in UI any more.
Adjust the width of table columns to ease view. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1742 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		| @@ -34,6 +34,7 @@ import javax.swing.event.ListSelectionListener; | |||||||
| import javax.swing.event.TableModelEvent; | import javax.swing.event.TableModelEvent; | ||||||
| import javax.swing.event.TableModelListener; | import javax.swing.event.TableModelListener; | ||||||
| import javax.swing.table.DefaultTableModel; | import javax.swing.table.DefaultTableModel; | ||||||
|  | import javax.swing.table.TableColumn; | ||||||
| import javax.swing.table.TableModel; | import javax.swing.table.TableModel; | ||||||
|  |  | ||||||
| import org.tianocore.PackageSurfaceAreaDocument; | import org.tianocore.PackageSurfaceAreaDocument; | ||||||
| @@ -135,6 +136,15 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ | |||||||
|  |  | ||||||
|     protected StarLabel starLabel = null; |     protected StarLabel starLabel = null; | ||||||
|      |      | ||||||
|  |     private final int guidNameMinWidth = 200; | ||||||
|  |     private final int guidCNameMinWidth = 200; | ||||||
|  |     private final int guidValueMinWidth = 300; | ||||||
|  |     private final int helpTextMinWidth = 300; | ||||||
|  |     private final int supArchMinWidth = 200; | ||||||
|  |     private final int supModMinWidth = 200; | ||||||
|  |     private final int guidTypeMinWidth = 200; | ||||||
|  |      | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|       This method initializes this |       This method initializes this | ||||||
|       |       | ||||||
| @@ -192,6 +202,22 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ | |||||||
|            model.addColumn("Supported Architectures"); |            model.addColumn("Supported Architectures"); | ||||||
|            model.addColumn("Supported Module Types"); |            model.addColumn("Supported Module Types"); | ||||||
|            model.addColumn("GuidTypes"); |            model.addColumn("GuidTypes"); | ||||||
|  |             | ||||||
|  |            TableColumn column = jTable.getColumnModel().getColumn(0); | ||||||
|  |            column.setMinWidth(this.guidNameMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(1); | ||||||
|  |            column.setMinWidth(this.guidCNameMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(2); | ||||||
|  |            column.setMinWidth(this.guidValueMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(3); | ||||||
|  |            column.setMinWidth(this.helpTextMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(4); | ||||||
|  |            column.setMinWidth(this.supArchMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(5); | ||||||
|  |            column.setMinWidth(this.supModMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(6); | ||||||
|  |            column.setMinWidth(this.guidTypeMinWidth); | ||||||
|  |             | ||||||
|            jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor()); |            jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor()); | ||||||
|            jTable.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor()); |            jTable.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor()); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -17,8 +17,8 @@ import java.awt.event.ActionEvent; | |||||||
| import java.awt.event.ComponentEvent; | import java.awt.event.ComponentEvent; | ||||||
| import java.io.File; | import java.io.File; | ||||||
| import java.util.HashMap; | import java.util.HashMap; | ||||||
| import java.util.Iterator; | //import java.util.Iterator; | ||||||
| import java.util.Set; | //import java.util.Set; | ||||||
| import java.util.Vector; | import java.util.Vector; | ||||||
|  |  | ||||||
| import javax.swing.AbstractAction; | import javax.swing.AbstractAction; | ||||||
| @@ -41,11 +41,12 @@ import javax.swing.event.ListSelectionListener; | |||||||
| import javax.swing.event.TableModelEvent; | import javax.swing.event.TableModelEvent; | ||||||
| import javax.swing.event.TableModelListener; | import javax.swing.event.TableModelListener; | ||||||
| import javax.swing.table.DefaultTableModel; | import javax.swing.table.DefaultTableModel; | ||||||
|  | import javax.swing.table.TableColumn; | ||||||
| import javax.swing.table.TableModel; | import javax.swing.table.TableModel; | ||||||
| import org.tianocore.PackageSurfaceAreaDocument; | import org.tianocore.PackageSurfaceAreaDocument; | ||||||
| import org.tianocore.frameworkwizard.common.DataType; | import org.tianocore.frameworkwizard.common.DataType; | ||||||
| import org.tianocore.frameworkwizard.common.DataValidation; | import org.tianocore.frameworkwizard.common.DataValidation; | ||||||
| import org.tianocore.frameworkwizard.common.GlobalData; | //import org.tianocore.frameworkwizard.common.GlobalData; | ||||||
| import org.tianocore.frameworkwizard.common.Tools; | import org.tianocore.frameworkwizard.common.Tools; | ||||||
| import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType; | import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType; | ||||||
| import org.tianocore.frameworkwizard.common.ui.IInternalFrame; | import org.tianocore.frameworkwizard.common.ui.IInternalFrame; | ||||||
| @@ -53,8 +54,8 @@ import org.tianocore.frameworkwizard.common.ui.StarLabel; | |||||||
| import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList; | import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList; | ||||||
| import org.tianocore.frameworkwizard.platform.ui.ListEditor; | import org.tianocore.frameworkwizard.platform.ui.ListEditor; | ||||||
| import org.tianocore.frameworkwizard.platform.ui.LongTextEditor; | import org.tianocore.frameworkwizard.platform.ui.LongTextEditor; | ||||||
| import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery; | //import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery; | ||||||
| import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; | //import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; | ||||||
|  |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -116,14 +117,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|  |  | ||||||
|     private JScrollPane jHelpTextScrollPane = null; |     private JScrollPane jHelpTextScrollPane = null; | ||||||
|  |  | ||||||
|     private JLabel jLabel3RecInstName = null; |  | ||||||
|  |  | ||||||
|     private JTextField jTextField1RecInstName = null; |  | ||||||
|  |  | ||||||
|     private JLabel jLabel4RecInstVer = null; |  | ||||||
|  |  | ||||||
|     private JTextField jTextField2RecInstVer = null; |  | ||||||
|  |  | ||||||
|     private JLabel jLabel5SupArchList = null; |     private JLabel jLabel5SupArchList = null; | ||||||
|  |  | ||||||
|     private JLabel jLabel6SupModList = null; |     private JLabel jLabel6SupModList = null; | ||||||
| @@ -136,16 +129,20 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|  |  | ||||||
|     private ICheckBoxList iCheckBoxListArch = null; |     private ICheckBoxList iCheckBoxListArch = null; | ||||||
|  |  | ||||||
|     private JComboBox jComboBox = null; |  | ||||||
|  |  | ||||||
|     private int cnClassName = 0; |     private int cnClassName = 0; | ||||||
|     private int cnHdrFile = 1; |     private int cnHdrFile = 1; | ||||||
|     private int cnHelpText = 2; |     private int cnHelpText = 2; | ||||||
|     private int cnRecInstName = 3; | //    private int cnRecInstName = 3; | ||||||
|     private int cnRecInstVer = 4; | //    private int cnRecInstVer = 4; | ||||||
|     private int cnSupArch = 5; |     private int cnSupArch = 5; | ||||||
|     private int cnSupMod = 6; |     private int cnSupMod = 6; | ||||||
|      |      | ||||||
|  |     private final int classNameMinWidth = 200; | ||||||
|  |     private final int hdrFileMinWidth = 300; | ||||||
|  |     private final int helpTextMinWidth = 300; | ||||||
|  |     private final int supArchMinWidth = 200; | ||||||
|  |     private final int supModMinWidth = 200; | ||||||
|  |  | ||||||
|     private final int shortLabel = 90; |     private final int shortLabel = 90; | ||||||
|     private final int longLabel = 220; |     private final int longLabel = 220; | ||||||
|     private final int labelCol = 12; |     private final int labelCol = 12; | ||||||
| @@ -253,6 +250,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             |             | ||||||
|            jTable.getColumnModel().getColumn(cnHelpText).setCellEditor(new LongTextEditor()); |            jTable.getColumnModel().getColumn(cnHelpText).setCellEditor(new LongTextEditor()); | ||||||
|             |             | ||||||
|  |            jTable.removeColumn(jTable.getColumnModel().getColumn(3)); | ||||||
|  |            jTable.removeColumn(jTable.getColumnModel().getColumn(3)); | ||||||
|  |             | ||||||
|            Vector<String> vArch = new Vector<String>(); |            Vector<String> vArch = new Vector<String>(); | ||||||
|            vArch.add("IA32"); |            vArch.add("IA32"); | ||||||
|            vArch.add("X64"); |            vArch.add("X64"); | ||||||
| @@ -260,7 +260,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|            vArch.add("EBC"); |            vArch.add("EBC"); | ||||||
|            vArch.add("ARM"); |            vArch.add("ARM"); | ||||||
|            vArch.add("PPC"); |            vArch.add("PPC"); | ||||||
|            jTable.getColumnModel().getColumn(cnSupArch).setCellEditor(new ListEditor(vArch)); |            jTable.getColumnModel().getColumn(cnSupArch - 2).setCellEditor(new ListEditor(vArch)); | ||||||
|             |             | ||||||
|            Vector<String> vModule = new Vector<String>(); |            Vector<String> vModule = new Vector<String>(); | ||||||
|            vModule.add("BASE"); |            vModule.add("BASE"); | ||||||
| @@ -276,7 +276,18 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|            vModule.add("UEFI_APPLICATION"); |            vModule.add("UEFI_APPLICATION"); | ||||||
|            vModule.add("USER_DEFINED"); |            vModule.add("USER_DEFINED"); | ||||||
|  |  | ||||||
|            jTable.getColumnModel().getColumn(cnSupMod).setCellEditor(new ListEditor(vModule)); |            jTable.getColumnModel().getColumn(cnSupMod - 2).setCellEditor(new ListEditor(vModule)); | ||||||
|  |             | ||||||
|  |            TableColumn column = jTable.getColumnModel().getColumn(this.cnClassName); | ||||||
|  |            column.setMinWidth(this.classNameMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(this.cnHdrFile); | ||||||
|  |            column.setMinWidth(this.hdrFileMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(this.cnHelpText); | ||||||
|  |            column.setMinWidth(this.helpTextMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(this.cnSupArch - 2); | ||||||
|  |            column.setMinWidth(this.supArchMinWidth); | ||||||
|  |            column = jTable.getColumnModel().getColumn(this.cnSupMod - 2); | ||||||
|  |            column.setMinWidth(this.supModMinWidth); | ||||||
|             |             | ||||||
|            jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |            jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | ||||||
|            jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ |            jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ | ||||||
| @@ -312,13 +323,13 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             String hdr = m.getValueAt(row, cnHdrFile) + ""; |             String hdr = m.getValueAt(row, cnHdrFile) + ""; | ||||||
|             String hlp = m.getValueAt(row, cnHelpText) + ""; |             String hlp = m.getValueAt(row, cnHelpText) + ""; | ||||||
|             String name = null; |             String name = null; | ||||||
|             if (m.getValueAt(row, cnRecInstName) != null) { | //            if (m.getValueAt(row, cnRecInstName) != null) { | ||||||
|                 name = m.getValueAt(row, cnRecInstName).toString(); | //                name = m.getValueAt(row, cnRecInstName).toString(); | ||||||
|             }  | //            }  | ||||||
|             String ver = null; | //            String ver = null; | ||||||
|             if (m.getValueAt(row, cnRecInstVer) != null){ | //            if (m.getValueAt(row, cnRecInstVer) != null){ | ||||||
|                 ver = m.getValueAt(row, cnRecInstVer).toString(); | //                ver = m.getValueAt(row, cnRecInstVer).toString(); | ||||||
|             } | //            } | ||||||
|             String arch = null; |             String arch = null; | ||||||
|             if (m.getValueAt(row, cnSupArch) != null) { |             if (m.getValueAt(row, cnSupArch) != null) { | ||||||
|                arch = m.getValueAt(row, cnSupArch).toString(); |                arch = m.getValueAt(row, cnSupArch).toString(); | ||||||
| @@ -327,20 +338,20 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             if (m.getValueAt(row, cnSupMod) != null) { |             if (m.getValueAt(row, cnSupMod) != null) { | ||||||
|                 module = m.getValueAt(row, cnSupMod).toString(); |                 module = m.getValueAt(row, cnSupMod).toString(); | ||||||
|             } |             } | ||||||
|             String[] rowData = {lib, hdr, hlp, name, ver}; |             String[] rowData = {lib, hdr, hlp, name}; | ||||||
|             if (!dataValidation(rowData)) { |             if (!dataValidation(rowData)) { | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|              |              | ||||||
|             String guid = null; |             String guid = null; | ||||||
|             if (name != null && name.length() > 0) { | //            if (name != null && name.length() > 0) { | ||||||
|                 getLibInstances(lib); | //                getLibInstances(lib); | ||||||
|                 guid = nameToGuid(name); | //                guid = nameToGuid(name); | ||||||
|                 if (guid == null){ | //                if (guid == null){ | ||||||
|                   JOptionPane.showMessageDialog(frame, "Recommended Instance does not exist."); | //                  JOptionPane.showMessageDialog(frame, "Recommended Instance does not exist."); | ||||||
|                   return; | //                  return; | ||||||
|                 } | //                } | ||||||
|             } | //            } | ||||||
|              |              | ||||||
|             String[] sa = new String[7]; |             String[] sa = new String[7]; | ||||||
|             sfc.getSpdLibClassDeclaration(sa, row); |             sfc.getSpdLibClassDeclaration(sa, row); | ||||||
| @@ -348,28 +359,26 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             if (cellData == null) { |             if (cellData == null) { | ||||||
|                 cellData = ""; |                 cellData = ""; | ||||||
|             } |             } | ||||||
|             if (column == cnRecInstName) { | //            if (column == cnRecInstName) { | ||||||
|                 if (guid == null) { | //                if (guid == null) { | ||||||
|                     if (sa[cnRecInstName] == null) { | //                    if (sa[cnRecInstName] == null) { | ||||||
|                         return; | //                        return; | ||||||
|                     } | //                    } | ||||||
|                 } | //                } | ||||||
|                 else { | //                else { | ||||||
|                     if (guid.equals(sa[cnRecInstName])) { | //                    if (guid.equals(sa[cnRecInstName])) { | ||||||
|                         return; | //                        return; | ||||||
|                     } | //                    } | ||||||
|                 } | //                } | ||||||
|  | //            } | ||||||
|  |             if (cellData.equals(sa[column])) { | ||||||
|  |                 return; | ||||||
|             } |             } | ||||||
|             else { |             if (cellData.toString().length() == 0 && sa[column] == null) { | ||||||
|                 if (cellData.equals(sa[column])) { |                 return; | ||||||
|                     return; |  | ||||||
|                 } |  | ||||||
|                 if (cellData.toString().length() == 0 && sa[column] == null) { |  | ||||||
|                     return; |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|             docConsole.setSaved(false); |             docConsole.setSaved(false); | ||||||
|             sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module); |             sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, null, arch, module); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -472,10 +481,10 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|         sfc.getSpdLibClassDeclarations(saa); |         sfc.getSpdLibClassDeclarations(saa); | ||||||
|         int i = 0; |         int i = 0; | ||||||
|         while (i < saa.length) { |         while (i < saa.length) { | ||||||
|             if (saa[i][3] != null && saa[i][3].length() > 0) { | //            if (saa[i][3] != null && saa[i][3].length() > 0) { | ||||||
|                 getLibInstances(saa[i][0]); | //                getLibInstances(saa[i][0]); | ||||||
|                 saa[i][3] = guidToName(saa[i][3]); | //                saa[i][3] = guidToName(saa[i][3]); | ||||||
|             } | //            } | ||||||
|              |              | ||||||
|             model.addRow(saa[i]); |             model.addRow(saa[i]); | ||||||
|             i++; |             i++; | ||||||
| @@ -571,8 +580,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             row[cnClassName] = jTextFieldAddClass.getText(); |             row[cnClassName] = jTextFieldAddClass.getText(); | ||||||
|             row[cnHdrFile] = jTextFieldHdr.getText().replace('\\', '/'); |             row[cnHdrFile] = jTextFieldHdr.getText().replace('\\', '/'); | ||||||
|             row[cnHelpText] = jTextAreaHelp.getText(); |             row[cnHelpText] = jTextAreaHelp.getText(); | ||||||
|             row[cnRecInstName] = jComboBox.getSelectedItem()+""; | //            row[cnRecInstName] = jComboBox.getSelectedItem()+""; | ||||||
|             row[cnRecInstVer] = jTextField2RecInstVer.getText(); | //            row[cnRecInstVer] = jTextField2RecInstVer.getText(); | ||||||
|             row[cnSupArch] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString()); |             row[cnSupArch] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString()); | ||||||
|             if (row[cnSupArch].length() == 0) { |             if (row[cnSupArch].length() == 0) { | ||||||
|                 row[cnSupArch] = null; |                 row[cnSupArch] = null; | ||||||
| @@ -587,19 +596,19 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             // |             // | ||||||
|             //convert to GUID before storing recommended lib instance. |             //convert to GUID before storing recommended lib instance. | ||||||
|             // |             // | ||||||
|             getLibInstances(row[cnClassName]); | //            getLibInstances(row[cnClassName]); | ||||||
|             String recommendGuid = nameToGuid(row[cnRecInstName]); | //            String recommendGuid = nameToGuid(row[cnRecInstName]); | ||||||
|             if (row[cnRecInstName].equals("null")) { | //            if (row[cnRecInstName].equals("null")) { | ||||||
|                 row[cnRecInstName] = null; | //                row[cnRecInstName] = null; | ||||||
|             } | //            } | ||||||
|             else{ | //            else{ | ||||||
|                 if (recommendGuid == null) { | //                if (recommendGuid == null) { | ||||||
|                   JOptionPane.showMessageDialog(frame, "Recommended Instance does not exist."); | //                  JOptionPane.showMessageDialog(frame, "Recommended Instance does not exist."); | ||||||
|                   return; | //                  return; | ||||||
|                 } | //                } | ||||||
|             } | //            } | ||||||
|  |  | ||||||
|             sfc.genSpdLibClassDeclarations(row[cnClassName], recommendGuid, row[cnHdrFile], row[cnHelpText], row[cnSupArch], null, null, row[cnRecInstVer], null, row[cnSupMod]); |             sfc.genSpdLibClassDeclarations(row[cnClassName], null, row[cnHdrFile], row[cnHelpText], row[cnSupArch], null, null, null, null, row[cnSupMod]); | ||||||
|             model.addRow(row); |             model.addRow(row); | ||||||
|             jTable.changeSelection(model.getRowCount()-1, 0, false, false); |             jTable.changeSelection(model.getRowCount()-1, 0, false, false); | ||||||
|             docConsole.setSaved(false); |             docConsole.setSaved(false); | ||||||
| @@ -642,17 +651,17 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|             JOptionPane.showMessageDialog(frame, "Help Text must be entered!"); |             JOptionPane.showMessageDialog(frame, "Help Text must be entered!"); | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|         if (row[cnRecInstVer] != null && row[cnRecInstVer].length() > 0) { | //        if (row[cnRecInstVer] != null && row[cnRecInstVer].length() > 0) { | ||||||
|             if (row[cnRecInstName] == null || row[cnRecInstName].length() == 0) { | //            if (row[cnRecInstName] == null || row[cnRecInstName].length() == 0) { | ||||||
|                 JOptionPane.showMessageDialog(frame, "Recommended Instance Version must associate with the Instance Name."); | //                JOptionPane.showMessageDialog(frame, "Recommended Instance Version must associate with the Instance Name."); | ||||||
|                 return false; | //                return false; | ||||||
|             } | //            } | ||||||
|              | //             | ||||||
|             if (!DataValidation.isVersionDataType(row[cnRecInstVer])) { | //            if (!DataValidation.isVersionDataType(row[cnRecInstVer])) { | ||||||
|                 JOptionPane.showMessageDialog(frame, "Recommended Instance Version does not match Version datatype."); | //                JOptionPane.showMessageDialog(frame, "Recommended Instance Version does not match Version datatype."); | ||||||
|                 return false; | //                return false; | ||||||
|             } | //            } | ||||||
|         } | //        } | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     /** |     /** | ||||||
| @@ -846,53 +855,53 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen | |||||||
|         return iCheckBoxListArch; |         return iCheckBoxListArch; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void getLibInstances(String libClass){ | //    private void getLibInstances(String libClass){ | ||||||
|         libNameGuidMap.clear(); | //        libNameGuidMap.clear(); | ||||||
|         try { | //        try { | ||||||
|                 Iterator ismi = GlobalData.vModuleList.iterator(); | //                Iterator ismi = GlobalData.vModuleList.iterator(); | ||||||
|                 while (ismi.hasNext()) { | //                while (ismi.hasNext()) { | ||||||
|                     ModuleIdentification mi = (ModuleIdentification) ismi.next(); | //                    ModuleIdentification mi = (ModuleIdentification) ismi.next(); | ||||||
|  | //                     | ||||||
|  | //                    Vector<String> classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); | ||||||
|  | //                    for (int i = 0; i < classProduced.size(); ++i) { | ||||||
|  | //                        if (classProduced.get(i).equals(libClass)) { | ||||||
|  | //                            libNameGuidMap.put(mi.getName(), mi.getGuid()); | ||||||
|  | //                        } | ||||||
|  | //                    } | ||||||
|  | //                } | ||||||
|  | //            | ||||||
|  | //        } | ||||||
|  | //        catch(Exception e){ | ||||||
|  | //            JOptionPane.showMessageDialog(frame, "Search Instances Failed."); | ||||||
|  | //        } | ||||||
|  | //         | ||||||
|  | //    } | ||||||
|  |  | ||||||
|                     Vector<String> classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); | //    private String nameToGuid(String name) { | ||||||
|                     for (int i = 0; i < classProduced.size(); ++i) { | //        String s = null; | ||||||
|                         if (classProduced.get(i).equals(libClass)) { | //        if (!libNameGuidMap.containsKey(name)) { | ||||||
|                             libNameGuidMap.put(mi.getName(), mi.getGuid()); | //            return s; | ||||||
|                         } | //        } | ||||||
|                     } | //         | ||||||
|                 } | //        s = libNameGuidMap.get(name); | ||||||
|  | //        return s; | ||||||
|  | //    } | ||||||
|      |      | ||||||
|         } | //    private String guidToName(String guid){ | ||||||
|         catch(Exception e){ | //        String s = ""; | ||||||
|             JOptionPane.showMessageDialog(frame, "Search Instances Failed."); | //        if (!libNameGuidMap.containsValue(guid)) { | ||||||
|         } | //            return s; | ||||||
|          | //        } | ||||||
|     } | //        Set<String> key = libNameGuidMap.keySet(); | ||||||
|  | //        Iterator<String> is = key.iterator(); | ||||||
|     private String nameToGuid(String name) { | //        while(is.hasNext()) { | ||||||
|         String s = null; | //            s = is.next(); | ||||||
|         if (!libNameGuidMap.containsKey(name)) { | //            if (libNameGuidMap.get(s).equals(guid)) { | ||||||
|             return s; | //                break; | ||||||
|         } | //            } | ||||||
|          | //        } | ||||||
|         s = libNameGuidMap.get(name); | //        return s; | ||||||
|         return s; | //    } | ||||||
|     } |  | ||||||
|      |  | ||||||
|     private String guidToName(String guid){ |  | ||||||
|         String s = ""; |  | ||||||
|         if (!libNameGuidMap.containsValue(guid)) { |  | ||||||
|             return s; |  | ||||||
|         } |  | ||||||
|         Set<String> key = libNameGuidMap.keySet(); |  | ||||||
|         Iterator<String> is = key.iterator(); |  | ||||||
|         while(is.hasNext()) { |  | ||||||
|             s = is.next(); |  | ||||||
|             if (libNameGuidMap.get(s).equals(guid)) { |  | ||||||
|                 break; |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         return s; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -153,6 +153,16 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ | |||||||
|  |  | ||||||
|     private JLabel jLabelSupArch = null; |     private JLabel jLabelSupArch = null; | ||||||
|      |      | ||||||
|  |     private final int pcdCNameMinWidth = 200; | ||||||
|  |     private final int pcdTokenMinWidth = 100; | ||||||
|  |     private final int pcdTokenSpaceMinWidth = 200; | ||||||
|  |     private final int datumTypeMinWidth = 80; | ||||||
|  |     private final int defaultValueMinWidth = 100; | ||||||
|  |     private final int helpTextMinWidth = 200; | ||||||
|  |     private final int usageMinWidth = 60; | ||||||
|  |     private final int supArchMinWidth = 200; | ||||||
|  |     private final int supModMinWidth = 200; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      This method initializes this |      This method initializes this | ||||||
|       |       | ||||||
| @@ -678,6 +688,33 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ | |||||||
|             model.addColumn("SupportedArch"); |             model.addColumn("SupportedArch"); | ||||||
|             model.addColumn("SupportedModule"); |             model.addColumn("SupportedModule"); | ||||||
|              |              | ||||||
|  |             TableColumn column = jTable.getColumnModel().getColumn(0); | ||||||
|  |             column.setMinWidth(this.pcdCNameMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(1); | ||||||
|  |             column.setMinWidth(this.pcdTokenMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(2); | ||||||
|  |             column.setMinWidth(this.pcdTokenSpaceMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(3); | ||||||
|  |             column.setMinWidth(this.datumTypeMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(4); | ||||||
|  |             column.setMinWidth(this.defaultValueMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(5); | ||||||
|  |             column.setMinWidth(this.helpTextMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(6); | ||||||
|  |             column.setMinWidth(this.usageMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(7); | ||||||
|  |             column.setMinWidth(this.usageMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(8); | ||||||
|  |             column.setMinWidth(this.usageMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(9); | ||||||
|  |             column.setMinWidth(this.usageMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(10); | ||||||
|  |             column.setMinWidth(this.usageMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(11); | ||||||
|  |             column.setMinWidth(this.supArchMinWidth); | ||||||
|  |             column = jTable.getColumnModel().getColumn(12); | ||||||
|  |             column.setMinWidth(this.supModMinWidth); | ||||||
|  |              | ||||||
|             //ToDo: add a valid usage editor |             //ToDo: add a valid usage editor | ||||||
|              |              | ||||||
|             JComboBox jComboBoxDataType = new JComboBox(); |             JComboBox jComboBoxDataType = new JComboBox(); | ||||||
|   | |||||||
| @@ -154,6 +154,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame { | |||||||
|             modelPcd.addColumn("DatumType"); |             modelPcd.addColumn("DatumType"); | ||||||
|             jTableDynPcd = new JTable(modelPcd); |             jTableDynPcd = new JTable(modelPcd); | ||||||
|             jTableDynPcd.setRowHeight(20); |             jTableDynPcd.setRowHeight(20); | ||||||
|  |              | ||||||
|  |             jTableDynPcd.getColumnModel().getColumn(0).setMinWidth(250); | ||||||
|  |              | ||||||
|             jTableDynPcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |             jTableDynPcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | ||||||
|             jTableDynPcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ |             jTableDynPcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ | ||||||
|                 public void valueChanged(ListSelectionEvent e) { |                 public void valueChanged(ListSelectionEvent e) { | ||||||
|   | |||||||
| @@ -555,6 +555,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { | |||||||
|             model.addColumn("DataType"); |             model.addColumn("DataType"); | ||||||
|             model.addColumn("DefaultValue"); |             model.addColumn("DefaultValue"); | ||||||
|              |              | ||||||
|  |             jTablePcd.getColumnModel().getColumn(0).setMinWidth(250); | ||||||
|  |                          | ||||||
|             jTablePcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |             jTablePcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | ||||||
|             jTablePcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ |             jTablePcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ | ||||||
|                 public void valueChanged(ListSelectionEvent e) { |                 public void valueChanged(ListSelectionEvent e) { | ||||||
| @@ -802,6 +804,9 @@ public class FpdModuleSA extends JDialog implements ActionListener { | |||||||
|             selectedInstancesTableModel.addColumn("PackageVersion"); |             selectedInstancesTableModel.addColumn("PackageVersion"); | ||||||
|             jTableSelectedInstances = new JTable(selectedInstancesTableModel); |             jTableSelectedInstances = new JTable(selectedInstancesTableModel); | ||||||
|             jTableSelectedInstances.setRowHeight(20); |             jTableSelectedInstances.setRowHeight(20); | ||||||
|  |              | ||||||
|  |             jTableSelectedInstances.getColumnModel().getColumn(0).setMinWidth(250); | ||||||
|  |              | ||||||
|             jTableSelectedInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); |             jTableSelectedInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); | ||||||
|             jTableSelectedInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |             jTableSelectedInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | ||||||
|              |              | ||||||
| @@ -907,6 +912,9 @@ public class FpdModuleSA extends JDialog implements ActionListener { | |||||||
|             libInstanceTableModel.addColumn("PackageVersion"); |             libInstanceTableModel.addColumn("PackageVersion"); | ||||||
|             jTableLibInstances = new JTable(libInstanceTableModel); |             jTableLibInstances = new JTable(libInstanceTableModel); | ||||||
|             jTableLibInstances.setRowHeight(20); |             jTableLibInstances.setRowHeight(20); | ||||||
|  |              | ||||||
|  |             jTableLibInstances.getColumnModel().getColumn(0).setMinWidth(250); | ||||||
|  |              | ||||||
|             jTableLibInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); |             jTableLibInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); | ||||||
|             jTableLibInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |             jTableLibInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | ||||||
|              |              | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user