this.jLabelBelong.setEnabled(false);\r
this.jComboBoxExistingPackage.setEnabled(false);\r
this.jButtonBrowse.setVisible(false);\r
- this.jTextFieldFilePath.setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.spd</html>");\r
+ this.jTextFieldFilePath\r
+ .setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.spd</html>");\r
this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);\r
this.jLabelDestinationFile.setText("New Package Path and Filename");\r
}\r
this.jButtonGenerateGuid.setEnabled(false);\r
this.jLabelVersion.setEnabled(false);\r
this.jTextFieldVersion.setEnabled(false);\r
- this.jTextFieldFilePath.setToolTipText("<html>Input the workspace path, for example:<br>C:\\MyWorkspace</html>");\r
+ this.jTextFieldFilePath\r
+ .setToolTipText("<html>Input the workspace path, for example:<br>C:\\MyWorkspace</html>");\r
this.jLabelDestinationFile.setText("New Workspace Path");\r
}\r
}\r
return false;\r
}\r
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {\r
- Log.wrn("Clone", "<html>Incorrect data type for the Name, it must<br>be a single word, starting with an alpha character.</html>");\r
+ Log\r
+ .wrn("Clone",\r
+ "<html>Incorrect data type for the Name, it must<br>be a single word, starting with an alpha character.</html>");\r
return false;\r
}\r
\r
return false;\r
}\r
if (!DataValidation.isGuid(this.jTextFieldGuid.getText())) {\r
- Log.wrn("Clone", "<html>Incorrect data type for Guid, which must<br>be in registry format (8-4-4-4-12) for example:<br>d3adb123-eef1-466d-39ac-02febcaf5997</html>");\r
+ Log\r
+ .wrn(\r
+ "Clone",\r
+ "<html>Incorrect data type for Guid, which must<br>be in registry format (8-4-4-4-12) for example:<br>d3adb123-eef1-466d-39ac-02febcaf5997</html>");\r
return false;\r
}\r
\r
return false;\r
}\r
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {\r
- Log.wrn("Clone", "<html>Incorrect data type for Version, which must<br>be one or more digits, optionally followed by sequence<br>of one or more dot, one or more digits; examples:<br>1.0 1.0.1 12.25.256</html>");\r
+ Log\r
+ .wrn(\r
+ "Clone",\r
+ "<html>Incorrect data type for Version, which must<br>be one or more digits, optionally followed by sequence<br>of one or more dot, one or more digits; examples:<br>1.0 1.0.1 12.25.256</html>");\r
return false;\r
}\r
\r
newId.setPath(trg);\r
vFiles = wt.getAllFilesPathOfModule(src);\r
\r
+ String oldPackagePath = GlobalData.openingModuleList.getIdByPath(src).getPackageId().getPath();\r
+ String newPackagePath = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath();\r
+\r
//\r
// First copy all files to new directory\r
//\r
FileOperation.copyFile(src, trg);\r
for (int index = 1; index < vFiles.size(); index++) {\r
String oldFile = vFiles.get(index);\r
- String newFile = vFiles.get(index).replace(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));\r
+ String newFile = "";\r
+ if (oldFile.indexOf(Tools.getFilePathOnly(src)) > -1) {\r
+ //\r
+ // The file is not include header\r
+ //\r
+ newFile = oldFile.replace(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));\r
+ } else if (oldFile.indexOf(Tools.getFilePathOnly(oldPackagePath)) > -1) {\r
+ //\r
+ // The file is include header\r
+ //\r
+ newFile = oldFile.replace(Tools.getFilePathOnly(oldPackagePath),\r
+ Tools.getFilePathOnly(newPackagePath));\r
+ }\r
+\r
FileOperation.copyFile(oldFile, newFile);\r
}\r
\r
// Update <Cloned> Section\r
//\r
updateModuleClonedId(msa, oldId);\r
- \r
+\r
//\r
// Save to file\r
//\r
// Update the db file\r
//\r
wt.addModuleToPackage(mid, psa);\r
- \r
+\r
//\r
// Update GlobalData\r
//\r
// Update the db file\r
//\r
wt.addPackageToDatabase(pid);\r
- \r
+\r
//\r
// Update GlobalData\r
//\r
GlobalData.vPackageList.addElement(pid);\r
GlobalData.openingPackageList.insertToOpeningPackageList(pid, spd);\r
- \r
+\r
//\r
// Add all cloned modules\r
//\r
Vector<String> modulePaths = GlobalData.getAllModulesOfPackage(pid.getPath());\r
String modulePath = null;\r
ModuleSurfaceArea msa = null;\r
- \r
+\r
for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {\r
try {\r
modulePath = modulePaths.get(indexJ);\r
GlobalData.vModuleList.addElement(mid);\r
GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);\r
}\r
- \r
+\r
this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;\r
}\r
\r
// Update the db file\r
//\r
wt.addPlatformToDatabase(fid);\r
- \r
+\r
//\r
// Update GlobalData\r
//\r