X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fpackaging%2Fui%2FSpdGuidDecls.java;h=8f39783a8f5de4b230ac033dbbabb2c874031063;hp=c0c4b2698c3536d8a55652c2097e9002f85a4c5b;hb=82484861b558513f1333518d9e4f740d1c1526a6;hpb=55683eab3ad2f7c2d7ca3d03c8822a787fbc2f27 diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java index c0c4b2698c..8f39783a8f 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java @@ -19,6 +19,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ComponentEvent; import java.util.Vector; +import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTable; @@ -26,7 +27,6 @@ import javax.swing.JTextField; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JButton; -import javax.swing.JFrame; import javax.swing.ListSelectionModel; import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameEvent; @@ -58,8 +58,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ * */ private static final long serialVersionUID = 1L; - - static JFrame frame; + + private JFrame topFrame = null; private SpdFileContents sfc = null; @@ -219,8 +219,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ column = jTable.getColumnModel().getColumn(6); column.setMinWidth(this.guidTypeMinWidth); - jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor()); - jTable.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor()); + jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor(topFrame)); + jTable.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor(topFrame)); Vector vArch = new Vector(); vArch.add("IA32"); @@ -229,7 +229,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ vArch.add("EBC"); vArch.add("ARM"); vArch.add("PPC"); - jTable.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch)); + jTable.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch, topFrame)); Vector vModule = new Vector(); vModule.add("BASE"); @@ -244,7 +244,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ vModule.add("UEFI_DRIVER"); vModule.add("UEFI_APPLICATION"); vModule.add("USER_DEFINED"); - jTable.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vModule)); + jTable.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vModule, topFrame)); Vector vGuid = new Vector(); vGuid.add("DATA_HUB_RECORD"); @@ -255,7 +255,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ vGuid.add("HII_PACKAGE_LIST"); vGuid.add("HOB"); vGuid.add("TOKEN_SPACE_GUID"); - ListEditor le = new ListEditor(vGuid); + ListEditor le = new ListEditor(vGuid, topFrame); le.setCanNotBeEmpty(true); jTable.getColumnModel().getColumn(6).setCellEditor(le); @@ -416,24 +416,25 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ /** This is the default constructor **/ - public SpdGuidDecls() { + public SpdGuidDecls(JFrame frame) { super(); + topFrame = frame; initialize(); init(); } - public SpdGuidDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa){ - this(); + public SpdGuidDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame){ + this(frame); sfc = new SpdFileContents(inPsa); init(sfc); } - public SpdGuidDecls(OpeningPackageType opt) { - this(opt.getXmlSpd()); + public SpdGuidDecls(OpeningPackageType opt, JFrame frame) { + this(opt.getXmlSpd(), frame); docConsole = opt; if (sfc.getSpdPkgDefsRdOnly().equals("true")) { - JOptionPane.showMessageDialog(frame, "This is a read-only package. You will not be able to edit contents in table."); + JOptionPane.showMessageDialog(this, "This is a read-only package. You will not be able to edit contents in table."); } initFrame(); } @@ -896,10 +897,6 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ return iCheckBoxListMod; } - public static void main(String[] args){ - new SpdGuidDecls().setVisible(true); - } - protected DefaultTableModel getModel() { return model; }