+++ /dev/null
-/** @file\r
- \r
- The file is used to override Dialog to provides customized interfaces \r
- \r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
- \r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
- \r
- **/\r
-\r
-package org.tianocore.packaging.common.ui;\r
-\r
-import java.awt.Dimension;\r
-import java.awt.Toolkit;\r
-import java.awt.event.ActionEvent;\r
-import java.awt.event.ActionListener;\r
-\r
-import javax.swing.JDialog;\r
-\r
-/**\r
- The class is used to override Dialog to provides customized interfaces\r
- It extends JDialog implements ActionListener\r
- \r
- @since ModuleEditor 1.0\r
- \r
- **/\r
-public class IDialog extends JDialog implements ActionListener {\r
- ///\r
- /// Define class Serial Version UID\r
- ///\r
- private static final long serialVersionUID = -7692623863358631984L;\r
- //\r
- //Define class members\r
- //\r
- private boolean isEdited = false;\r
-\r
- public void actionPerformed(ActionEvent arg0) {\r
- // TODO Auto-generated method stub\r
-\r
- }\r
-\r
- /**\r
- Main class, used for test\r
- \r
- @param args\r
- \r
- **/\r
- public static void main(String[] args) {\r
- IDialog id = new IDialog();\r
- id.setVisible(true);\r
- }\r
-\r
- /**\r
- This is the default constructor\r
- **/\r
- public IDialog() {\r
- super();\r
- initialize();\r
- }\r
-\r
- /**\r
- * This is the override constructor\r
- */\r
- /**\r
- This is the override constructor\r
- \r
- @param parentFrame The parent frame which open the dialog\r
- @param modal true means the dialog is modal dialog; false means the dialog is not modal dialog\r
- **/\r
- public IDialog(IFrame parentFrame, boolean modal) {\r
- super(parentFrame, modal);\r
- initialize();\r
- }\r
-\r
- /**\r
- This method initializes this\r
- \r
- **/\r
- private void initialize() {\r
- this.setResizable(false);\r
- }\r
-\r
- /**\r
- Start the dialog at the center of screen\r
- \r
- @param intWidth The width of the dialog\r
- @param intHeight The height of the dialog\r
- \r
- **/\r
- protected void centerWindow(int intWidth, int intHeight) {\r
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();\r
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);\r
- }\r
-\r
- /**\r
- Start the dialog at the center of screen\r
- \r
- **/\r
- protected void centerWindow() {\r
- centerWindow(this.getSize().width, this.getSize().height);\r
- }\r
-\r
- /**\r
- Get if the dialog has been edited\r
- \r
- @retval true - The dialog has been edited\r
- @retval false - The dialog hasn't been edited\r
- \r
- **/\r
- public boolean isEdited() {\r
- return isEdited;\r
- }\r
-\r
- /**\r
- Set if the dialog has been edited\r
- \r
- @param isEdited The input data which identify if the dialog has been edited\r
- \r
- **/\r
- public void setEdited(boolean isEdited) {\r
- this.isEdited = isEdited;\r
- }\r
-\r
- /**\r
- Check the input data is empty or not\r
- \r
- @param strValue The input data which need be checked\r
- \r
- @retval true - The input data is empty\r
- @retval fals - The input data is not empty\r
- \r
- **/\r
- public boolean isEmpty(String strValue) {\r
- if (strValue.length() > 0) {\r
- return false;\r
- }\r
- return true;\r
- }\r
-}\r