+++ /dev/null
-/** @file\r
- UIAction class.\r
-\r
- This class is the parent action class of UI wizard.\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.build.pcd.action;\r
-\r
-import org.tianocore.build.pcd.exception.UIException;\r
-\r
-/** This class is the parent class for all UI wizard action.\r
-**/\r
-public abstract class UIAction {\r
- ///\r
- /// original message level. when finish this action, original \r
- /// message level will be restored.\r
- ///\r
- private int originalMessageLevel;\r
-\r
- /**\r
- Check the parameter for this aciton.\r
- \r
- This function will be overrided by child class.\r
- **/\r
- abstract void checkParamter() throws UIException;\r
-\r
- /**\r
- Perform action.\r
- \r
- This function will be overrided by child class.\r
- **/\r
- abstract void performAction() throws UIException;\r
-\r
- /**\r
- set the message level for this action.\r
-\r
- @param messageLevel message level wanted.\r
- **/\r
- public void setMessageLevel(int messageLevel) {\r
- originalMessageLevel = ActionMessage.messageLevel;\r
- ActionMessage.messageLevel = messageLevel;\r
- }\r
-\r
- /**\r
- log message for UI wizard aciton.\r
-\r
- @param actionObj aciton instance object.\r
- @param logStr log message string\r
- **/\r
- public static void logMsg(Object actionObj, String logStr) {\r
- System.out.println(logStr);\r
- }\r
-\r
- /**\r
- Warning message for UI wizard action.\r
-\r
- @param warningObj action instance object.\r
- @param warningStr warning message string.\r
- **/\r
- public static void warningMsg(Object warningObj, String warningStr) {\r
- System.out.println(warningStr);\r
- }\r
-\r
- /**\r
- Entry function for all UI wizard actions.\r
- **/\r
- public void execute() throws UIException {\r
- checkParamter();\r
- performAction();\r
-\r
- ActionMessage.messageLevel = originalMessageLevel;\r
- }\r
-}\r