From 9c6db9eaf72da627ce049f72451399565bbf2d38 Mon Sep 17 00:00:00 2001 From: klu2 Date: Sat, 8 Jul 2006 05:32:46 +0000 Subject: Remove unused PCD file. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@831 6f19259b-4bc3-4df7-8a09-765794883524 --- .../tianocore/build/pcd/action/ActionMessage.java | 7 - .../build/pcd/action/ShowPCDDatabaseAction.java | 131 ---------------- .../org/tianocore/build/pcd/action/UIAction.java | 83 ----------- .../org/tianocore/build/pcd/entity/Token.java | 3 +- .../tianocore/build/pcd/ui/PCDDatabaseFrame.java | 166 --------------------- 5 files changed, 2 insertions(+), 388 deletions(-) delete mode 100644 Tools/Source/GenBuild/org/tianocore/build/pcd/action/ShowPCDDatabaseAction.java delete mode 100644 Tools/Source/GenBuild/org/tianocore/build/pcd/action/UIAction.java delete mode 100644 Tools/Source/GenBuild/org/tianocore/build/pcd/ui/PCDDatabaseFrame.java diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ActionMessage.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ActionMessage.java index a67d2f9e4d..d993fab6ec 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ActionMessage.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ActionMessage.java @@ -18,7 +18,6 @@ package org.tianocore.build.pcd.action; import org.apache.tools.ant.Task; import org.tianocore.build.pcd.action.BuildAction; -import org.tianocore.build.pcd.action.UIAction; /** ActionMessage class take over all message for loging and waning. This class should dispatch message into different Action class according to instance @@ -72,8 +71,6 @@ public class ActionMessage { if(thisClass instanceof Task) { BuildAction.logMsg(thisClass, "$$LOG$$:" + logStr); - } else if(thisClass instanceof UIAction) { - UIAction.logMsg(thisClass, "$$LOG$$:" + logStr); } else { System.out.println("$$LOG$$:" + logStr); } @@ -96,8 +93,6 @@ public class ActionMessage { if(thisClass instanceof Task) { BuildAction.warningMsg(thisClass, "**WARNING**:" + warningStr); - } else if(thisClass instanceof UIAction) { - UIAction.warningMsg(thisClass, "**WARNING**:" + warningStr); } else { System.out.println("**WARNING**:" + warningStr); } @@ -120,8 +115,6 @@ public class ActionMessage { if(thisClass instanceof Task) { BuildAction.logMsg(thisClass, "%%DEBUG%%:" + debugStr); - } else if(thisClass instanceof UIAction) { - UIAction.logMsg(thisClass, "%%DEBUG%%:" + debugStr); } else { System.out.println("%%DEBUG%%:" + debugStr); } diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ShowPCDDatabaseAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ShowPCDDatabaseAction.java deleted file mode 100644 index af07e55165..0000000000 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/ShowPCDDatabaseAction.java +++ /dev/null @@ -1,131 +0,0 @@ -/** @file - ShowPCDDatabase class. - - This class is the action to diplay the PCD database. - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -package org.tianocore.build.pcd.action; - -import java.io.File; - -import org.tianocore.build.global.GlobalData; -import org.tianocore.build.pcd.exception.UIException; -import org.tianocore.build.pcd.ui.PCDDatabaseFrame; - -/** This class is the action to show PCD database. -**/ -public class ShowPCDDatabaseAction extends UIAction { - /// - /// The workspace path parameter. - /// - private String workspacePath; - /// - /// The FpdfileName parameter. - /// - private String fpdFilePath; - - /** - set workspace path parameter for this action. - - @param workspacePath the string of workspace path. - **/ - public void setWorkspacePath(String workspacePath) { - this.workspacePath = workspacePath; - } - - /** - set fpd file path parameter for this action. - - @param fpdFilePath file path string - **/ - public void setFPDFilePath(String fpdFilePath) { - this.fpdFilePath = "./" + fpdFilePath; - } - - /** - check paramter for this action. - - @throw UIException wrong paramter. - **/ - void checkParamter() throws UIException { - File file = null; - - if((fpdFilePath == null) ||(workspacePath == null)) { - throw new UIException("WorkspacePath and FPDFileName should be blank for CollectPCDAtion!"); - } - - if(fpdFilePath.length() == 0 || workspacePath.length() == 0) { - throw new UIException("WorkspacePath and FPDFileName should be blank for CollectPCDAtion!"); - } - - file = new File(workspacePath); - if(!file.exists()) { - throw new UIException("WorkpacePath " + workspacePath + " does not exist!"); - } - - file = new File(fpdFilePath); - - if(!file.exists()) { - throw new UIException("FPD File " + fpdFilePath + " does not exist!"); - } - } - - /** - Core workflow function. - - @throw UIException Fail to show PCD database. - **/ - void performAction() throws UIException { - CollectPCDAction collectAction = null; - PCDDatabaseFrame dbFrame = null; - - // - // Initialize global data. - // - GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", - workspacePath,null); - - // - // Collect PCD information. - // - collectAction = new CollectPCDAction(); - - try { - collectAction.perform(workspacePath, - fpdFilePath, - ActionMessage.LOG_MESSAGE_LEVEL); - } catch(Exception exp) { - throw new UIException(exp.getMessage()); - } - - // - // Start tree windows. - // - dbFrame = new PCDDatabaseFrame(GlobalData.getPCDMemoryDBManager()); - } - - /** - Entry function. - - The action is run from command line. - - @param argv command line parameter. - **/ - public static void main(String[] argv) throws UIException { - ShowPCDDatabaseAction showAction = new ShowPCDDatabaseAction(); - //showAction.setWorkspacePath(argv[0]); - //showAction.setFPDFilePath(argv[1]); - showAction.setWorkspacePath("e:/tianocore/edk2"); - showAction.setFPDFilePath("EdkNt32Pkg/Nt32.fpd"); - showAction.execute(); - } -} diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/UIAction.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/action/UIAction.java deleted file mode 100644 index 2cde9b24ec..0000000000 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/action/UIAction.java +++ /dev/null @@ -1,83 +0,0 @@ -/** @file - UIAction class. - - This class is the parent action class of UI wizard. - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -package org.tianocore.build.pcd.action; - -import org.tianocore.build.pcd.exception.UIException; - -/** This class is the parent class for all UI wizard action. -**/ -public abstract class UIAction { - /// - /// original message level. when finish this action, original - /// message level will be restored. - /// - private int originalMessageLevel; - - /** - Check the parameter for this aciton. - - This function will be overrided by child class. - **/ - abstract void checkParamter() throws UIException; - - /** - Perform action. - - This function will be overrided by child class. - **/ - abstract void performAction() throws UIException; - - /** - set the message level for this action. - - @param messageLevel message level wanted. - **/ - public void setMessageLevel(int messageLevel) { - originalMessageLevel = ActionMessage.messageLevel; - ActionMessage.messageLevel = messageLevel; - } - - /** - log message for UI wizard aciton. - - @param actionObj aciton instance object. - @param logStr log message string - **/ - public static void logMsg(Object actionObj, String logStr) { - System.out.println(logStr); - } - - /** - Warning message for UI wizard action. - - @param warningObj action instance object. - @param warningStr warning message string. - **/ - public static void warningMsg(Object warningObj, String warningStr) { - System.out.println(warningStr); - } - - /** - Entry function for all UI wizard actions. - **/ - public void execute() throws UIException { - checkParamter(); - performAction(); - - ActionMessage.messageLevel = originalMessageLevel; - } -} diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java index 94266cda36..2a29b0c7f3 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/Token.java @@ -279,8 +279,9 @@ public class Token { usageInstance.arch, usageInstance.version)) { exceptionStr = String.format("PCD %s for module %s has already exist in database, Please check all PCD build entries "+ - "in modules PcdPeim in to make sure no duplicated definitions!", + "in modules %s in to make sure no duplicated definitions!", usageInstance.parentToken.cName, + usageInstance.moduleName, usageInstance.moduleName); throw new EntityException(exceptionStr); } diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/ui/PCDDatabaseFrame.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/ui/PCDDatabaseFrame.java deleted file mode 100644 index ed282e1b76..0000000000 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/ui/PCDDatabaseFrame.java +++ /dev/null @@ -1,166 +0,0 @@ -/** @file - PCDDatabaseFrame class. - - The class is the frame class for displaying PCD database in tree method. - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ -package org.tianocore.build.pcd.ui; - -import java.awt.*; -import java.awt.event.*; -import java.util.Map; - -import javax.swing.*; -import javax.swing.tree.DefaultMutableTreeNode; - -import org.tianocore.build.pcd.action.ActionMessage; -import org.tianocore.build.pcd.entity.MemoryDatabaseManager; -import org.tianocore.build.pcd.entity.Token; -import org.tianocore.build.pcd.entity.UsageInstance; - -/** - The class is the frame class for displaying PCD database in tree method. -**/ -public class PCDDatabaseFrame extends JFrame { - static final long serialVersionUID = -7034897190740068939L; - /// - /// Database instance - /// - private MemoryDatabaseManager dbManager; - /// - /// The token and module tree - /// - private JTree databaseTree; - - /** - Constructure function. - - Create the UI component and display frame. - - @param dbManager databaase manager instance. - **/ - public PCDDatabaseFrame(MemoryDatabaseManager dbManager) { - if (dbManager != null) { - this.dbManager = dbManager; - } - // - // Put the frame into center of desktop. - // - setLocation(100, 100); - initializeComponent(); - - setTitle("PCD View Tool"); - pack(); - setVisible(true); - } - - /** - Initliaze the UI component in Display frame. - **/ - public void initializeComponent() { - JScrollPane scrollPane = new JScrollPane(); - Container contentPane = getContentPane(); - - contentPane.setLayout(new BorderLayout()); - scrollPane.setViewportView(initializeTree()); - contentPane.add(scrollPane); - - addWindowListener(new PCDDatabaseFrameAdapter()); - } - - /** - Initiliaze the TREE control. - **/ - public JTree initializeTree() { - Token[] tokenArray = null; - Token token = null; - DefaultMutableTreeNode root = new DefaultMutableTreeNode("PCDTreeRoot"); - DefaultMutableTreeNode rootByPCD = new DefaultMutableTreeNode("By PCD"); - DefaultMutableTreeNode rootByModule = new DefaultMutableTreeNode("By Module"); - DefaultMutableTreeNode tokenNode = null; - DefaultMutableTreeNode usageNode = null; - DefaultMutableTreeNode moduleNode = null; - java.util.List moduleNames = null; - int index = 0; - int usageIndex = 0; - int moduleIndex = 0; - Object[] objectArray = null; - java.util.List usageArray = null; - UsageInstance usageInstance = null; - - root.add(rootByPCD); - // - // By PCD Node - // - - tokenArray = dbManager.getRecordArray(); - for (index = 0; index < tokenArray.length; index ++) { - token = tokenArray[index]; - ActionMessage.debug(this, token.cName); - tokenNode = new DefaultMutableTreeNode(token.cName); - tokenNode.add(new DefaultMutableTreeNode(String.format("TOKEN NUMBER: 0x%08x", token.tokenNumber))); - tokenNode.add(new DefaultMutableTreeNode("TOKEN SPACE NAME: " + token.tokenSpaceName.toString())); - tokenNode.add(new DefaultMutableTreeNode("DATUM TYPE: " +Token.getStringOfdatumType(token.datumType))); - //tokenNode.add(new DefaultMutableTreeNode("VARIABLE GUID: " + token.variableGuid.toString())); - - usageNode = new DefaultMutableTreeNode("PRODUCER"); - tokenNode.add(usageNode); - - - // - // Prepare consumer's leaf node - // - usageNode = new DefaultMutableTreeNode("CONSUMER"); - tokenNode.add(usageNode); - objectArray = token.consumers.entrySet().toArray(); - for (usageIndex = 0; usageIndex < token.consumers.size(); usageIndex ++) { - usageInstance = (UsageInstance) ((Map.Entry)objectArray[usageIndex]).getValue(); - usageNode.add(new DefaultMutableTreeNode(usageInstance.getPrimaryKey())); - } - - rootByPCD.add(tokenNode); - } - - // - // BY MODULE Node - // - root.add(rootByModule); - moduleNames = dbManager.getAllModuleArray(); - for (moduleIndex = 0; moduleIndex < moduleNames.size(); moduleIndex ++) { - ActionMessage.debug(this, "ModuleName:" + moduleNames.get(moduleIndex)); - } - for (moduleIndex = 0; moduleIndex < moduleNames.size(); moduleIndex ++) { - moduleNode = new DefaultMutableTreeNode(moduleNames.get(moduleIndex)); - usageArray = dbManager.getUsageInstanceArrayByKeyString(moduleNames.get(moduleIndex)); - for (usageIndex = 0; usageIndex < usageArray.size(); usageIndex ++) { - usageInstance = usageArray.get(usageIndex); - usageNode = new DefaultMutableTreeNode(usageInstance.parentToken.cName); - usageNode.add(new DefaultMutableTreeNode("MODULE PCD TYPE: " + Token.getStringOfpcdType(usageInstance.modulePcdType))); - moduleNode.add(usageNode); - } - rootByModule.add(moduleNode); - } - - databaseTree = new JTree(root); - return databaseTree; - } -} - -/** - The adatper class for PCDDatabaseFrame. This class instance many windows message - callback function. -**/ -class PCDDatabaseFrameAdapter extends WindowAdapter { - public void windowClosing(WindowEvent e) { - System.exit(0); - } -} -- cgit v1.2.3