summaryrefslogtreecommitdiff
path: root/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
diff options
context:
space:
mode:
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 05:03:19 +0000
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 05:03:19 +0000
commita929458e6682db26d87d4ebe80150e13820d3e50 (patch)
treee7a77846d6f711ad749c05d109f900462a5f4105 /Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
parentccb063b1f27dcc84d67fa82592dd79b7e0be1e3f (diff)
downloadedk2-platforms-a929458e6682db26d87d4ebe80150e13820d3e50.tar.xz
1. Change ToolCode from text field to drop down list, and user can enter their customizing tool command.
2. Fix some coding style issue git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1133 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java')
-rw-r--r--Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java762
1 files changed, 379 insertions, 383 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
index 9323ac3898..0761d30693 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
@@ -45,432 +45,428 @@ import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
*/
public class VariablesDlg extends IDialog {
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -6998982978030439446L;
+ // /
+ // / Define class Serial Version UID
+ // /
+ private static final long serialVersionUID = -6998982978030439446L;
- //
- // Define class members
- //
- private JPanel jContentPane = null;
+ //
+ // Define class members
+ //
+ private JPanel jContentPane = null;
- private JLabel jLabelVariableName = null;
+ private JLabel jLabelVariableName = null;
- private JTextField jTextFieldVariableName = null;
+ private JTextField jTextFieldVariableName = null;
- private JLabel jLabelUsage = null;
+ private JLabel jLabelUsage = null;
- private JComboBox jComboBoxUsage = null;
+ private JComboBox jComboBoxUsage = null;
- private StarLabel jStarLabel1 = null;
+ private StarLabel jStarLabel1 = null;
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
+ private StarLabel jStarLabel2 = null;
- private JScrollPane jScrollPane = null;
+ private StarLabel jStarLabel3 = null;
- private JLabel jLabelGuidCName = null;
+ private JScrollPane jScrollPane = null;
- private JComboBox jComboBoxGuidC_Name = null;
+ private JLabel jLabelGuidCName = null;
- private JTextField jTextFieldFeatureFlag = null;
+ private JComboBox jComboBoxGuidC_Name = null;
- private JLabel jLabelFeatureFlag = null;
+ private JTextField jTextFieldFeatureFlag = null;
- private JLabel jLabelArch = null;
+ private JLabel jLabelFeatureFlag = null;
- private JLabel jLabelHelpText = null;
+ private JLabel jLabelArch = null;
- private JTextArea jTextAreaHelpText = null;
+ private JLabel jLabelHelpText = null;
- private JScrollPane jScrollPaneHelpText = null;
+ private JTextArea jTextAreaHelpText = null;
- private ArchCheckBox jArchCheckBox = null;
+ private JScrollPane jScrollPaneHelpText = null;
- private JButton jButtonOk = null;
+ private ArchCheckBox jArchCheckBox = null;
- private JButton jButtonCancel = null;
+ private JButton jButtonOk = null;
- //
- // Not used by UI
- //
- private VariablesIdentification id = null;
+ private JButton jButtonCancel = null;
- private EnumerationData ed = new EnumerationData();
+ //
+ // Not used by UI
+ //
+ private VariablesIdentification id = null;
+
+ private EnumerationData ed = new EnumerationData();
+
+ private WorkspaceTools wt = new WorkspaceTools();
+
+ /**
+ * This method initializes jTextFieldString
+ *
+ * @return javax.swing.JTextField jTextFieldString
+ *
+ */
+ private JTextField getJTextFieldString() {
+ if (jTextFieldVariableName == null) {
+ jTextFieldVariableName = new JTextField();
+ jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));
+ jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));
+ jTextFieldVariableName.setLocation(new java.awt.Point(160, 10));
+ jTextFieldVariableName
+ .setToolTipText("Enter a Hex Word Array, you must provide leading Zeros. 0x000a, 0x0010, 0x00FF");
+ }
+ return jTextFieldVariableName;
+ }
- private WorkspaceTools wt = new WorkspaceTools();
+ /**
+ * This method initializes jComboBoxUsage
+ *
+ * @return javax.swing.JComboBox jComboBoxUsage
+ *
+ */
+ private JComboBox getJComboBoxUsage() {
+ if (jComboBoxUsage == null) {
+ jComboBoxUsage = new JComboBox();
+ jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
+ jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
+ jComboBoxUsage
+ .setToolTipText("<html><table>"
+ + "<tr><td>ALWAYS_CONSUMED</td><td>The module requires the variable entry to be set</td></tr>"
+ + "<tr><td>SOMETIMES_CONSUMED</td><td>The module will use the variable entry if it is set.</td></tr>"
+ + "<tr><td>ALWAYS_PRODUCED</td><td>The module will always write the variable.</td></tr>"
+ + "<tr><td>SOMETIMES_PRODUCED</td><td>The module will sometimes write the variable.</td></tr>"
+ + "</table></html>");
+ }
+ return jComboBoxUsage;
+ }
- /**
- * This method initializes jTextFieldString
- *
- * @return javax.swing.JTextField jTextFieldString
- *
- */
- private JTextField getJTextFieldString() {
- if (jTextFieldVariableName == null) {
- jTextFieldVariableName = new JTextField();
- jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));
- jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldVariableName.setLocation(new java.awt.Point(160, 10));
- jTextFieldVariableName
- .setToolTipText("Enter a Hex Word Array, you must provide leading Zeros. 0x000a, 0x0010, 0x00FF");
+ /**
+ * This method initializes jScrollPane
+ *
+ * @return javax.swing.JScrollPane
+ */
+ private JScrollPane getJScrollPane() {
+ if (jScrollPane == null) {
+ jScrollPane = new JScrollPane();
+ jScrollPane.setViewportView(getJContentPane());
+ }
+ return jScrollPane;
}
- return jTextFieldVariableName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table><tr><td>ALWAYS_CONSUMED</td><td>The module requires the variable entry to be set</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>The module will use the variable entry if it’s set.</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>The module will always write the variable.</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>The module will sometimes write the variable.</td></tr></table></html>");
+
+ /**
+ * This method initializes jTextFieldFeatureFlag
+ *
+ * @return javax.swing.JTextField jTextFieldFeatureFlag
+ *
+ */
+ private JTextField getJTextFieldFeatureFlag() {
+ if (jTextFieldFeatureFlag == null) {
+ jTextFieldFeatureFlag = new JTextField();
+ jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 130, 320, 20));
+ jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
+ jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
+ }
+ return jTextFieldFeatureFlag;
}
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
+
+ /**
+ * This method initializes jTextFieldHelpText
+ *
+ * @return javax.swing.JTextField
+ *
+ */
+ private JTextArea getJTextAreaHelpText() {
+ if (jTextAreaHelpText == null) {
+ jTextAreaHelpText = new JTextArea();
+ jTextAreaHelpText.setLineWrap(true);
+ jTextAreaHelpText.setWrapStyleWord(true);
+ jTextAreaHelpText.setToolTipText("Enter information on how to use this Variable.");
+ }
+ return jTextAreaHelpText;
}
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag
- .setBounds(new java.awt.Rectangle(160, 130, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
+
+ private JScrollPane getJScrollPaneHelpText() {
+ if (jScrollPaneHelpText == null) {
+ jScrollPaneHelpText = new JScrollPane();
+ jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+ jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
+ jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
+ jScrollPaneHelpText.setLocation(new java.awt.Point(160, 85));
+ jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
+ }
+ return jScrollPaneHelpText;
}
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextFieldHelpText
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- jTextAreaHelpText
- .setToolTipText("Enter information on how to use this Variable.");
+
+ /**
+ * This method initializes jComboBoxGuidC_Name
+ *
+ * @return javax.swing.JComboBox jComboBoxGuidC_Name
+ *
+ */
+ private JComboBox getJComboBoxGuidC_Name() {
+ if (jComboBoxGuidC_Name == null) {
+ jComboBoxGuidC_Name = new JComboBox();
+ jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
+ jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
+ jComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Variable.");
+ }
+ return jComboBoxGuidC_Name;
}
- return jTextAreaHelpText;
- }
-
-
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320,40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320,40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(160,85));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
+
+ /**
+ * This method initializes jButtonOk
+ *
+ * @return javax.swing.JButton
+ *
+ */
+ private JButton getJButtonOk() {
+ if (jButtonOk == null) {
+ jButtonOk = new JButton();
+ jButtonOk.setBounds(new java.awt.Rectangle(290, 182, 90, 20));
+ jButtonOk.setText("Ok");
+ jButtonOk.addActionListener(this);
+ }
+ return jButtonOk;
}
- return jScrollPaneHelpText;
- }
- /**
- * This method initializes jComboBoxGuidC_Name
- *
- * @return javax.swing.JComboBox jComboBoxGuidC_Name
- *
- */
- private JComboBox getJComboBoxGuidC_Name() {
- if (jComboBoxGuidC_Name == null) {
- jComboBoxGuidC_Name = new JComboBox();
- jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
- jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxGuidC_Name
- .setToolTipText("Select the GUID C Name of the Variable.");
+
+ /**
+ * This method initializes jButtonCancel
+ *
+ * @return javax.swing.JButton
+ *
+ */
+ private JButton getJButtonCancel() {
+ if (jButtonCancel == null) {
+ jButtonCancel = new JButton();
+ jButtonCancel.setBounds(new java.awt.Rectangle(390, 182, 90, 20));
+ jButtonCancel.setText("Cancel");
+ jButtonCancel.addActionListener(this);
+ }
+ return jButtonCancel;
+ }
+
+ public static void main(String[] args) {
+
}
- return jComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 182, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
+
+ /**
+ * This method initializes this
+ *
+ */
+ private void init() {
+ this.setSize(500, 255);
+ this.setContentPane(getJScrollPane());
+ this.setTitle("Variables");
+ initFrame();
+ this.setViewMode(false);
+ this.centerWindow();
}
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 182, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
+
+ /**
+ * This method initializes this Fill values to all fields if these values are
+ * not empty
+ *
+ * @param inVariablesId
+ *
+ */
+ private void init(VariablesIdentification inVariablesId) {
+ init();
+ this.id = inVariablesId;
+
+ if (this.id != null) {
+ this.jTextFieldVariableName.setText(id.getName());
+ this.jComboBoxGuidC_Name.setSelectedItem(id.getGuid());
+ this.jComboBoxUsage.setSelectedItem(id.getUsage());
+ this.jTextAreaHelpText.setText(id.getHelp());
+ this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
+ this.jArchCheckBox.setSelectedItems(id.getSupArchList());
+ }
}
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(500, 255);
- this.setContentPane(getJScrollPane());
- this.setTitle("Variables");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inVariablesId
- *
- */
- private void init(VariablesIdentification inVariablesId) {
- init();
- this.id = inVariablesId;
-
- if (this.id != null) {
- this.jTextFieldVariableName.setText(id.getName());
- this.jComboBoxGuidC_Name.setSelectedItem(id.getGuid());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
+
+ /**
+ * This is the override edit constructor
+ *
+ * @param inVariablesIdentification
+ * @param iFrame
+ *
+ */
+ public VariablesDlg(VariablesIdentification inVariablesIdentification, IFrame iFrame) {
+ super(iFrame, true);
+ init(inVariablesIdentification);
}
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inVariablesIdentification
- * @param iFrame
- *
- */
- public VariablesDlg(VariablesIdentification inVariablesIdentification,
- IFrame iFrame) {
- super(iFrame, true);
- init(inVariablesIdentification);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldVariableName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
+
+ /**
+ * Disable all components when the mode is view
+ *
+ * @param isView
+ * true - The view mode; false - The non-view mode
+ *
+ */
+ public void setViewMode(boolean isView) {
+ if (isView) {
+ this.jTextFieldVariableName.setEnabled(!isView);
+ this.jComboBoxUsage.setEnabled(!isView);
+ }
}
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 10));
- jLabelVariableName = new JLabel();
- jLabelVariableName.setText("Variable Name");
- jLabelVariableName.setBounds(new java.awt.Rectangle(15, 10, 145, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 35));
- jLabelGuidCName = new JLabel();
- jLabelGuidCName.setBounds(new java.awt.Rectangle(15, 35, 145, 20));
- jLabelGuidCName.setText("Variable Guid C Name");
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 60));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(15, 60, 145, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(14, 85, 145, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(15, 155, 145, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(160, 155, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 210));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelVariableName, null);
- jContentPane.add(getJTextFieldString(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelGuidCName, null);
- jContentPane.add(getJComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
+
+ /**
+ * This method initializes jContentPane
+ *
+ * @return javax.swing.JPanel jContentPane
+ *
+ */
+ private JPanel getJContentPane() {
+ if (jContentPane == null) {
+ jStarLabel1 = new StarLabel();
+ jStarLabel1.setLocation(new java.awt.Point(2, 10));
+ jLabelVariableName = new JLabel();
+ jLabelVariableName.setText("Variable Name");
+ jLabelVariableName.setBounds(new java.awt.Rectangle(15, 10, 145, 20));
+
+ jStarLabel2 = new StarLabel();
+ jStarLabel2.setLocation(new java.awt.Point(2, 35));
+ jLabelGuidCName = new JLabel();
+ jLabelGuidCName.setBounds(new java.awt.Rectangle(15, 35, 145, 20));
+ jLabelGuidCName.setText("Variable Guid C Name");
+
+ jStarLabel3 = new StarLabel();
+ jStarLabel3.setLocation(new java.awt.Point(2, 60));
+ jLabelUsage = new JLabel();
+ jLabelUsage.setText("Usage");
+ jLabelUsage.setBounds(new java.awt.Rectangle(15, 60, 145, 20));
+
+ jLabelHelpText = new JLabel();
+ jLabelHelpText.setBounds(new java.awt.Rectangle(14, 85, 145, 20));
+ jLabelHelpText.setText("Help Text");
+
+ jLabelFeatureFlag = new JLabel();
+ jLabelFeatureFlag.setText("Feature Flag Expression");
+ jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 130, 145, 20));
+
+ jLabelArch = new JLabel();
+ jLabelArch.setBounds(new java.awt.Rectangle(15, 155, 145, 20));
+ jLabelArch.setText("Supported Architectures");
+ jArchCheckBox = new ArchCheckBox();
+ jArchCheckBox.setBounds(new java.awt.Rectangle(160, 155, 320, 20));
+ jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
+
+ jContentPane = new JPanel();
+ jContentPane.setLayout(null);
+ jContentPane.setPreferredSize(new java.awt.Dimension(485, 210));
+
+ jContentPane.add(jStarLabel1, null);
+ jContentPane.add(jLabelVariableName, null);
+ jContentPane.add(getJTextFieldString(), null);
+ jContentPane.add(jStarLabel2, null);
+ jContentPane.add(jLabelGuidCName, null);
+ jContentPane.add(getJComboBoxGuidC_Name(), null);
+ jContentPane.add(jStarLabel3, null);
+ jContentPane.add(jLabelUsage, null);
+ jContentPane.add(getJComboBoxUsage(), null);
+ jContentPane.add(jLabelHelpText, null);
+ jContentPane.add(getJScrollPaneHelpText(), null);
+ jContentPane.add(jLabelFeatureFlag, null);
+ jContentPane.add(getJTextFieldFeatureFlag(), null);
+ jContentPane.add(jLabelArch, null);
+ jContentPane.add(jArchCheckBox, null);
+ jContentPane.add(getJButtonOk(), null);
+ jContentPane.add(getJButtonCancel(), null);
+ }
+ return jContentPane;
}
- return jContentPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentVariables();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ *
+ * Override actionPerformed to listen all actions
+ *
+ */
+ public void actionPerformed(ActionEvent arg0) {
+ if (arg0.getSource() == jButtonOk) {
+ if (checkAdd()) {
+ getCurrentVariables();
+ this.returnType = DataType.RETURN_TYPE_OK;
+ this.setVisible(false);
+ }
+ }
+
+ if (arg0.getSource() == jButtonCancel) {
+ this.returnType = DataType.RETURN_TYPE_CANCEL;
+ this.setVisible(false);
+ }
}
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
+ /**
+ * This method initializes Usage type
+ *
+ */
+ private void initFrame() {
+ Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
+ Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());
}
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
- Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt
- .getAllGuidDeclarationsFromWorkspace());
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
- //
- // Check VariableName
- //
- if (isEmpty(this.jTextFieldVariableName.getText())) {
- Log.wrn("Update Variables", "Variable Name must not be empty");
- return false;
+ /**
+ * Data validation for all fields
+ *
+ * @retval true - All datas are valid
+ * @retval false - At least one data is invalid
+ *
+ */
+ public boolean checkAdd() {
+ //
+ // Check if all fields have correct data types
+ //
+
+ //
+ // Check VariableName
+ //
+ if (isEmpty(this.jTextFieldVariableName.getText())) {
+ Log.wrn("Update Variables", "Variable Name must not be empty");
+ return false;
+ }
+
+ if (!isEmpty(this.jTextFieldVariableName.getText())) {
+ if (!DataValidation.isHexWordArrayType(this.jTextFieldVariableName.getText())) {
+ Log.wrn("Update Variables", "Incorrect data type for Variable Name");
+ return false;
+ }
+ }
+
+ //
+ // Check FeatureFlag
+ //
+ if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
+ if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
+ Log.wrn("Update Variables", "Incorrect data type for Feature Flag");
+ return false;
+ }
+ }
+
+ return true;
}
- if (!isEmpty(this.jTextFieldVariableName.getText())) {
- if (!DataValidation.isHexWordArrayType(this.jTextFieldVariableName
- .getText())) {
- Log.wrn("Update Variables", "Incorrect data type for Variable Name");
- return false;
- }
+ private VariablesIdentification getCurrentVariables() {
+ String arg0 = this.jTextFieldVariableName.getText();
+ String arg1 = this.jComboBoxGuidC_Name.getSelectedItem().toString();
+ String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
+
+ String arg3 = this.jTextFieldFeatureFlag.getText();
+ Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
+ String arg5 = this.jTextAreaHelpText.getText();
+
+ id = new VariablesIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ return id;
}
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Variables", "Incorrect data type for Feature Flag");
- return false;
- }
+ public VariablesIdentification getId() {
+ return id;
}
- return true;
- }
-
- private VariablesIdentification getCurrentVariables() {
- String arg0 = this.jTextFieldVariableName.getText();
- String arg1 = this.jComboBoxGuidC_Name.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
-
- id = new VariablesIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- public VariablesIdentification getId() {
- return id;
- }
-
- public void setId(VariablesIdentification id) {
- this.id = id;
- }
+ public void setId(VariablesIdentification id) {
+ this.id = id;
+ }
}