move the package definitions to header editor.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / packaging / ui / SpdHeader.java
index 83679ea0bcf785293226ad5c11baddbb794e3f14..faf0c79727add0afe2622abf4221594dd152a098 100644 (file)
@@ -36,6 +36,7 @@ import org.tianocore.frameworkwizard.common.Tools;
 import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import javax.swing.JCheckBox;\r
 \r
 /**\r
  The class is used to create, update spdHeader of Spd file\r
@@ -126,6 +127,14 @@ public class SpdHeader extends IInternalFrame {
 \r
     private JTextField jTextFieldUrl = null;\r
 \r
+    private StarLabel starLabel = null;\r
+\r
+    private StarLabel starLabel1 = null;\r
+\r
+    private JCheckBox jCheckBoxRdOnly = null;\r
+\r
+    private JCheckBox jCheckBoxRePkg = null;\r
+\r
     /**\r
      This method initializes jTextFieldBaseName \r
      \r
@@ -290,7 +299,7 @@ public class SpdHeader extends IInternalFrame {
     private JTextField getJTextFieldSpecification() {\r
         if (jTextFieldSpecification == null) {\r
             jTextFieldSpecification = new JTextField();\r
-            jTextFieldSpecification.setBounds(new java.awt.Rectangle(161,330,320,20));\r
+            jTextFieldSpecification.setBounds(new java.awt.Rectangle(161,369,320,20));\r
             jTextFieldSpecification.setEditable(false);\r
             jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(320,20));\r
             jTextFieldSpecification.addFocusListener(new FocusAdapter(){\r
@@ -345,7 +354,7 @@ public class SpdHeader extends IInternalFrame {
     private JScrollPane getJScrollPaneLicense() {\r
         if (jScrollPaneLicense == null) {\r
             jScrollPaneLicense = new JScrollPane();\r
-            jScrollPaneLicense.setBounds(new java.awt.Rectangle(161,108,320,80));\r
+            jScrollPaneLicense.setBounds(new java.awt.Rectangle(161,144,320,80));\r
             jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
             jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(320,80));\r
             jScrollPaneLicense.setViewportView(getJTextAreaLicense());\r
@@ -362,7 +371,7 @@ public class SpdHeader extends IInternalFrame {
     private JScrollPane getJScrollPaneDescription() {\r
         if (jScrollPaneDescription == null) {\r
             jScrollPaneDescription = new JScrollPane();\r
-            jScrollPaneDescription.setBounds(new java.awt.Rectangle(160,244,320,80));\r
+            jScrollPaneDescription.setBounds(new java.awt.Rectangle(160,280,320,80));\r
             jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
             jScrollPaneDescription.setViewportView(getJTextAreaDescription());\r
         }\r
@@ -378,7 +387,7 @@ public class SpdHeader extends IInternalFrame {
     private JTextField getJTextFieldAbstract() {\r
         if (jTextFieldAbstract == null) {\r
             jTextFieldAbstract = new JTextField();\r
-            jTextFieldAbstract.setBounds(new java.awt.Rectangle(161,220,320,20));\r
+            jTextFieldAbstract.setBounds(new java.awt.Rectangle(161,256,320,20));\r
             jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20));\r
             jTextFieldAbstract.addFocusListener(new FocusAdapter(){\r
                 public void focusLost(FocusEvent e){\r
@@ -406,7 +415,7 @@ public class SpdHeader extends IInternalFrame {
     private JTextField getJTextFieldCopyright() {\r
         if (jTextFieldCopyright == null) {\r
             jTextFieldCopyright = new JTextField();\r
-            jTextFieldCopyright.setBounds(new java.awt.Rectangle(160,86,320,20));\r
+            jTextFieldCopyright.setBounds(new java.awt.Rectangle(160,86,320,48));\r
             jTextFieldCopyright.setPreferredSize(new java.awt.Dimension(320,20));\r
             jTextFieldCopyright.addFocusListener(new FocusAdapter(){\r
                public void focusLost(FocusEvent e){\r
@@ -433,7 +442,7 @@ public class SpdHeader extends IInternalFrame {
     private JTextField getJTextFieldUrl() {\r
         if (jTextFieldUrl == null) {\r
             jTextFieldUrl = new JTextField();\r
-            jTextFieldUrl.setBounds(new java.awt.Rectangle(161,195,320,20));\r
+            jTextFieldUrl.setBounds(new java.awt.Rectangle(161,231,320,20));\r
             jTextFieldUrl.setPreferredSize(new java.awt.Dimension(320, 20));\r
             jTextFieldUrl.addFocusListener(new FocusAdapter(){\r
                public void focusLost(FocusEvent e){\r
@@ -452,6 +461,53 @@ public class SpdHeader extends IInternalFrame {
         return jTextFieldUrl;\r
     }\r
 \r
+    /**\r
+     * This method initializes jCheckBoxRdOnly \r
+     *         \r
+     * @return javax.swing.JCheckBox   \r
+     */\r
+    private JCheckBox getJCheckBoxRdOnly() {\r
+        if (jCheckBoxRdOnly == null) {\r
+            jCheckBoxRdOnly = new JCheckBox();\r
+            jCheckBoxRdOnly.setText("Read Only");\r
+            jCheckBoxRdOnly.setLocation(new java.awt.Point(17,408));\r
+            jCheckBoxRdOnly.setSize(new java.awt.Dimension(138,20));\r
+            jCheckBoxRdOnly.setPreferredSize(new java.awt.Dimension(150,20));\r
+            jCheckBoxRdOnly.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (docConsole != null) {\r
+                        docConsole.setSaved(false);\r
+                    }\r
+                    sfc.setSpdPkgDefsRdOnly(jCheckBoxRdOnly.isSelected()+"");\r
+                }\r
+            });\r
+        }\r
+        return jCheckBoxRdOnly;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jCheckBoxRePkg  \r
+     *         \r
+     * @return javax.swing.JCheckBox   \r
+     */\r
+    private JCheckBox getJCheckBoxRePkg() {\r
+        if (jCheckBoxRePkg == null) {\r
+            jCheckBoxRePkg = new JCheckBox();\r
+            jCheckBoxRePkg.setLocation(new java.awt.Point(16,444));\r
+            jCheckBoxRePkg.setText("RePackagable");\r
+            jCheckBoxRePkg.setSize(new java.awt.Dimension(140,20));\r
+            jCheckBoxRePkg.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (docConsole != null) {\r
+                        docConsole.setSaved(false);\r
+                    }\r
+                    sfc.setSpdPkgDefsRePkg(jCheckBoxRePkg.isSelected()+"");\r
+                }\r
+            });\r
+        }\r
+        return jCheckBoxRePkg;\r
+    }\r
+\r
     public static void main(String[] args) {\r
         new SpdHeader().setVisible(true);\r
     }\r
@@ -531,9 +587,17 @@ public class SpdHeader extends IInternalFrame {
             \r
             if (!sfc.getSpdPkgDefsRdOnly().equals("true")) {\r
                 sfc.setSpdPkgDefsRdOnly("false");\r
+                jCheckBoxRdOnly.setSelected(false);\r
+            }\r
+            else{\r
+                jCheckBoxRdOnly.setSelected(true);\r
             }\r
             if (!sfc.getSpdPkgDefsRePkg().equals("true")) {\r
                 sfc.setSpdPkgDefsRePkg("false");\r
+                jCheckBoxRePkg.setSelected(false);\r
+            }\r
+            else{\r
+                jCheckBoxRePkg.setSelected(true);\r
             }\r
             \r
     }\r
@@ -546,28 +610,32 @@ public class SpdHeader extends IInternalFrame {
      **/\r
     private JPanel getJContentPane() {\r
         if (jContentPane == null) {\r
+               starLabel1 = new StarLabel();\r
+               starLabel1.setBounds(new java.awt.Rectangle(2,443,10,20));\r
+               starLabel = new StarLabel();\r
+               starLabel.setBounds(new java.awt.Rectangle(2,407,10,20));\r
                jLabel = new JLabel();\r
-               jLabel.setBounds(new java.awt.Rectangle(16,195,140,20));\r
+               jLabel.setBounds(new java.awt.Rectangle(16,231,140,20));\r
                jLabel.setText("URL");\r
                jContentPane = new JPanel();\r
             jContentPane.setLayout(null);\r
             jContentPane.setLocation(new java.awt.Point(0, 0));\r
             jContentPane.setPreferredSize(new java.awt.Dimension(500, 524));\r
             jLabelAbstract = new JLabel();\r
-            jLabelAbstract.setBounds(new java.awt.Rectangle(16,245,140,20));\r
+            jLabelAbstract.setBounds(new java.awt.Rectangle(16,281,140,20));\r
             jLabelAbstract.setText("Description");\r
             jLabelSpecification = new JLabel();\r
             jLabelSpecification.setText("Specification");\r
-            jLabelSpecification.setBounds(new java.awt.Rectangle(16,330,140,20));\r
+            jLabelSpecification.setBounds(new java.awt.Rectangle(16,369,140,20));\r
             jLabelDescription = new JLabel();\r
             jLabelDescription.setText("Abstract");\r
-            jLabelDescription.setBounds(new java.awt.Rectangle(16,220,140,20));\r
+            jLabelDescription.setBounds(new java.awt.Rectangle(16,256,140,20));\r
             jLabelCopyright = new JLabel();\r
             jLabelCopyright.setText("Copyright");\r
             jLabelCopyright.setBounds(new java.awt.Rectangle(15,86,140,20));\r
             jLabelLicense = new JLabel();\r
             jLabelLicense.setText("License");\r
-            jLabelLicense.setBounds(new java.awt.Rectangle(16,110,140,20));\r
+            jLabelLicense.setBounds(new java.awt.Rectangle(16,147,140,20));\r
             jLabelVersion = new JLabel();\r
             jLabelVersion.setText("Version");\r
             jLabelVersion.setBounds(new java.awt.Rectangle(15, 60, 140, 20));\r
@@ -603,16 +671,16 @@ public class SpdHeader extends IInternalFrame {
             jStarLabel3 = new StarLabel();\r
             jStarLabel3.setLocation(new java.awt.Point(0, 60));\r
             jStarLabel4 = new StarLabel();\r
-            jStarLabel4.setLocation(new java.awt.Point(1,110));\r
+            jStarLabel4.setLocation(new java.awt.Point(1,147));\r
             jStarLabel5 = new StarLabel();\r
             jStarLabel5.setLocation(new java.awt.Point(0,86));\r
             jStarLabel6 = new StarLabel();\r
-            jStarLabel6.setLocation(new java.awt.Point(1,220));\r
+            jStarLabel6.setLocation(new java.awt.Point(1,256));\r
             jStarLabel7 = new StarLabel();\r
-            jStarLabel7.setLocation(new java.awt.Point(1,330));\r
+            jStarLabel7.setLocation(new java.awt.Point(1,369));\r
             jStarLabel7.setEnabled(false);\r
             jStarLabel9 = new StarLabel();\r
-            jStarLabel9.setLocation(new java.awt.Point(1,245));\r
+            jStarLabel9.setLocation(new java.awt.Point(1,281));\r
             jContentPane.add(jStarLabel1, null);\r
             jContentPane.add(jStarLabel2, null);\r
             jContentPane.add(jStarLabel3, null);\r
@@ -625,6 +693,10 @@ public class SpdHeader extends IInternalFrame {
 \r
             jContentPane.add(jLabel, null);\r
             jContentPane.add(getJTextFieldUrl(), null);\r
+            jContentPane.add(starLabel, null);\r
+            jContentPane.add(starLabel1, null);\r
+            jContentPane.add(getJCheckBoxRdOnly(), null);\r
+            jContentPane.add(getJCheckBoxRePkg(), null);\r
         }\r
         return jContentPane;\r
     }\r