]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Make opening dialogs re-gain focus when user switch back to main UI from other window...
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFrameworkModules.java
index 9e4df720b01183de20422d673c94933561362bd9..9e2aa0cb1280d07651381bead7a211c68a370b47 100644 (file)
@@ -18,7 +18,6 @@ import java.awt.BorderLayout;
 import java.awt.Dimension;\r
 import java.awt.FontMetrics;\r
 \r
-import javax.swing.JFrame;\r
 import javax.swing.JOptionPane;\r
 import javax.swing.JPanel;\r
 import javax.swing.JSplitPane;\r
@@ -32,6 +31,7 @@ import javax.swing.table.DefaultTableModel;
 import javax.swing.table.TableModel;\r
 \r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.FrameworkWizardUI;\r
 import org.tianocore.frameworkwizard.common.GlobalData;\r
 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
@@ -65,8 +65,6 @@ public class FpdFrameworkModules extends IInternalFrame {
     \r
     public static final int forceDbgColForFpdModTable = 7;\r
 \r
-    static JFrame frame;\r
-\r
     private JSplitPane jSplitPane = null;\r
 \r
     private JPanel jPanelTop = null;\r
@@ -394,7 +392,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
 \r
         if (vArchs == null) {\r
-            JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");\r
+            JOptionPane.showMessageDialog(this, "No Supported Architectures specified in MSA file.");\r
             return;\r
         }\r
 \r
@@ -402,7 +400,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
         platformSupArch.retainAll(vArchs);\r
         if (platformSupArch.size() == 0) {\r
-            JOptionPane.showMessageDialog(frame, "This Module does not support this platform architectures.");\r
+            JOptionPane.showMessageDialog(this, "This Module does not support this platform architectures.");\r
             return;\r
         }\r
         \r
@@ -446,7 +444,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         // Archs this Module supported have already been added.\r
         //\r
         if (vArchs.size() == 0) {\r
-            JOptionPane.showMessageDialog(frame, "This Module has already been added.");\r
+            JOptionPane.showMessageDialog(this, "This Module has already been added.");\r
             return;\r
         }\r
         //ToDo put Arch instead of null\r
@@ -474,7 +472,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                 //ToDo : specify archs need to add.\r
                 ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);\r
             } catch (Exception exception) {\r
-                JOptionPane.showMessageDialog(frame, "Adding " + row[modNameColForFpdModTable] + " with Supporting Architectures: " + arch\r
+                JOptionPane.showMessageDialog(this, "Adding " + row[modNameColForFpdModTable] + " with Supporting Architectures: " + arch\r
                                                      + ": " + exception.getMessage());\r
                 errorOccurred = true;\r
             }\r
@@ -486,7 +484,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         } else {\r
             s += " was added Successfully.";\r
         }\r
-        JOptionPane.showMessageDialog(frame, s);\r
+        JOptionPane.showMessageDialog(this, s);\r
         TableSorter sorterFpdModules = (TableSorter)jTableFpdModules.getModel();\r
         int viewIndex = sorterFpdModules.getViewIndexArray()[modelFpdModules.getRowCount() - 1];\r
         jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
@@ -776,7 +774,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                         ffc.removeModuleSA(selectedRow);    \r
                     }\r
                     catch (Exception exp) {\r
-                        JOptionPane.showMessageDialog(frame, exp.getMessage());\r
+                        JOptionPane.showMessageDialog(FpdFrameworkModules.this, exp.getMessage());\r
                         return;\r
                     }\r
                     \r
@@ -857,7 +855,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         docConsole = opt;\r
         Vector<String> vExceptions = new Vector<String>();\r
         if (pcdSync(vExceptions)) {\r
-            JOptionPane.showMessageDialog(frame, "PCD in this platform are synchronized with those in MSA files.");    \r
+            JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "PCD in this platform are synchronized with those in MSA files.");    \r
             docConsole.setSaved(false);\r
         }\r
         if (vExceptions.size() > 0) {\r
@@ -865,7 +863,7 @@ public class FpdFrameworkModules extends IInternalFrame {
             for (int i = 0; i < vExceptions.size(); ++i) {\r
                 errorMsg += " " + vExceptions.get(i) + "\n";\r
             }\r
-            JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:\n" + errorMsg);\r
+            JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Error occurred during synchronization:\n" + errorMsg);\r
         }\r
     }\r
 \r
@@ -897,7 +895,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     try {\r
                         row[pathColForFpdModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);\r
                     } catch (Exception e) {\r
-                        JOptionPane.showMessageDialog(frame, "Show FPD Modules:" + e.getMessage());\r
+                        JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Show FPD Modules:" + e.getMessage());\r
                     }\r
                     \r
                     String fpdMsaKey = saa[i][ffcModGuid] + row[modVerColForFpdModTable]\r
@@ -964,7 +962,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                 try {\r
                     s[pathColForAllModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);\r
                 } catch (Exception e) {\r
-                    JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());\r
+                    JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Show All Modules:" + e.getMessage());\r
                 }\r
                 modelAllModules.addRow(s);\r
                 miList.add(mi);\r