1. Wrap text by word when showing a message box

2. Add "wrn" function in Log.java to save and show warning message. Most of original err messages are replaced by warning messages.
3. Add "try-catch" for double click event in main ui.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1078 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-07-24 07:43:22 +00:00
parent 6ab88a7c86
commit ed1665f268
49 changed files with 465 additions and 320 deletions

View File

@ -336,7 +336,8 @@ public class Clone extends IDialog {
this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));
initExistingPackage();
this.jButtonBrowse.setVisible(false);
this.jTextFieldFilePath.setToolTipText("Input module name here. For example, Application\\HelloWorld\\HelloWorld.msa");
this.jTextFieldFilePath
.setToolTipText("Input module name here. For example, Application\\HelloWorld\\HelloWorld.msa");
this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
this.jLabelDestinationFile.setText("New Module Path and Filename");
}
@ -357,7 +358,8 @@ public class Clone extends IDialog {
this.jTextFieldSource.setText(oldId.getPath());
this.jLabelBelong.setEnabled(false);
this.jComboBoxExistingPackage.setEnabled(false);
this.jTextFieldFilePath.setToolTipText("Select platform path here. For example, C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd");
this.jTextFieldFilePath
.setToolTipText("Select platform path here. For example, C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd");
this.jLabelDestinationFile.setText("New Platform Path and Filename");
}
if (mode == DataType.RETURN_TYPE_WORKSPACE) {
@ -446,16 +448,16 @@ public class Clone extends IDialog {
try {
this.save();
} catch (IOException e) {
Log.wrn("Clone", e.getMessage());
Log.err("Clone", e.getMessage());
e.printStackTrace();
return;
} catch (XmlException e) {
Log.wrn("Clone", e.getMessage());
Log.err("Clone", e.getMessage());
e.printStackTrace();
return;
} catch (Exception e) {
Log.wrn("Clone", e.getMessage());
Log.err("Clone", e.getMessage());
e.printStackTrace();
return;
}
} else {
@ -507,11 +509,11 @@ public class Clone extends IDialog {
// Check Basename
//
if (isEmpty(this.jTextFieldBaseName.getText())) {
Log.err("Base Name couldn't be empty!");
Log.wrn("Clone", "Base Name couldn't be empty!");
return false;
}
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("Clone", "Incorrect data type for Base Name");
return false;
}
@ -519,11 +521,11 @@ public class Clone extends IDialog {
// Check Guid
//
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid couldn't be empty!");
Log.wrn("Clone", "Guid couldn't be empty!");
return false;
}
if (!DataValidation.isGuid(this.jTextFieldGuid.getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("Clone", "Incorrect data type for Guid");
return false;
}
@ -531,11 +533,11 @@ public class Clone extends IDialog {
// Check Version
//
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty!");
Log.wrn("Clone", "Version couldn't be empty!");
return false;
}
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
Log.err("Incorrect data type for Version");
Log.wrn("Clone", "Incorrect data type for Version");
return false;
}
@ -566,19 +568,19 @@ public class Clone extends IDialog {
// Common Check
//
if (!srcFile.exists()) {
Log.err("The source doesn't exist");
Log.wrn("Clone", "The source doesn't exist");
return false;
}
if (isEmpty(trg)) {
Log.err("The destination file path couldn't be empty");
Log.wrn("Clone", "The destination file path couldn't be empty");
return false;
}
if (src.equals(trg)) {
Log.err("The source and destination couldn't be same");
Log.wrn("Clone", "The source and destination couldn't be same");
return false;
}
if (trgFile.exists()) {
Log.err("The destination already exists");
Log.wrn("Clone", "The destination already exists");
return false;
}
@ -587,7 +589,7 @@ public class Clone extends IDialog {
//
if (mode == DataType.RETURN_TYPE_WORKSPACE) {
if (trg.indexOf(src + DataType.FILE_SEPARATOR) == 0) {
Log.err("The new workspace couldn't be in current workspace!");
Log.wrn("Clone", "The new workspace couldn't be in current workspace!");
return false;
}
}
@ -596,18 +598,18 @@ public class Clone extends IDialog {
// Check for Module
//
if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
// if (trg.indexOf(DataType.DOS_FILE_SEPARATOR) == -1 && trg.indexOf(DataType.UNIX_FILE_SEPARATOR) == -1) {
// Log.err("The module name must include a path");
// return false;
// }
// if (trg.indexOf(DataType.DOS_FILE_SEPARATOR) == -1 && trg.indexOf(DataType.UNIX_FILE_SEPARATOR) == -1) {
// Log.err("The module name must include a path");
// return false;
// }
trg = this.getModulePath();
if (src.equals(trg)) {
Log.err("The source and destination couldn't be same");
Log.wrn("Clone", "The source and destination couldn't be same");
return false;
}
trgFile = new File(trg);
if (trgFile.exists()) {
Log.err("The target module already exists");
Log.wrn("Clone", "The target module already exists");
return false;
}
return checkId();
@ -618,17 +620,17 @@ public class Clone extends IDialog {
//
if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
if (trg.indexOf(DataType.DOS_FILE_SEPARATOR) == -1 && trg.indexOf(DataType.UNIX_FILE_SEPARATOR) == -1) {
Log.err("The package name must include a path");
Log.wrn("Clone", "The package name must include a path");
return false;
}
trg = this.getPackagePath();
if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {
Log.err("The source and destination couldn't be same");
Log.wrn("Clone", "The source and destination couldn't be same");
return false;
}
trgFile = new File(trg);
if (trgFile.exists()) {
Log.err("The target package already exists");
Log.wrn("Clone", "The target package already exists");
return false;
}
return checkId();
@ -639,12 +641,12 @@ public class Clone extends IDialog {
//
if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
if (trg.indexOf(Workspace.getCurrentWorkspace()) != 0) {
Log.err("The target platform must be in current workspace");
Log.wrn("Clone", "The target platform must be in current workspace");
return false;
}
trgFile = new File(trg);
if (trgFile.exists()) {
Log.err("The target platform already exists");
Log.wrn("Clone", "The target platform already exists");
return false;
}
return checkId();
@ -662,13 +664,7 @@ public class Clone extends IDialog {
// Clone Workspace
//
if (mode == DataType.RETURN_TYPE_WORKSPACE) {
try {
FileOperation.copyFolder(src, trg);
} catch (Exception e) {
this.returnType = DataType.RETURN_TYPE_CANCEL;
Log.err("Clone Workspace", e.getMessage());
e.printStackTrace();
}
FileOperation.copyFolder(src, trg);
this.returnType = DataType.RETURN_TYPE_WORKSPACE;
}
@ -719,7 +715,8 @@ public class Clone extends IDialog {
//
// Update to platformId
//
this.setMid(new ModuleIdentification(newId, packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())));
this.setMid(new ModuleIdentification(newId,
packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())));
//
// Open belonging package

View File

@ -2133,12 +2133,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
try {
msa = OpenFile.openMsaFile(path);
} catch (IOException e) {
Log.wrn("Open Module Surface Area " + path, e.getMessage());
Log.err("Open Module Surface Area " + path, e.getMessage());
return;
} catch (XmlException e) {
Log.wrn("Open Module Surface Area " + path, e.getMessage());
Log.err("Open Module Surface Area " + path, e.getMessage());
return;
} catch (Exception e) {
Log.wrn("Open Module Surface Area " + path, "Invalid file type");
Log.err("Open Module Surface Area " + path, "Invalid file type");
return;
}
@ -2212,12 +2215,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
try {
msa = OpenFile.openMsaFile(path);
} catch (IOException e) {
Log.wrn("Open Module Surface Area " + path, e.getMessage());
Log.err("Open Module Surface Area " + path, e.getMessage());
return;
} catch (XmlException e) {
Log.wrn("Open Module Surface Area " + path, e.getMessage());
Log.err("Open Module Surface Area " + path, e.getMessage());
return;
} catch (Exception e) {
Log.wrn("Open Module Surface Area " + path, "Invalid file type");
Log.err("Open Module Surface Area " + path, "Invalid file type");
return;
}
@ -2248,7 +2254,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
//
// The module is not in existing packages
//
Log.err("The module hasn't been added to any package of current workspace!");
Log.wrn("Open Module", "The module hasn't been added to any package of current workspace!");
return;
}
@ -2291,12 +2297,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
try {
spd = OpenFile.openSpdFile(path);
} catch (IOException e) {
Log.wrn("Open Package Surface Area " + path, e.getMessage());
Log.err("Open Package Surface Area " + path, e.getMessage());
return;
} catch (XmlException e) {
Log.wrn("Open Package Surface Area " + path, e.getMessage());
Log.err("Open Package Surface Area " + path, e.getMessage());
return;
} catch (Exception e) {
Log.wrn("Open Package Surface Area " + path, "Invalid file type");
Log.err("Open Package Surface Area " + path, "Invalid file type");
return;
}
@ -2317,7 +2326,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
//
// The module is not in existing packages
//
Log.err("The package hasn't been added to current workspace!");
Log.wrn("Open Package", "The package hasn't been added to current workspace!");
return;
}
@ -2360,12 +2369,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
try {
fpd = OpenFile.openFpdFile(path);
} catch (IOException e) {
Log.wrn("Open Platform Surface Area " + path, e.getMessage());
Log.err("Open Platform Surface Area " + path, e.getMessage());
return;
} catch (XmlException e) {
Log.wrn("Open Platform Surface Area " + path, e.getMessage());
Log.err("Open Platform Surface Area " + path, e.getMessage());
return;
} catch (Exception e) {
Log.wrn("Open Platform Surface Area " + path, "Invalid file type");
Log.err("Open Platform Surface Area " + path, "Invalid file type");
return;
}
@ -2387,7 +2399,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
//
// The module is not in existing packages
//
Log.err("The platform hasn't been added to current workspace!");
Log.wrn("Open Platform", "The platform hasn't been added to current workspace!");
return;
}
@ -2435,6 +2447,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
openingModuleList.setNew(omt.getId(), false);
openingModuleList.setModuleSaved(omt.getId(), true);
} catch (Exception e) {
Log.wrn("Save Module", e.getMessage());
Log.err("Save Module", e.getMessage());
}
}
@ -2455,6 +2468,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
openingPackageList.setNew(opt.getId(), false);
openingPackageList.setPackageSaved(opt.getId(), true);
} catch (Exception e) {
Log.wrn("Save Package", e.getMessage());
Log.err("Save Package", e.getMessage());
}
}
@ -2475,6 +2489,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
openingPlatformList.setNew(opt.getId(), false);
openingPlatformList.setPlatformSaved(opt.getId(), true);
} catch (Exception e) {
Log.wrn("Save Package", e.getMessage());
Log.err("Save Package", e.getMessage());
}
}
@ -2587,47 +2602,54 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
Identification id = iTree.getSelectNode().getId();
int intCategory = iTree.getSelectCategory();
String path = null;
//
// If the node is not opened yet
// Insert top level elements first
//
//if (intCategory == IDefaultMutableTreeNode.MSA_HEADER || intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {
if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) {
try {
//
// If the node is not opened yet
// Insert top level elements first
//
//if (intCategory == IDefaultMutableTreeNode.MSA_HEADER || intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {
if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) {
path = iTree.getSelectNode().getId().getPath();
if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) {
path = iTree.getSelectNode().getId().getPath();
}
if (intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {
path = iTree.getSelectNode().getId().getPath();
}
openModule(path);
return;
}
if (intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {
if (intCategory == IDefaultMutableTreeNode.SPD_HEADER) {
path = iTree.getSelectNode().getId().getPath();
openPackage(path);
return;
}
openModule(path);
return;
}
if (intCategory == IDefaultMutableTreeNode.SPD_HEADER) {
path = iTree.getSelectNode().getId().getPath();
openPackage(path);
return;
}
if (intCategory == IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
path = iTree.getSelectNode().getId().getPath();
openPlatform(path);
return;
}
//
// Show editor panel
//
if (intCategory >= IDefaultMutableTreeNode.MSA_HEADER && intCategory < IDefaultMutableTreeNode.SPD_HEADER) {
showModuleElement(intCategory, openingModuleList.getOpeningModuleById(id));
this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id);
}
if (intCategory >= IDefaultMutableTreeNode.SPD_HEADER
&& intCategory < IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
showPackageElement(intCategory, openingPackageList.getOpeningPackageById(id));
this.currentOpeningPackageIndex = openingPackageList.findIndexOfListById(id);
}
if (intCategory >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
showPlatformElement(intCategory, openingPlatformList.getOpeningPlatformById(id));
this.currentOpeningPlatformIndex = openingPlatformList.findIndexOfListById(id);
if (intCategory == IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
path = iTree.getSelectNode().getId().getPath();
openPlatform(path);
return;
}
//
// Show editor panel
//
if (intCategory >= IDefaultMutableTreeNode.MSA_HEADER && intCategory < IDefaultMutableTreeNode.SPD_HEADER) {
showModuleElement(intCategory, openingModuleList.getOpeningModuleById(id));
this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id);
}
if (intCategory >= IDefaultMutableTreeNode.SPD_HEADER
&& intCategory < IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
showPackageElement(intCategory, openingPackageList.getOpeningPackageById(id));
this.currentOpeningPackageIndex = openingPackageList.findIndexOfListById(id);
}
if (intCategory >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
showPlatformElement(intCategory, openingPlatformList.getOpeningPlatformById(id));
this.currentOpeningPlatformIndex = openingPlatformList.findIndexOfListById(id);
}
} catch (RuntimeException e) {
Log.log("double click category: " + intCategory);
Log.log("double click id path: " + id.getPath());
Log.log("double click exception: " + e.getMessage());
e.printStackTrace();
}
}
@ -2843,16 +2865,16 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
try {
wt.addModuleToPackage(smb.getMid(), psa);
} catch (IOException e) {
Log.wrn("Upddate MsaFiles of Package", e.getMessage());
Log.err("Upddate MsaFiles of Package", e.getMessage());
e.printStackTrace();
return;
} catch (XmlException e) {
Log.wrn("Upddate MsaFiles of Package", e.getMessage());
Log.err("Upddate MsaFiles of Package", e.getMessage());
e.printStackTrace();
return;
} catch (Exception e) {
Log.wrn("Upddate MsaFiles of Package", e.getMessage());
Log.err("Upddate MsaFiles of Package", e.getMessage());
e.printStackTrace();
return;
}
this.openModule(smb.getMid().getPath(), smb.getMid());
@ -3179,14 +3201,14 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
// Check if there is any item can be cloned
//
if (iTree.getSelectionPath() == null) {
Log.err("Please select a target to clone!");
Log.wrn("Clone", "Please select a target to clone!");
return;
}
int category = iTree.getSelectCategory();
Identification id = iTree.getSelectNode().getId();
if (category == IDefaultMutableTreeNode.MODULE || category == IDefaultMutableTreeNode.PACKAGE
|| category == IDefaultMutableTreeNode.PLATFORM) {
Log.err("Please select a target to clone!");
Log.wrn("Clone", "Please select a target to clone!");
return;
}

View File

@ -472,19 +472,19 @@ public class SelectModuleBelong extends IDialog {
// Check if all required fields are not empty
//
if (isEmpty(this.jTextFieldFilePath.getText())) {
Log.err("File Path couldn't be empty");
Log.wrn("New File", "File Path couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldName.getText())) {
Log.err("Name couldn't be empty");
Log.wrn("New File", "Name couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid Value couldn't be empty");
Log.wrn("New File", "Guid Value couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty");
Log.wrn("New File", "Version couldn't be empty");
return false;
}
@ -492,11 +492,11 @@ public class SelectModuleBelong extends IDialog {
// Check if all fields have correct data types
//
if (!DataValidation.isBaseName(this.jTextFieldName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("New File", "Incorrect data type for Base Name");
return false;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("New File", "Incorrect data type for Guid");
return false;
}
@ -510,7 +510,7 @@ public class SelectModuleBelong extends IDialog {
for (int index = 0; index < msaFile.size(); index++) {
if (msaFile.elementAt(index).equals(modulePath)) {
Log.err("This module is already existing in selected package");
Log.wrn("New File", "This module is already existing in selected package");
return false;
}
}
@ -525,7 +525,7 @@ public class SelectModuleBelong extends IDialog {
if (vPackageList != null && vPackageList.size() > 0) {
for (int index = 0; index < vPackageList.size(); index++) {
if (vPackageList.get(index).getPath().equals(path)) {
Log.err("This package is already existing in database");
Log.wrn("New File", "This package is already existing in database");
return false;
}
}
@ -541,7 +541,7 @@ public class SelectModuleBelong extends IDialog {
if (vPlatfromList != null && vPlatfromList.size() > 0) {
for (int index = 0; index < vPlatfromList.size(); index++) {
if (vPlatfromList.get(index).getPath().equals(path)) {
Log.err("This platform is already existing in database");
Log.wrn("New File", "This platform is already existing in database");
return false;
}
}
@ -599,8 +599,8 @@ public class SelectModuleBelong extends IDialog {
//
try {
SaveFile.saveMsaFile(path, msa);
} catch (Exception e) {
Log.wrn("Save Module to file system", e.getMessage());
Log.err("Save Module to file system", e.getMessage());
return;
}
@ -636,7 +636,7 @@ public class SelectModuleBelong extends IDialog {
spd.setSpdHeader(spdHeader);
} catch (Exception e) {
Log.err("Save PackageSurfaceArea Document", e.getMessage());
Log.wrn("Save PackageSurfaceArea Document", e.getMessage());
return;
}
@ -647,6 +647,7 @@ public class SelectModuleBelong extends IDialog {
SaveFile.saveSpdFile(path, spd);
} catch (Exception e) {
Log.wrn("Save Package to file system", e.getMessage());
Log.err("Save Package to file system", e.getMessage());
return;
}
@ -681,7 +682,7 @@ public class SelectModuleBelong extends IDialog {
fpd.setPlatformHeader(fpdHeader);
} catch (Exception e) {
Log.err("Save FrameworkPlatformDescription Document", e.getMessage());
Log.wrn("Save FrameworkPlatformDescription Document", e.getMessage());
return;
}
@ -692,6 +693,7 @@ public class SelectModuleBelong extends IDialog {
SaveFile.saveFpdFile(path, fpd);
} catch (Exception e) {
Log.wrn("Save Platform to file system", e.getMessage());
Log.err("Save Platform to file system", e.getMessage());
return;
}

View File

@ -362,8 +362,8 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
currentFile = fc.getSelectedFile().getPath();
this.setTitle("Tool Chain Configuration" + " [" + currentFile + "]");
} catch (IOException e) {
Log.wrn(this.currentFile + "Read Error", e.getMessage());
Log.err(this.currentFile + "Read Error", e.getMessage());
e.printStackTrace();
return;
}
this.showTable();
@ -383,8 +383,8 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
try {
vtcc.saveFile(currentFile);
} catch (IOException e) {
Log.wrn(this.currentFile + "Write Error", e.getMessage());
Log.err(this.currentFile + "Write Error", e.getMessage());
e.printStackTrace();
return;
}
}
@ -452,12 +452,12 @@ public class ToolChainConfig extends IFrame implements ListSelectionListener, Ta
**/
private boolean check() {
if (isEmpty(this.jTextFieldName.getText())) {
Log.err("Add Tool Chain", "Name couldn't be empty!");
Log.wrn("Add Tool Chain", "Name couldn't be empty!");
return false;
}
if (isEmpty(this.jTextFieldValue.getText())) {
Log.err("Add Tool Chain", "Value couldn't be empty");
Log.wrn("Add Tool Chain", "Value couldn't be empty");
return false;
}
return true;

View File

@ -33,6 +33,11 @@ public class Log {
//
private static File fleLogFile = null;
//
//Wrn file
//
private static File fleWrnFile = null;
//
//Err file
//
@ -43,6 +48,11 @@ public class Log {
//
static String strLogFileName = "Log.log";
//
//Wrn file name
//
static String strWrnFileName = "Wrn.log";
//
//Err file name
//
@ -56,22 +66,18 @@ public class Log {
**/
public static void main(String[] args) {
try {
Log.log("Test", "test");
Log.err("Test1", "test1");
Log.err("sdfsdfsd fsdfsdfsdfsdfj dsfksdjflsdjf sdkfjsdklfjsdkf dskfsjdkfjks dskfjsdklfjsdkf sdkfjsdlf sdkfjsdk kdfjskdf sdkfjsdkf ksdjfksdfjskdf sdkfsjdfksd fskdfjsdf", "dfsdf sdfksdf sd sdfksd fsdf");
//Log.log("Test", "test");
//Log.err("Test1", "test1");
Log.wrn("1");
Log
.wrn(
"aaa bbbbbb cccccccccccc ddddddddddd eeeeeeeeee fffffffffff gggggggggggggggggg hhhhhhhhhhhhhhhhhhhhhhhhhhhhh",
"iiiiii jjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk lll mmm nn poooooooooooooooooooooooooooooooooooooooooooop");
} catch (Exception e) {
e.printStackTrace();
}
}
/**
This is the default constructor
Do nothing
**/
public Log() {
}
/**
Call writeToLogFile to save log item and log information to log file
@ -101,6 +107,37 @@ public class Log {
}
}
/**
Call writeToWrnFile to save wrn item and wrn information to wrn file
@param strItem The wrn item
@param strLog The wrn information
**/
public static void wrn(String strItem, String strWrn) {
try {
writeToWrnFile("Warning when " + strItem + "::" + strWrn);
showWrnMessage(strWrn);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
Call writeToWrnFile to save wrn information to wrn file
@param strLog The wrn information
**/
public static void wrn(String strWrn) {
try {
writeToWrnFile("Warning::" + strWrn);
showWrnMessage("Warning::" + strWrn);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
Call writeToErrFile to save err item and err information to err file
@ -111,7 +148,6 @@ public class Log {
public static void err(String strItem, String strErr) {
try {
writeToErrFile("Error when " + strItem + "::" + strErr);
showErrMessage("Error when " + strItem + "::" + strErr);
} catch (IOException e) {
e.printStackTrace();
}
@ -126,7 +162,6 @@ public class Log {
public static void err(String strErr) {
try {
writeToErrFile("Error::" + strErr);
showErrMessage("Error::" + strErr);
} catch (IOException e) {
e.printStackTrace();
}
@ -139,22 +174,9 @@ public class Log {
@param strErr The input data of err message
**/
private static void showErrMessage(String strErr) {
int intMaxLength = 40;
String strReturn = "";
String strTemp = "";
while (strErr.length() > 0) {
if (strErr.length() > intMaxLength) {
strTemp = strErr.substring(0, intMaxLength);
strErr = strErr.substring(strTemp.length());
strReturn = strReturn + strTemp + DataType.UNIX_LINE_SEPARATOR;
} else if (strErr.length() <= intMaxLength) {
strReturn = strReturn + strErr;
strErr = "";
}
}
JOptionPane.showConfirmDialog(null, strReturn, "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
private static void showWrnMessage(String strErr) {
String strReturn = Tools.wrapStringByWord(strErr);
JOptionPane.showConfirmDialog(null, strReturn, "Warning", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
}
/**
@ -182,6 +204,31 @@ public class Log {
}
}
/**
Open wrn file and write wrn information
@param strLog The log information
@throws IOException
**/
private static void writeToWrnFile(String strLog) throws IOException {
try {
if (fleWrnFile == null) {
fleWrnFile = new File(strWrnFileName);
fleWrnFile.createNewFile();
}
FileOutputStream fos = new FileOutputStream(fleWrnFile, true);
fos.write((Tools.getCurrentDateTime() + DataType.DOS_LINE_SEPARATOR).getBytes());
fos.write((strLog + DataType.DOS_LINE_SEPARATOR).getBytes());
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
Open err file and write err information

View File

@ -336,4 +336,75 @@ public class Tools {
}
return arg0;
}
/**
Wrap single line long input string to multiple short line string by word
@param arg0 input string
@return wraped string
**/
public static String wrapStringByWord(String arg0) {
int intMaxLength = 40;
String strReturn = "";
String strTemp = "";
boolean isCopied = true;
//
// Convert string to array by " "
//
String s[] = arg0.split(" ");
if (arg0.indexOf(" ") == -1) {
s[0] = arg0;
}
//
// Add each string of array one by one
//
for (int index = 0; index < s.length; index++) {
String ss = s[index];
isCopied = false;
//
// The word length > defined line length
//
if (ss.length() > intMaxLength) {
//
// Finish previous line
//
if (!isCopied) {
strReturn = strReturn + strTemp + DataType.UNIX_LINE_SEPARATOR;
strTemp = "";
}
//
// Separater to short lines
//
while (ss.length() > 0) {
if (ss.length() > intMaxLength) {
strReturn = strReturn + s[index].substring(0, intMaxLength - 1) + DataType.UNIX_LINE_SEPARATOR;
ss = ss.substring(intMaxLength);
isCopied = true;
} else {
strTemp = ss;
ss = "";
isCopied = false;
}
}
} else {
if ((strTemp + " " + ss).length() <= intMaxLength) {
strTemp = strTemp + " " + ss;
continue;
} else {
strReturn = strReturn + strTemp + DataType.UNIX_LINE_SEPARATOR;
strTemp = ss + " ";
isCopied = true;
}
}
}
if (!isCopied) {
strReturn = strReturn + strTemp;
}
return strReturn;
}
}

View File

@ -236,7 +236,7 @@ public class CreateStepFour extends IDialog implements MouseListener {
// Guid Check, File Check etc.
//
if (this.jTextFieldSaveToFile.getText() == null) {
Log.err("Please input the Far name!");
Log.wrn("Create far", "Please input the Far name!");
}
try {
//
@ -250,7 +250,8 @@ public class CreateStepFour extends IDialog implements MouseListener {
.getFileFilter(),
this.getPreviousStep().getPreviousStep().getPreviousStep().getFarHeader());
} catch (Exception exp) {
Log.err("Create error! ");
Log.wrn("Create far", exp.getMessage());
Log.err("Create far", exp.getMessage());
return;
}
getPreviousStep().getPreviousStep().getPreviousStep().returnType = DataType.RETURN_TYPE_OK;

View File

@ -482,11 +482,11 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check BaseName
//
if (isEmpty(this.jTextFieldBaseName.getText())) {
Log.err("Base Name couldn't be empty");
Log.wrn("Create far", "Base Name couldn't be empty");
return false;
}
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("Create far", "Incorrect data type for Base Name");
return false;
}
farHeader.setFarName(this.jTextFieldBaseName.getText());
@ -495,11 +495,11 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check Guid
//
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid Value couldn't be empty");
Log.wrn("Create far", "Guid Value couldn't be empty");
return false;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("Create far", "Incorrect data type for Guid");
return false;
}
farHeader.setGuidValue(this.jTextFieldGuid.getText());
@ -508,11 +508,11 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check Version
//
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty");
Log.wrn("Create far", "Version couldn't be empty");
return false;
}
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
Log.err("Incorrect data type for Version");
Log.wrn("Create far", "Incorrect data type for Version");
return false;
}
farHeader.setVersion(this.jTextFieldVersion.getText());
@ -521,11 +521,11 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check Abstact
//
if (isEmpty(this.jTextFieldAbstract.getText())) {
Log.err("Abstract couldn't be empty");
Log.wrn("Create far", "Abstract couldn't be empty");
return false;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
Log.err("Incorrect data type for Abstract");
Log.wrn("Create far", "Incorrect data type for Abstract");
return false;
}
farHeader.setAbstractStr(this.jTextFieldAbstract.getText());
@ -534,7 +534,7 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check Description
//
if (isEmpty(this.jTextAreaDescription.getText())) {
Log.err("Description couldn't be empty");
Log.wrn("Create far", "Description couldn't be empty");
return false;
}
farHeader.setDescription(this.jTextAreaDescription.getText());
@ -543,7 +543,7 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check Copyright
//
if (isEmpty(this.jTextFieldCopyright.getText())) {
Log.err("Copyright couldn't be empty");
Log.wrn("Create far", "Copyright couldn't be empty");
return false;
}
farHeader.setCopyright(this.jTextFieldCopyright.getText());
@ -552,7 +552,7 @@ public class CreateStepOne extends IDialog implements MouseListener {
// Check License
//
if (isEmpty(this.jTextAreaLicense.getText())) {
Log.err("License couldn't be empty");
Log.wrn("Create far", "License couldn't be empty");
return false;
}
farHeader.setLicense(this.jTextAreaLicense.getText());

View File

@ -252,7 +252,7 @@ public class CreateStepTwo extends IDialog implements MouseListener {
//
if (jComboBoxPlatform.getAllCheckedItemsIndex().size() == 0
&& jComboBoxPackage.getAllCheckedItemsIndex().size() == 0) {
Log.err("At least choose one of packages and platforms. ");
Log.wrn("Create far", "At least choose one of packages and platforms. ");
return;
}
if (stepThree == null) {

View File

@ -262,7 +262,7 @@ public class InstallStepOne extends IDialog implements MouseListener {
//
File farFile = new File(jTextFieldFarFile.getText());
if (!farFile.exists() || !farFile.isFile()) {
Log.err("Please choose a FAR file already exists. ");
Log.wrn("Install far", "Please choose a FAR file already exists. ");
return;
}
@ -288,8 +288,8 @@ public class InstallStepOne extends IDialog implements MouseListener {
}
} catch (Exception exp) {
exp.printStackTrace();
Log.err("Far file invaild! The error message as follow:" + exp.getMessage());
Log.wrn("Install far" + exp.getMessage());
Log.err("Install far" + exp.getMessage());
}
if (stepTwo == null) {

View File

@ -345,11 +345,11 @@ public class InstallStepTwo extends IDialog implements MouseListener {
File toFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar
+ packageModel.getValueAt(i, 3));
if (!isPackagePathValid(toFile)) {
Log.err(packageVector.get(i) + " path already has package now. ");
Log.wrn("Install far", packageVector.get(i) + " path already has package now. ");
return;
}
if (allNewPath.contains(toFile)) {
Log.err("Path " + packageModel.getValueAt(i, 3) + " is specified by twice. ");
Log.wrn("Install far", "Path " + packageModel.getValueAt(i, 3) + " is specified by twice. ");
return;
}
allNewPath.add(toFile);
@ -364,7 +364,7 @@ public class InstallStepTwo extends IDialog implements MouseListener {
File toFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar
+ platformModel.getValueAt(i, 3));
if (!isPlatformPathValid(toFile)) {
Log.err(platformVector.get(i) + " path already has platform now. ");
Log.wrn("Install far", platformVector.get(i) + " path already has platform now. ");
return;
}
File fpdFile = new File((String) platformModel.getValueAt(i, 3) + File.separatorChar
@ -385,8 +385,8 @@ public class InstallStepTwo extends IDialog implements MouseListener {
WorkspaceTools wt = new WorkspaceTools();
wt.addFarToDb(packageList, platformList, far.mainfest.getHeader());
} catch (Exception ex) {
ex.printStackTrace();
Log.err("Install error. ");
Log.wrn("Install far", ex.getMessage());
Log.err("Install far", ex.getMessage());
return;
}

View File

@ -241,7 +241,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
//
farFile = new File(jTextFieldFarFile.getText());
if (!farFile.exists() || !farFile.isFile()) {
Log.err("Please choose a FAR file already exists. ");
Log.wrn("Update far", "Please choose a FAR file already exists. ");
return;
}
@ -252,14 +252,15 @@ public class UpdateStepOne extends IDialog implements MouseListener {
JarFile file = new JarFile(farFile);
this.far = new Far(file);
} catch (Exception ex) {
Log.err(ex.getMessage());
Log.wrn("Update far", ex.getMessage());
Log.err("Update far", ex.getMessage());
}
//
// Add more logic process here
//
if (jListFarFromDb.getSelectedValue() == null) {
Log.err("Please choose a FAR from framework database. ");
Log.wrn("Update far", "Please choose a FAR from framework database. ");
return;
}

View File

@ -273,7 +273,7 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
dbPkgList));
Iterator resultIter = resultList.iterator();
while (resultIter.hasNext()) {
Log.err("Missing dependency package " + ((PackageIdentification) resultIter.next()).toString()
Log.wrn("Update far", "Missing dependency package " + ((PackageIdentification) resultIter.next()).toString()
+ "in workspace!");
return;
}
@ -322,7 +322,8 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
try {
stepOne.getFar().installPackage(pkgId, new File(pkgId.getSpdFile().getParent()));
} catch (Exception ex) {
Log.err("Can install " + pkgId.toString() + " pakcage, please check it!");
Log.wrn("Install " + pkgId.toString(), ex.getMessage());
Log.err("Install " + pkgId.toString(), ex.getMessage());
}
}

View File

@ -346,7 +346,7 @@ public class ModuleBootModes extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Boot Modes", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -403,6 +403,7 @@ public class ModuleBootModes extends IInternalFrame {
this.msa.setBootModes(bootModes);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Boot Modes", e.getMessage());
Log.err("Update Boot Modes", e.getMessage());
}
}

View File

@ -343,7 +343,7 @@ public class ModuleDataHubs extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Data Hubs", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -400,6 +400,7 @@ public class ModuleDataHubs extends IInternalFrame {
this.msa.setDataHubs(dataHubs);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Data Hubs", e.getMessage());
Log.err("Update Data Hubs", e.getMessage());
}
}

View File

@ -286,11 +286,11 @@ public class ModuleDefinitions extends IInternalFrame {
private boolean check() {
if (isEmpty(this.jTextFieldOutputFileBasename.getText())) {
Log.err("Output File Basename couldn't be empty!");
Log.wrn("Update Definitions", "Output File Basename couldn't be empty!");
return false;
}
if (!DataValidation.isOutputFileBasename(this.jTextFieldOutputFileBasename.getText())) {
Log.err("Incorrect data type for Output File Basename");
Log.wrn("Update Definitions", "Incorrect data type for Output File Basename");
return false;
}
return true;

View File

@ -372,7 +372,7 @@ public class ModuleEvents extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Events", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -468,7 +468,7 @@ public class ModuleEvents extends IInternalFrame {
this.msa.setEvents(events);
this.omt.setSaved(false);
} catch (Exception e) {
e.printStackTrace();
Log.wrn("Update Events", e.getMessage());
Log.err("Update Events", e.getMessage());
}
}

View File

@ -410,7 +410,7 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Externs", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -546,6 +546,7 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
this.msa.setExterns(externs);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Externs", e.getMessage());
Log.err("Update Externs", e.getMessage());
}
}

View File

@ -340,7 +340,7 @@ public class ModuleGuids extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Guids", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -396,6 +396,7 @@ public class ModuleGuids extends IInternalFrame {
this.msa.setGuids(guids);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Guids", e.getMessage());
Log.err("Update Guids", e.getMessage());
}
}

View File

@ -343,7 +343,7 @@ public class ModuleHiiPackages extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Hii Packages", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -400,6 +400,7 @@ public class ModuleHiiPackages extends IInternalFrame {
this.msa.setHiiPackages(hiiPackages);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update hiiPackages", e.getMessage());
Log.err("Update hiiPackages", e.getMessage());
}
}

View File

@ -346,7 +346,7 @@ public class ModuleHobs extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Hobs", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -402,7 +402,7 @@ public class ModuleHobs extends IInternalFrame {
this.msa.setHobs(hobs);
this.omt.setSaved(false);
} catch (Exception e) {
e.printStackTrace();
Log.wrn("Update Hobs", e.getMessage());
Log.err("Update Hobs", e.getMessage());
}
}

View File

@ -334,6 +334,7 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Library Class Definitions", e.getMessage());
Log.err("Update Library Class Definitions", e.getMessage());
}
}
@ -368,7 +369,7 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Library Class Definitions", "Please select one record first.");
return;
}
showEdit(selectedRow);

View File

@ -345,7 +345,7 @@ public class ModulePCDs extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update PcdCoded", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -408,7 +408,8 @@ public class ModulePCDs extends IInternalFrame {
this.msa.setPcdCoded(pcds);
this.omt.setSaved(false);
} catch (Exception e) {
Log.err("Update Hobs", e.getMessage());
Log.wrn("Update PcdCoded", e.getMessage());
Log.err("Update PcdCoded", e.getMessage());
}
}

View File

@ -352,7 +352,7 @@ public class ModulePackageDependencies extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Package Dependencies", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -410,7 +410,7 @@ public class ModulePackageDependencies extends IInternalFrame {
this.msa.setPackageDependencies(pd);
this.omt.setSaved(false);
} catch (Exception e) {
e.printStackTrace();
Log.wrn("Update Package Dependencies", e.getMessage());
Log.err("Update Package Dependencies", e.getMessage());
}
}

View File

@ -365,7 +365,7 @@ public class ModulePpis extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Ppis", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -445,7 +445,7 @@ public class ModulePpis extends IInternalFrame {
this.msa.setPPIs(ppis);
this.omt.setSaved(false);
} catch (Exception e) {
e.printStackTrace();
Log.wrn("Update Ppis", e.getMessage());
Log.err("Update Ppis", e.getMessage());
}
}

View File

@ -366,7 +366,7 @@ public class ModuleProtocols extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Protocols", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -446,7 +446,7 @@ public class ModuleProtocols extends IInternalFrame {
this.msa.setProtocols(protocols);
this.omt.setSaved(false);
} catch (Exception e) {
e.printStackTrace();
Log.wrn("Update Protocols", e.getMessage());
Log.err("Update Protocols", e.getMessage());
}
}

View File

@ -342,6 +342,7 @@ public class ModuleSourceFiles extends IInternalFrame {
this.msa.setSourceFiles(sourceFiles);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Source Files", e.getMessage());
Log.err("Update Source Files", e.getMessage());
}
}
@ -378,7 +379,7 @@ public class ModuleSourceFiles extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Source Files", "Please select one record first.");
return;
}
showEdit(selectedRow);

View File

@ -343,7 +343,7 @@ public class ModuleSystemTables extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update System Tables", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -400,6 +400,7 @@ public class ModuleSystemTables extends IInternalFrame {
this.msa.setSystemTables(systemTables);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update System Tables", e.getMessage());
Log.err("Update System Tables", e.getMessage());
}
}

View File

@ -342,7 +342,7 @@ public class ModuleVariables extends IInternalFrame {
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.err("Please select one record first.");
Log.wrn("Update Variables", "Please select one record first.");
return;
}
showEdit(selectedRow);
@ -402,6 +402,7 @@ public class ModuleVariables extends IInternalFrame {
this.msa.setVariables(variables);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Variables", e.getMessage());
Log.err("Update Variables", e.getMessage());
}
}

View File

@ -695,12 +695,12 @@ public class MsaHeader extends IInternalFrame {
// Check Base Name
//
if (isEmpty(this.jTextFieldBaseName.getText())) {
Log.err("Base Name couldn't be empty");
Log.wrn("Update Msa Header", "Base Name couldn't be empty");
//this.jTextFieldBaseName.requestFocus();
return false;
}
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("Update Msa Header", "Incorrect data type for Base Name");
//this.jTextFieldBaseName.requestFocus();
return false;
}
@ -709,12 +709,12 @@ public class MsaHeader extends IInternalFrame {
// Check Guid
//
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid Value couldn't be empty");
Log.wrn("Update Msa Header", "Guid Value couldn't be empty");
//this.jTextFieldGuid.requestFocus();
return false;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("Update Msa Header", "Incorrect data type for Guid");
//this.jTextFieldGuid.requestFocus();
return false;
}
@ -723,12 +723,12 @@ public class MsaHeader extends IInternalFrame {
// Check Version
//
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty");
Log.wrn("Update Msa Header", "Version couldn't be empty");
//this.jTextFieldVersion.requestFocus();
return false;
}
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
Log.err("Incorrect data type for Version");
Log.wrn("Update Msa Header", "Incorrect data type for Version");
//this.jTextFieldVersion.requestFocus();
return false;
}
@ -737,12 +737,12 @@ public class MsaHeader extends IInternalFrame {
// Check Abstact
//
if (isEmpty(this.jTextFieldAbstract.getText())) {
Log.err("Abstract couldn't be empty");
Log.wrn("Update Msa Header", "Abstract couldn't be empty");
//this.jTextFieldAbstract.requestFocus();
return false;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
Log.err("Incorrect data type for Abstract");
Log.wrn("Update Msa Header", "Incorrect data type for Abstract");
//this.jTextFieldAbstract.requestFocus();
return false;
}
@ -751,7 +751,7 @@ public class MsaHeader extends IInternalFrame {
// Check Description
//
if (isEmpty(this.jTextAreaDescription.getText())) {
Log.err("Description couldn't be empty");
Log.wrn("Update Msa Header", "Description couldn't be empty");
//this.jTextAreaDescription.requestFocus();
return false;
}
@ -760,7 +760,7 @@ public class MsaHeader extends IInternalFrame {
// Check Copyright
//
if (isEmpty(this.jTextFieldCopyright.getText())) {
Log.err("Copyright couldn't be empty");
Log.wrn("Update Msa Header", "Copyright couldn't be empty");
//this.jTextFieldCopyright.requestFocus();
return false;
}
@ -769,7 +769,7 @@ public class MsaHeader extends IInternalFrame {
// Check License
//
if (isEmpty(this.jTextAreaLicense.getText())) {
Log.err("License couldn't be empty");
Log.wrn("Update Msa Header", "License couldn't be empty");
//this.jTextAreaLicense.requestFocus();
return false;
}
@ -778,12 +778,12 @@ public class MsaHeader extends IInternalFrame {
// Check Specification
//
if (isEmpty(this.jTextFieldSpecification.getText())) {
Log.err("Specification couldn't be empty");
Log.wrn("Update Msa Header", "Specification couldn't be empty");
//this.jTextFieldSpecification.requestFocus();
return false;
}
if (!DataValidation.isSpecification(this.jTextFieldSpecification.getText())) {
Log.err("Incorrect data type for Specification");
Log.wrn("Update Msa Header", "Incorrect data type for Specification");
//this.jTextFieldSpecification.requestFocus();
return false;
}
@ -823,6 +823,7 @@ public class MsaHeader extends IInternalFrame {
msa.setMsaHeader(msaHeader);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Save Module", e.getMessage());
Log.err("Save Module", e.getMessage());
}
}
@ -889,12 +890,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldBaseName) {
if (isEmpty(this.jTextFieldBaseName.getText())) {
Log.err("Base Name couldn't be empty");
Log.wrn("Update Msa Header", "Base Name couldn't be empty");
//this.jTextFieldBaseName.requestFocus();
return;
}
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("Update Msa Header", "Incorrect data type for Base Name");
//this.jTextFieldBaseName.requestFocus();
return;
}
@ -921,12 +922,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldGuid) {
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid Value couldn't be empty");
Log.wrn("Update Msa Header", "Guid Value couldn't be empty");
//this.jTextFieldGuid.requestFocus();
return;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("Update Msa Header", "Incorrect data type for Guid");
//this.jTextFieldGuid.requestFocus();
return;
}
@ -942,12 +943,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldVersion) {
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty");
Log.wrn("Update Msa Header", "Version couldn't be empty");
//this.jTextFieldVersion.requestFocus();
return;
}
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
Log.err("Incorrect data type for Version");
Log.wrn("Update Msa Header", "Incorrect data type for Version");
//this.jTextFieldVersion.requestFocus();
return;
}
@ -963,12 +964,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldAbstract) {
if (isEmpty(this.jTextFieldAbstract.getText())) {
Log.err("Abstract couldn't be empty");
Log.wrn("Update Msa Header", "Abstract couldn't be empty");
//this.jTextFieldAbstract.requestFocus();
return;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
Log.err("Incorrect data type for Abstract");
Log.wrn("Update Msa Header", "Incorrect data type for Abstract");
//this.jTextFieldAbstract.requestFocus();
return;
}
@ -984,7 +985,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextAreaDescription) {
if (isEmpty(this.jTextAreaDescription.getText())) {
Log.err("Description couldn't be empty");
Log.wrn("Update Msa Header", "Description couldn't be empty");
//this.jTextAreaDescription.requestFocus();
return;
}
@ -1000,7 +1001,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldCopyright) {
if (isEmpty(this.jTextFieldCopyright.getText())) {
Log.err("Copyright couldn't be empty");
Log.wrn("Update Msa Header", "Copyright couldn't be empty");
//this.jTextFieldCopyright.requestFocus();
return;
}
@ -1016,7 +1017,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextAreaLicense) {
if (isEmpty(this.jTextAreaLicense.getText())) {
Log.err("License couldn't be empty");
Log.wrn("Update Msa Header", "License couldn't be empty");
//this.jTextAreaLicense.requestFocus();
return;
}

View File

@ -359,7 +359,7 @@ public class BootModesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Boot Modes", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -361,13 +361,13 @@ public class DataHubsDlg extends IDialog {
// Check DataHubRecord
//
if (isEmpty(this.jTextFieldDataHubRecord.getText())) {
Log.err("Data Hub Record couldn't be empty");
Log.wrn("Update Hubs", "Data Hub Record couldn't be empty");
return false;
}
if (!isEmpty(this.jTextFieldDataHubRecord.getText())) {
if (!DataValidation.isC_NameType(this.jTextFieldDataHubRecord.getText())) {
Log.err("Incorrect data type for Data Hub Record");
Log.wrn("Update Hubs", "Incorrect data type for Data Hub Record");
return false;
}
}
@ -377,7 +377,7 @@ public class DataHubsDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Hubs", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -422,13 +422,13 @@ public class EventsDlg extends IDialog {
// Check Name
//
if (isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.err("Event Name couldn't be empty");
Log.wrn("Update Events", "Event Name couldn't be empty");
return false;
}
if (!isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.err("Incorrect data type for Event Name");
Log.wrn("Update Events", "Incorrect data type for Event Name");
return false;
}
}
@ -438,7 +438,7 @@ public class EventsDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Events", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -338,19 +338,19 @@ public class ExternsDlg extends IDialog implements ItemListener {
// Check CName
//
if (isEmpty(this.jTextFieldC_Name.getText())) {
Log.err("Value couldn't be empty");
Log.wrn("Update Externs", "Value couldn't be empty");
return false;
}
if (!isEmpty(this.jTextFieldC_Name.getText())) {
if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
if (!DataValidation.isSentence(this.jTextFieldC_Name.getText())) {
Log.err("Incorrect data type for Specification");
Log.wrn("Update Externs", "Incorrect data type for Specification");
return false;
}
} else {
if (!DataValidation.isC_NameType(this.jTextFieldC_Name.getText())) {
Log.err("Incorrect data type for C_Name");
Log.wrn("Update Externs", "Incorrect data type for C_Name");
return false;
}
}
@ -361,13 +361,13 @@ public class ExternsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Externs", "Incorrect data type for Feature Flag");
return false;
}
}
} else {
if (this.jComboBoxPcdIsDriver.getSelectedItem().toString().equals(DataType.EMPTY_SELECT_ITEM)) {
Log.err("You must select one PCD DRIVER type");
Log.wrn("Update Externs", "You must select one PCD DRIVER type");
return false;
}
}

View File

@ -363,7 +363,7 @@ public class GuidsDlg extends IDialog {
//
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.err("Incorrect data type for Guid Name");
Log.wrn("Update Guids", "Incorrect data type for Guid Name");
return false;
}
}
@ -373,7 +373,7 @@ public class GuidsDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Guids", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -360,13 +360,13 @@ public class HiiPackagesDlg extends IDialog {
// Check Hii Package Name
//
if (isEmpty(this.jTextFieldName.getText())) {
Log.err("Hii Package Name Record couldn't be empty");
Log.wrn("Update Hii Packages", "Hii Package Name Record couldn't be empty");
return false;
}
if (!isEmpty(this.jTextFieldName.getText())) {
if (!DataValidation.isC_NameType(this.jTextFieldName.getText())) {
Log.err("Incorrect data type for Hii Package Name");
Log.wrn("Update Hii Packages", "Incorrect data type for Hii Package Name");
return false;
}
}
@ -376,7 +376,7 @@ public class HiiPackagesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Hii Packages", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -382,13 +382,13 @@ public class HobsDlg extends IDialog {
// Check Name
//
if (isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.err("Hob Name couldn't be empty");
Log.wrn("Update Hobs", "Hob Name couldn't be empty");
return false;
}
if (!isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.err("Incorrect data type for Hob Name");
Log.wrn("Update Hobs", "Incorrect data type for Hob Name");
return false;
}
}
@ -398,7 +398,7 @@ public class HobsDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Hobs", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -468,11 +468,11 @@ public class LibraryClassDefsDlg extends IDialog {
// Check LibraryClass
//
if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {
Log.err("No Library Class can be added");
Log.wrn("Update Library Class Definitions", "No Library Class can be added");
return false;
}
if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {
Log.err("Incorrect data type for Library Class");
Log.wrn("Update Library Class Definitions", "Incorrect data type for Library Class");
return false;
}
@ -501,7 +501,7 @@ public class LibraryClassDefsDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Library Class Definitions", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -421,7 +421,7 @@ public class PCDsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.err("Incorrect data type for C_Name");
Log.wrn("Update PcdCoded", "Incorrect data type for C_Name");
return false;
}
}
@ -431,7 +431,7 @@ public class PCDsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldTokenSpaceGuid.getText())) {
if (!DataValidation.isC_NameType(this.jTextFieldTokenSpaceGuid.getText())) {
Log.err("Incorrect data type for the selected pcd entry, please check in in spd file");
Log.wrn("Update PcdCoded", "Incorrect data type for the selected pcd entry, please check in in spd file");
return false;
}
}
@ -441,7 +441,7 @@ public class PCDsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldDefaultValue.getText())) {
if (!DataValidation.isDefaultValueType(this.jTextFieldDefaultValue.getText())) {
Log.err("Incorrect data type for Default Value");
Log.wrn("Update PcdCoded", "Incorrect data type for Default Value");
return false;
}
}
@ -450,7 +450,7 @@ public class PCDsDlg extends IDialog implements ItemListener {
// Check HelpText
//
if (isEmpty(this.jTextFieldHelpText.getText())) {
Log.err("Help Text couldn't be empty");
Log.wrn("Update PcdCoded", "Help Text couldn't be empty");
return false;
}
@ -459,7 +459,7 @@ public class PCDsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update PcdCoded", "Incorrect data type for Feature Flag");
return false;
}
}
@ -500,7 +500,7 @@ public class PCDsDlg extends IDialog implements ItemListener {
if (arg0.getSource() == this.jComboBoxCName && arg0.getStateChange() == ItemEvent.SELECTED ) {
if (pcd.getPcd(index).getGuidCName() == null || isEmpty(pcd.getPcd(index).getGuidCName())
|| pcd.getPcd(index).getType() == null || pcd.getPcd(index).getHelp() == null || isEmpty(pcd.getPcd(index).getHelp())) {
Log.err("select pcd entry when editing msa", "The selected is defined incorrectly.\r\nPlease check it in spd file");
Log.wrn("select pcd entry when editing msa", "The selected is defined incorrectly.\r\nPlease check it in spd file");
} else {
this.jTextFieldTokenSpaceGuid.setText(pcd.getPcd(index).getGuidCName());
Tools.generateComboBoxByVector(this.jComboBoxItemType, pcd.getPcd(index).getType());

View File

@ -386,7 +386,7 @@ public class PackageDepDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldPackageVersion.getText())) {
if (!DataValidation.isVersion(this.jTextFieldPackageVersion.getText())) {
Log.err("Incorrect data type for Package Version");
Log.wrn("Update Package Dependencies", "Incorrect data type for Package Version");
return false;
}
}
@ -396,7 +396,7 @@ public class PackageDepDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Package Dependencies", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -375,7 +375,7 @@ public class PpisDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.err("Incorrect data type for Ppi/PpiNotify Name");
Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name");
return false;
}
}
@ -385,7 +385,7 @@ public class PpisDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Ppis", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -394,7 +394,7 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.err("Incorrect data type for Protocol/ProtocolNotify Name");
Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");
return false;
}
}
@ -404,7 +404,7 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Protocols", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -403,11 +403,11 @@ public class SourceFilesDlg extends IDialog {
// Check Filename
//
if (isEmpty(this.jTextFieldFileName.getText())) {
Log.err("File Name couldn't be empty");
Log.wrn("Update Source Files", "File Name couldn't be empty");
return false;
}
if (!DataValidation.isFilename(this.jTextFieldFileName.getText())) {
Log.err("Incorrect data type for File Name");
Log.wrn("Update Source Files", "Incorrect data type for File Name");
return false;
}
@ -416,7 +416,7 @@ public class SourceFilesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldTagName.getText())) {
if (!DataValidation.isTagName(this.jTextFieldTagName.getText())) {
Log.err("Incorrect data type for Tag Name");
Log.wrn("Update Source Files", "Incorrect data type for Tag Name");
return false;
}
}
@ -426,7 +426,7 @@ public class SourceFilesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldToolCode.getText())) {
if (!DataValidation.isToolCode(this.jTextFieldToolCode.getText())) {
Log.err("Incorrect data type for Tool Code");
Log.wrn("Update Source Files", "Incorrect data type for Tool Code");
return false;
}
}
@ -436,7 +436,7 @@ public class SourceFilesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldToolChainFamily.getText())) {
if (!DataValidation.isToolChainFamily(this.jTextFieldToolChainFamily.getText())) {
Log.err("Incorrect data type for Tool Chain Family");
Log.wrn("Update Source Files", "Incorrect data type for Tool Chain Family");
return false;
}
}
@ -446,7 +446,7 @@ public class SourceFilesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Source Files", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -362,7 +362,7 @@ public class SystemTablesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update System Tables", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -391,13 +391,13 @@ public class VariablesDlg extends IDialog {
// Check VariableName
//
if (isEmpty(this.jTextFieldVariableName.getText())) {
Log.err("Variable Name couldn't be empty");
Log.wrn("Update Variables", "Variable Name couldn't be empty");
return false;
}
if (!isEmpty(this.jTextFieldVariableName.getText())) {
if (!DataValidation.isHexWordArrayType(this.jTextFieldVariableName.getText())) {
Log.err("Incorrect data type for Variable Name");
Log.wrn("Update Variables", "Incorrect data type for Variable Name");
return false;
}
}
@ -407,7 +407,7 @@ public class VariablesDlg extends IDialog {
//
if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
Log.err("Incorrect data type for Feature Flag");
Log.wrn("Update Variables", "Incorrect data type for Feature Flag");
return false;
}
}

View File

@ -639,31 +639,31 @@ public class SpdHeader extends IInternalFrame {
// Check if all required fields are not empty
//
if (isEmpty(this.jTextFieldBaseName.getText())) {
Log.err("Base Name couldn't be empty");
Log.wrn("Update Spd Header", "Base Name couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid couldn't be empty");
Log.wrn("Update Spd Header", "Guid couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty");
Log.wrn("Update Spd Header", "Version couldn't be empty");
return false;
}
if (isEmpty(this.jTextAreaLicense.getText())) {
Log.err("License couldn't be empty");
Log.wrn("Update Spd Header", "License couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldCopyright.getText())) {
Log.err("Copyright couldn't be empty");
Log.wrn("Update Spd Header", "Copyright couldn't be empty");
return false;
}
if (isEmpty(this.jTextAreaDescription.getText())) {
Log.err("Description couldn't be empty");
Log.wrn("Update Spd Header", "Description couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldAbstract.getText())) {
Log.err("Abstract couldn't be empty");
Log.wrn("Update Spd Header", "Abstract couldn't be empty");
return false;
}
@ -671,19 +671,19 @@ public class SpdHeader extends IInternalFrame {
// Check if all fields have correct data types
//
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("Update Spd Header", "Incorrect data type for Base Name");
return false;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("Update Spd Header", "Incorrect data type for Guid");
return false;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
Log.err("Incorrect data type for Abstract");
Log.wrn("Update Spd Header", "Incorrect data type for Abstract");
return false;
}
if (!DataValidation.isCopyright(this.jTextFieldCopyright.getText())) {
Log.err("Incorrect data type for Copyright");
Log.wrn("Update Spd Header", "Incorrect data type for Copyright");
return false;
}
return true;
@ -699,6 +699,7 @@ public class SpdHeader extends IInternalFrame {
try {
} catch (Exception e) {
Log.wrn("Save Package", e.getMessage());
Log.err("Save Package", e.getMessage());
}
}

View File

@ -639,31 +639,31 @@ public class FpdHeader extends IInternalFrame {
// Check if all required fields are not empty
//
if (isEmpty(this.jTextFieldBaseName.getText())) {
Log.err("Base Name couldn't be empty");
Log.wrn("Update Fpd Header", "Base Name couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldGuid.getText())) {
Log.err("Guid couldn't be empty");
Log.wrn("Update Fpd Header", "Guid couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldVersion.getText())) {
Log.err("Version couldn't be empty");
Log.wrn("Update Fpd Header", "Version couldn't be empty");
return false;
}
if (isEmpty(this.jTextAreaLicense.getText())) {
Log.err("License couldn't be empty");
Log.wrn("Update Fpd Header", "License couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldCopyright.getText())) {
Log.err("Copyright couldn't be empty");
Log.wrn("Update Fpd Header", "Copyright couldn't be empty");
return false;
}
if (isEmpty(this.jTextAreaDescription.getText())) {
Log.err("Description couldn't be empty");
Log.wrn("Update Fpd Header", "Description couldn't be empty");
return false;
}
if (isEmpty(this.jTextFieldAbstract.getText())) {
Log.err("Abstract couldn't be empty");
Log.wrn("Update Fpd Header", "Abstract couldn't be empty");
return false;
}
@ -671,19 +671,19 @@ public class FpdHeader extends IInternalFrame {
// Check if all fields have correct data types
//
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
Log.err("Incorrect data type for Base Name");
Log.wrn("Update Fpd Header", "Incorrect data type for Base Name");
return false;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
Log.err("Incorrect data type for Guid");
Log.wrn("Update Fpd Header", "Incorrect data type for Guid");
return false;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
Log.err("Incorrect data type for Abstract");
Log.wrn("Update Fpd Header", "Incorrect data type for Abstract");
return false;
}
if (!DataValidation.isCopyright(this.jTextFieldCopyright.getText())) {
Log.err("Incorrect data type for Copyright");
Log.wrn("Update Fpd Header", "Incorrect data type for Copyright");
return false;
}
return true;

View File

@ -107,7 +107,7 @@ public class WorkspaceTools {
try {
SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
} catch (Exception e) {
e.printStackTrace();
Log.err("Save Database File", e.getMessage());
}
}
@ -157,7 +157,7 @@ public class WorkspaceTools {
try {
SaveFile.saveDbFile(strFrameworkDbFilePath, fdb);
} catch (Exception e) {
e.printStackTrace();
Log.err("Save Database File", e.getMessage());
}
}
@ -219,11 +219,11 @@ public class WorkspaceTools {
}
}
} catch (IOException e) {
Log.err("Get all mdoules of a package " + path, e.getMessage());
} catch (XmlException e) {
Log.err("Get all mdoules of a package " + path, e.getMessage());
} catch (Exception e) {
Log.err("Get all mdoules of a package " + path, e.getMessage());
}
return modulePath;
}
@ -247,11 +247,11 @@ public class WorkspaceTools {
}
}
} catch (IOException e) {
Log.err("Get all Industry Std Includes of a package " + path, e.getMessage());
} catch (XmlException e) {
Log.err("Get all Industry Std Includes of a package " + path, e.getMessage());
} catch (Exception e) {
Log.err("Get all Industry Std Includes of a package " + path, e.getMessage());
}
return includePath;
}
@ -277,13 +277,10 @@ public class WorkspaceTools {
vPackageList.addElement(new PackageIdentification(id));
} catch (IOException e) {
Log.err("Open Package Surface Area " + path, e.getMessage());
} catch (XmlException e) {
Log.err("Open Package Surface Area " + path, e.getMessage());
} catch (Exception e) {
Log.err("Open Package Surface Area " + path, "Invalid file type");
}
}
Sort.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);
@ -318,13 +315,10 @@ public class WorkspaceTools {
v.addElement(new PackageIdentification(id));
} catch (IOException e) {
Log.err("Open Package Surface Area " + path, e.getMessage());
e.printStackTrace();
} catch (XmlException e) {
Log.err("Open Package Surface Area " + path, e.getMessage());
e.printStackTrace();
} catch (Exception e) {
Log.err("Open Package Surface Area " + path, "Invalid file type");
e.printStackTrace();
}
}
}
@ -347,13 +341,10 @@ public class WorkspaceTools {
v.addElement(new PlatformIdentification(id));
} catch (IOException e) {
Log.err("Open Platform Surface Area " + path, e.getMessage());
e.printStackTrace();
} catch (XmlException e) {
Log.err("Open Platform Surface Area " + path, e.getMessage());
e.printStackTrace();
} catch (Exception e) {
Log.err("Open Platform Surface Area " + path, "Invalid file type");
e.printStackTrace();
}
}
}
@ -378,11 +369,11 @@ public class WorkspaceTools {
modulePath = modulePaths.get(index);
id = getId(modulePath, OpenFile.openMsaFile(modulePath));
} catch (IOException e) {
Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());
Log.err("Open Module Surface Area " + modulePath, e.getMessage());
} catch (XmlException e) {
Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());
Log.err("Open Module Surface Area " + modulePath, e.getMessage());
} catch (Exception e) {
Log.log("Error when Open Module Surface Area " + modulePath, "Invalid file type " + e.getMessage());
Log.err("Open Module Surface Area " + modulePath, "Invalid file type " + e.getMessage());
}
v.addElement(new ModuleIdentification(id, pid));
}
@ -577,11 +568,11 @@ public class WorkspaceTools {
vector.addAll(v);
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.err("getAllLibraryClassDefinitionsFromWorkspace ", e.getMessage());
} catch (XmlException e) {
// TODO Auto-generated catch block
Log.err("getAllLibraryClassDefinitionsFromWorkspace ", e.getMessage());
} catch (Exception e) {
// TODO Auto-generated catch block
Log.err("getAllLibraryClassDefinitionsFromWorkspace ", e.getMessage());
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
@ -603,11 +594,11 @@ public class WorkspaceTools {
vector.addAll(v);
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.err("getAllProtocolDeclarationsFromPackage", e.getMessage());
} catch (XmlException e) {
// TODO Auto-generated catch block
Log.err("getAllProtocolDeclarationsFromPackage", e.getMessage());
} catch (Exception e) {
// TODO Auto-generated catch block
Log.err("getAllProtocolDeclarationsFromPackage", e.getMessage());
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
@ -629,11 +620,11 @@ public class WorkspaceTools {
vector.addAll(v);
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.err("getAllPpiDeclarationsFromWorkspace", e.getMessage());
} catch (XmlException e) {
// TODO Auto-generated catch block
Log.err("getAllPpiDeclarationsFromWorkspace", e.getMessage());
} catch (Exception e) {
// TODO Auto-generated catch block
Log.err("getAllPpiDeclarationsFromWorkspace", e.getMessage());
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
@ -655,11 +646,11 @@ public class WorkspaceTools {
vector.addAll(v);
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.err("getAllGuidDeclarationsFromWorkspace", e.getMessage());
} catch (XmlException e) {
// TODO Auto-generated catch block
Log.err("getAllGuidDeclarationsFromWorkspace", e.getMessage());
} catch (Exception e) {
// TODO Auto-generated catch block
Log.err("getAllGuidDeclarationsFromWorkspace", e.getMessage());
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
@ -680,11 +671,11 @@ public class WorkspaceTools {
vector.addAll(v);
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.err("getAllPcdDeclarationsFromWorkspace", e.getMessage());
} catch (XmlException e) {
// TODO Auto-generated catch block
Log.err("getAllPcdDeclarationsFromWorkspace", e.getMessage());
} catch (Exception e) {
// TODO Auto-generated catch block
Log.err("getAllPcdDeclarationsFromWorkspace", e.getMessage());
}
}
Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
@ -722,11 +713,11 @@ public class WorkspaceTools {
return vPackageList.elementAt(indexI);
}
} catch (IOException e) {
Log.err("getPackageIdByModuleId " + id.getPath(), e.getMessage());
} catch (XmlException e) {
Log.err("getPackageIdByModuleId " + id.getPath(), e.getMessage());
} catch (Exception e) {
Log.err("getPackageIdByModuleId " + id.getPath(), e.getMessage());
}
}
}

View File

@ -182,11 +182,11 @@ public class SwitchWorkspace extends IDialog {
private boolean check() {
if (isEmpty(this.jTextFieldNew.getText())) {
Log.err("New workspace can't be empty!");
Log.wrn("Switch Workspace", "New workspace can't be empty!");
return false;
}
if (!Workspace.checkWorkspace(this.jTextFieldNew.getText())) {
Log.err("Please select a valid workspace!");
Log.wrn("Switch Workspace", "Please select a valid workspace!");
return false;
}
return true;