package org.tianocore.frameworkwizard.packaging.ui;\r
\r
import java.awt.Dimension;\r
+import java.awt.Point;\r
import java.awt.event.ActionEvent;\r
import java.awt.event.ComponentEvent;\r
import java.util.Vector;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
import org.tianocore.frameworkwizard.platform.ui.ListEditor;\r
+import org.tianocore.frameworkwizard.platform.ui.LongTextEditor;\r
\r
/**\r
GUI for create library definition elements of spd file.\r
\r
protected String[][] saa = null;\r
\r
+ protected StarLabel starLabel = null;\r
+\r
/**\r
This method initializes this\r
\r
model.addColumn("Supported Module Types");\r
model.addColumn("GuidTypes");\r
jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());\r
+ jTable.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor());\r
\r
Vector<String> vArch = new Vector<String>();\r
vArch.add("IA32");\r
vGuid.add("HII_PACKAGE_LIST");\r
vGuid.add("HOB");\r
vGuid.add("TOKEN_SPACE_GUID");\r
- jTable.getColumnModel().getColumn(6).setCellEditor(new ListEditor(vGuid));\r
+ ListEditor le = new ListEditor(vGuid);\r
+ le.setCanNotBeEmpty(true);\r
+ jTable.getColumnModel().getColumn(6).setCellEditor(le);\r
\r
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
if (cellData.equals(sa[column])) {\r
return;\r
}\r
+ \r
if (cellData.toString().length() == 0 && sa[column] == null) {\r
return;\r
}\r
**/\r
protected JPanel getJContentPane1() {\r
if (jContentPane == null) {\r
+ \r
jLabelGuidType = new JLabel();\r
- jLabelGuidType.setBounds(new java.awt.Rectangle(400,122,103,16));\r
+ jLabelGuidType.setBounds(new java.awt.Rectangle(420,122,103,16));\r
jLabelGuidType.setText("GUID Type List");\r
jLabelGuidType.setEnabled(true);\r
+ starLabel = new StarLabel();\r
+ starLabel.setLocation(new Point(jLabelGuidType.getX() - 20, jLabelGuidType.getY()));\r
+ starLabel.setVisible(true);\r
jLabelSupArch = new JLabel();\r
jLabelSupArch.setBounds(new java.awt.Rectangle(197,122,108,16));\r
jLabelSupArch.setText("Supported Arch");\r
jContentPane.add(getJScrollPaneGuid(), null);\r
jContentPane.add(getJScrollPaneModule(), null);\r
jContentPane.add(jLabelGuidType, null);\r
+ jContentPane.add(starLabel, null);\r
}\r
return jContentPane;\r
}\r
vguidType = null;\r
}\r
if (vguidType == null) {\r
- JOptionPane.showMessageDialog(this, "You must select one GUID type.");\r
+ JOptionPane.showMessageDialog(this, "You must select at least one GUID type.");\r
return -1;\r
}\r
if (docConsole != null) {\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
import org.tianocore.frameworkwizard.platform.ui.ListEditor;\r
+import org.tianocore.frameworkwizard.platform.ui.LongTextEditor;\r
import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
\r
model.addColumn("Supported Architectures");\r
model.addColumn("Supported Module Types");\r
\r
+ jTable.getColumnModel().getColumn(cnHelpText).setCellEditor(new LongTextEditor());\r
+ \r
Vector<String> vArch = new Vector<String>();\r
vArch.add("IA32");\r
vArch.add("X64");\r
import javax.swing.JCheckBox;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
import org.tianocore.frameworkwizard.platform.ui.ListEditor;\r
+import org.tianocore.frameworkwizard.platform.ui.LongTextEditor;\r
\r
import java.awt.Rectangle;\r
import java.util.Vector;\r
jComboBoxDataType.addItem("BOOLEAN");\r
TableColumn dataTypeColumn = jTable.getColumnModel().getColumn(3);\r
dataTypeColumn.setCellEditor(new DefaultCellEditor(jComboBoxDataType));\r
+ \r
+ jTable.getColumnModel().getColumn(5).setCellEditor(new LongTextEditor());\r
\r
Vector<String> vArch = new Vector<String>();\r
vArch.add("IA32");\r
return;\r
}\r
if (column <= 10 && column >= 6) {\r
- if (compareTwoVectors(stringToVector(usage), stringToVector(sa[6]))) {\r
+ Vector<String> v = stringToVector(usage);\r
+ if (compareTwoVectors(v, stringToVector(sa[6]))) {\r
+ return;\r
+ }\r
+ if (v.contains("FEATURE_FLAG") && v.size() > 1) {\r
+ JOptionPane.showMessageDialog(frame, "Usage Feature Flag can NOT co-exist with others.");\r
return;\r
}\r
}\r
}\r
\r
protected Vector<String> stringToVector(String s){\r
+ Vector<String> v = new Vector<String>();\r
if (s == null) {\r
- return null;\r
+ return v;\r
}\r
String[] sArray = s.split(" ");\r
- Vector<String> v = new Vector<String>();\r
+ \r
for (int i = 0; i < sArray.length; ++i) {\r
v.add(sArray[i]);\r
}\r
\r
import org.tianocore.PackageSurfaceAreaDocument;\r
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;\r
+import org.tianocore.frameworkwizard.platform.ui.ListEditor;\r
\r
/**\r
GUI for create library definition elements of spd file.\r
protected void initFrame() {\r
\r
this.setTitle("PPI Declarations");\r
- \r
+ starLabel.setVisible(false);\r
+ ((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);\r
}\r
\r
protected void init(SpdFileContents sfc){\r
\r
import org.tianocore.PackageSurfaceAreaDocument;\r
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;\r
+import org.tianocore.frameworkwizard.platform.ui.ListEditor;\r
\r
/**\r
GUI for create library definition elements of spd file.\r
protected void initFrame() {\r
\r
this.setTitle("Protocol Declarations");\r
- \r
+ starLabel.setVisible(false);\r
+ ((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);\r
}\r
\r
protected void init(SpdFileContents sfc){\r
import javax.swing.AbstractCellEditor;\r
import javax.swing.JButton;\r
import javax.swing.JFrame;\r
+import javax.swing.JOptionPane;\r
import javax.swing.JTable;\r
import javax.swing.table.TableCellEditor;\r
\r
* \r
*/\r
private static final long serialVersionUID = 1L;\r
+ private boolean canNotBeEmpty = false;\r
String archs;\r
JButton button;\r
static JFrame frame;\r
}\r
else { //User pressed dialog's "OK" button.\r
Vector<String> v = dialog.getList();\r
+ if (canNotBeEmpty && v.size() == 0) {\r
+ JOptionPane.showMessageDialog(frame, "You must select at least one item.");\r
+ return;\r
+ }\r
String s = " ";\r
for (int i = 0; i < v.size(); ++i) {\r
s += v.get(i);\r
\r
}\r
\r
+ /**\r
+ * @param canNotBeEmpty The canNotBeEmpty to set.\r
+ */\r
+ public void setCanNotBeEmpty(boolean canNotBeEmpty) {\r
+ this.canNotBeEmpty = canNotBeEmpty;\r
+ }\r
+\r
}\r