1. Update release note to use jdk1.5.0_06 to take place of jdk1.5.0_04

2. Support "Update Far" function
3. Fix bugs in Far operations

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@985 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-07-13 12:13:23 +00:00
parent 06a9243705
commit ef6e2efe66
9 changed files with 459 additions and 449 deletions

View File

@ -64,7 +64,7 @@ Assembler Tool Chain
GNU binutils 2.16.1 or later GNU binutils 2.16.1 or later
Java Development Kit ( Java 5.0 or later) Java Development Kit ( Java 5.0 or later)
Sun* jdk-1.5.0_04 or later (http://java.sun.com) Sun* jdk-1.5.0_06 or later (http://java.sun.com)
or or
Bea Systems* jrockit-25.2.0-jdk1.5.0_03 or later (http://www.bea.com) Bea Systems* jrockit-25.2.0-jdk1.5.0_03 or later (http://www.bea.com)

View File

@ -1637,7 +1637,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
jMenuItemProjectUpdateFar.setMnemonic('U'); jMenuItemProjectUpdateFar.setMnemonic('U');
jMenuItemProjectUpdateFar.setEnabled(true); jMenuItemProjectUpdateFar.setEnabled(true);
jMenuItemProjectUpdateFar.addActionListener(this); jMenuItemProjectUpdateFar.addActionListener(this);
jMenuItemProjectUpdateFar.setVisible(false); jMenuItemProjectUpdateFar.setVisible(true);
} }
return jMenuItemProjectUpdateFar; return jMenuItemProjectUpdateFar;
} }

View File

@ -86,5 +86,4 @@ public class DistributeRule {
} }
return set; return set;
} }
} }

View File

@ -63,9 +63,8 @@ public class Far {
this.mainfest = new Mainfest(getMainfestFile()); this.mainfest = new Mainfest(getMainfestFile());
} }
public void creatFar (List<PackageIdentification> pkgList, public void creatFar(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,
List<PlatformIdentification> plfList, Set<String> fileFilter, Set<String> fileFilter, FarHeader fHeader) throws Exception {
FarHeader fHeader) throws Exception{
jos = new JarOutputStream(new FileOutputStream(jarFile)); jos = new JarOutputStream(new FileOutputStream(jarFile));
// //
@ -98,7 +97,11 @@ public class Far {
private void writeToJar(File file, JarOutputStream jos) throws Exception { private void writeToJar(File file, JarOutputStream jos) throws Exception {
byte[] buffer = new byte[(int) file.length()]; byte[] buffer = new byte[(int) file.length()];
FileInputStream fInput = new FileInputStream(file); FileInputStream fInput = new FileInputStream(file);
JarEntry entry = new JarEntry(Tools.convertPathToUnixType(Tools.getRelativePath(file.getPath(),Workspace.getCurrentWorkspace()))); JarEntry entry = new JarEntry(
Tools
.convertPathToUnixType(Tools
.getRelativePath(file.getPath(),
Workspace.getCurrentWorkspace())));
jos.putNextEntry(entry); jos.putNextEntry(entry);
fInput.read(buffer); fInput.read(buffer);
jos.write(buffer); jos.write(buffer);
@ -110,7 +113,8 @@ public class Far {
extract(allFile, dir); extract(allFile, dir);
} }
public void InstallFar (Map<PlatformIdentification, File> plfMap, Map<PackageIdentification, File> pkgMap) throws Exception{ public void InstallFar(Map<PlatformIdentification, File> plfMap, Map<PackageIdentification, File> pkgMap)
throws Exception {
Set<PlatformIdentification> plfKeys = plfMap.keySet(); Set<PlatformIdentification> plfKeys = plfMap.keySet();
Iterator<PlatformIdentification> plfIter = plfKeys.iterator(); Iterator<PlatformIdentification> plfIter = plfKeys.iterator();
while (plfIter.hasNext()) { while (plfIter.hasNext()) {
@ -149,6 +153,7 @@ public class Far {
public boolean hibernateToFile() { public boolean hibernateToFile() {
return true; return true;
} }
// public static void main(String[] args){ // public static void main(String[] args){
// try { // try {
// JarFile jarFile = new JarFile(new File("C:\\cvswork\\newEdk\\jar.jar.far")); // JarFile jarFile = new JarFile(new File("C:\\cvswork\\newEdk\\jar.jar.far"));
@ -203,7 +208,6 @@ public class Far {
// //
FileOutputStream outputStream = new FileOutputStream(file); FileOutputStream outputStream = new FileOutputStream(file);
try { try {
// //
// Read the entry data and write it to the output // Read the entry data and write it to the output
@ -238,7 +242,6 @@ public class Far {
} }
public void addFileToFar(File file, JarOutputStream farOuputStream, String workDir) { public void addFileToFar(File file, JarOutputStream farOuputStream, String workDir) {
} }
@ -254,6 +257,9 @@ public class Far {
List<PackageIdentification> result = new ArrayList<PackageIdentification>(); List<PackageIdentification> result = new ArrayList<PackageIdentification>();
entry = this.mainfest.getPackgeSpd(pkgId); entry = this.mainfest.getPackgeSpd(pkgId);
if (entry == null) {
return result;
}
if (entry[0] != null) { if (entry[0] != null) {
try { try {
JarEntry je; JarEntry je;

View File

@ -14,7 +14,6 @@
**/ **/
package org.tianocore.frameworkwizard.far; package org.tianocore.frameworkwizard.far;
import java.io.File;
import java.util.List; import java.util.List;
import org.tianocore.frameworkwizard.packaging.PackageIdentification; import org.tianocore.frameworkwizard.packaging.PackageIdentification;
@ -84,8 +83,8 @@ public class FarPackage {
} }
public boolean isIdentityPkg(PackageIdentification pkgId) { public boolean isIdentityPkg(PackageIdentification pkgId) {
File file = new File(farFile.getRelativeFilename()); //File file = new File(farFile.getRelativeFilename());
if (pkgId.getName() == file.getName() && pkgId.getGuid() == guidValue && pkgId.getVersion() == version) { if (pkgId.getGuid().equalsIgnoreCase(guidValue) && pkgId.getVersion().equalsIgnoreCase(version)) {
return true; return true;
} }
return false; return false;

View File

@ -57,6 +57,7 @@ public class Mainfest implements ManifestInterface {
// / Mainfest file element name // / Mainfest file element name
// / // /
final static String mfFileName = "FarMainfest.MF"; final static String mfFileName = "FarMainfest.MF";
// //
// Header // Header
// //
@ -163,8 +164,8 @@ public class Mainfest implements ManifestInterface {
this.fhInfo = fHeader; this.fhInfo = fHeader;
} }
public void createManifest(List<PackageIdentification> pkgList, public void createManifest(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,
List<PlatformIdentification> plfList, Set<String> fileFilter) throws Exception { Set<String> fileFilter) throws Exception {
// //
// Add Package and it's contents to FarPackageList. // Add Package and it's contents to FarPackageList.
@ -274,8 +275,7 @@ public class Mainfest implements ManifestInterface {
fPkgList.add(farPackage); fPkgList.add(farPackage);
} }
private void recursiveDirectory(Set<File> files, Set<File> fpds, File dir, private void recursiveDirectory(Set<File> files, Set<File> fpds, File dir, Set<String> fileFilter) {
Set<String> fileFilter) {
if (isFilter(dir, fileFilter)) { if (isFilter(dir, fileFilter)) {
return; return;
} }
@ -306,7 +306,8 @@ public class Mainfest implements ManifestInterface {
// //
// Add farFileName // Add farFileName
// //
ffItem = new FarFileItem(Tools.getRelativePath(fpfFile.getPath(),Workspace.getCurrentWorkspace()), FarMd5.md5(fpfFile)); ffItem = new FarFileItem(Tools.getRelativePath(fpfFile.getPath(), Workspace.getCurrentWorkspace()),
FarMd5.md5(fpfFile));
fpfItem.setFarFile(ffItem); fpfItem.setFarFile(ffItem);
// //
@ -343,8 +344,10 @@ public class Mainfest implements ManifestInterface {
// identification. // identification.
// //
PackageIdentification pkgId = new PackageIdentification(fPkg.getFarFile().getRelativeFilename(), fPkg.getGuidValue(), fPkg.getVersion()); PackageIdentification pkgId = new PackageIdentification(fPkg.getFarFile().getRelativeFilename(),
pkgId.setPath(Workspace.getCurrentWorkspace() + File.separatorChar + fPkg.getDefaultPath() + File.separatorChar + fPkg.getFarFile().getRelativeFilename()); fPkg.getGuidValue(), fPkg.getVersion());
pkgId.setPath(Workspace.getCurrentWorkspace() + File.separatorChar + fPkg.getDefaultPath()
+ File.separatorChar + fPkg.getFarFile().getRelativeFilename());
// wsTool.getId( // wsTool.getId(
// Workspace.getCurrentWorkspace() + File.separatorChar // Workspace.getCurrentWorkspace() + File.separatorChar
// + fPkg.getDefaultPath(), OpenFile // + fPkg.getDefaultPath(), OpenFile
@ -361,8 +364,7 @@ public class Mainfest implements ManifestInterface {
/** /**
* *
*/ */
public List<PlatformIdentification> getPlatformList() throws Exception, public List<PlatformIdentification> getPlatformList() throws Exception, IOException, XmlException {
IOException, XmlException {
// //
// PlatformIdentification set. // PlatformIdentification set.
// //
@ -370,14 +372,14 @@ public class Mainfest implements ManifestInterface {
Iterator plfItem = this.fPlfList.iterator(); Iterator plfItem = this.fPlfList.iterator();
while (plfItem.hasNext()) { while (plfItem.hasNext()) {
FarPlatformItem fpfItem = (FarPlatformItem) plfItem.next(); FarPlatformItem fpfItem = (FarPlatformItem) plfItem.next();
File file = new File(Workspace.getCurrentWorkspace() File file = new File(Workspace.getCurrentWorkspace() + File.separatorChar
+ File.separatorChar
+ fpfItem.getFarFile().getRelativeFilename()); + fpfItem.getFarFile().getRelativeFilename());
// //
// Set platformIdentificaiton's path as absolutly path (include // Set platformIdentificaiton's path as absolutly path (include
// workspace and FPD relatively path) // workspace and FPD relatively path)
// //
PlatformIdentification plfId = new PlatformIdentification (fpfItem.getFarFile().getRelativeFilename(), fpfItem.getGuidValue(),fpfItem.getVersion(), PlatformIdentification plfId = new PlatformIdentification(fpfItem.getFarFile().getRelativeFilename(),
fpfItem.getGuidValue(), fpfItem.getVersion(),
file.getPath()); file.getPath());
// (PlatformIdentification) wsTool // (PlatformIdentification) wsTool
@ -440,7 +442,6 @@ public class Mainfest implements ManifestInterface {
} }
} }
return farFileList; return farFileList;
} }
@ -482,18 +483,16 @@ public class Mainfest implements ManifestInterface {
// //
// Set farFileItem relativeFileName = absolutePath + file Name. // Set farFileItem relativeFileName = absolutePath + file Name.
// //
farFileList.add(new FarFileItem(pkg.getDefaultPath() farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separatorChar + ffItem.getRelativeFilename(),
+ File.separatorChar + ffItem.getRelativeFilename(), ffItem ffItem.getMd5Value()));
.getMd5Value()));
// //
// Add all files in contents to list. // Add all files in contents to list.
// //
Iterator contentsItem = pkg.getContentList().iterator(); Iterator contentsItem = pkg.getContentList().iterator();
while (contentsItem.hasNext()) { while (contentsItem.hasNext()) {
ffItem = (FarFileItem) contentsItem.next(); ffItem = (FarFileItem) contentsItem.next();
farFileList.add(new FarFileItem(pkg.getDefaultPath() farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separator + ffItem.getRelativeFilename(),
+ File.separator + ffItem.getRelativeFilename(), ffItem ffItem.getMd5Value()));
.getMd5Value()));
} }
// //
// Add all farfiles in <FarPlatformList> to list. // Add all farfiles in <FarPlatformList> to list.
@ -502,9 +501,8 @@ public class Mainfest implements ManifestInterface {
Iterator plfItem = plfList.iterator(); Iterator plfItem = plfList.iterator();
while (plfItem.hasNext()) { while (plfItem.hasNext()) {
ffItem = ((FarPlatformItem) plfItem.next()).getFarFile(); ffItem = ((FarPlatformItem) plfItem.next()).getFarFile();
farFileList.add(new FarFileItem(pkg.getDefaultPath() farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separator + ffItem.getRelativeFilename(),
+ File.separator + ffItem.getRelativeFilename(), ffItem ffItem.getMd5Value()));
.getMd5Value()));
} }
} }
return farFileList; return farFileList;
@ -556,8 +554,7 @@ public class Mainfest implements ManifestInterface {
// //
// Add far files in <FarPlatformList> to list // Add far files in <FarPlatformList> to list
// //
NodeList elementList = this.mainfestDoc NodeList elementList = this.mainfestDoc.getElementsByTagName(farPlatformList);
.getElementsByTagName(farPlatformList);
for (int i = 0; i < elementList.getLength(); i++) { for (int i = 0; i < elementList.getLength(); i++) {
// //
// Get <farPlatform> node list. // Get <farPlatform> node list.
@ -575,15 +572,13 @@ public class Mainfest implements ManifestInterface {
// //
// Get child node value and set to platformIdentification. // Get child node value and set to platformIdentification.
// //
if (tempNode.getNodeName().equalsIgnoreCase( if (tempNode.getNodeName().equalsIgnoreCase(farPackage_FarfileName)) {
farPackage_FarfileName)) {
NamedNodeMap farAttr = tempNode.getAttributes(); NamedNodeMap farAttr = tempNode.getAttributes();
// //
// Change relative path to absolute one // Change relative path to absolute one
// //
FarFileItem farFile = new FarFileItem(tempNode FarFileItem farFile = new FarFileItem(tempNode.getTextContent(),
.getTextContent(), farAttr.getNamedItem( farAttr.getNamedItem(farFileName_Md5sum).getTextContent());
farFileName_Md5sum).getTextContent());
ffiList.add(farFile); ffiList.add(farFile);
} }
} }
@ -596,8 +591,7 @@ public class Mainfest implements ManifestInterface {
// //
// create mainfest root node // create mainfest root node
// //
Element rootNode = this.mainfestDoc Element rootNode = this.mainfestDoc.createElement("FrameworkArchiveManifest");
.createElement("FrameworkArchiveManifest");
this.mainfestDoc.appendChild(rootNode); this.mainfestDoc.appendChild(rootNode);
// //
@ -675,8 +669,7 @@ public class Mainfest implements ManifestInterface {
// Write the DOM document to the file // Write the DOM document to the file
// //
Transformer xformer = TransformerFactory.newInstance().newTransformer(); Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
"2");
xformer.setOutputProperty(OutputKeys.INDENT, "yes"); xformer.setOutputProperty(OutputKeys.INDENT, "yes");
// //
@ -687,8 +680,7 @@ public class Mainfest implements ManifestInterface {
// Prepare the output file, get the Mainifest file name from <FarHeader> // Prepare the output file, get the Mainifest file name from <FarHeader>
// /<FarName>. // /<FarName>.
// //
this.mfFile = new File(Workspace.getCurrentWorkspace() this.mfFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar + mfFileName);
+ File.separatorChar + mfFileName);
// //
// generate all directory path // generate all directory path
// //
@ -697,8 +689,7 @@ public class Mainfest implements ManifestInterface {
} }
public void pkgToFarPkgNode(Element parentNode, FarPackage pkgItem) { public void pkgToFarPkgNode(Element parentNode, FarPackage pkgItem) {
Element pkgNode = this.mainfestDoc Element pkgNode = this.mainfestDoc.createElement(farPackageList_FarPackage);
.createElement(farPackageList_FarPackage);
// //
// Add <FarFileName> // Add <FarFileName>
// //
@ -714,8 +705,7 @@ public class Mainfest implements ManifestInterface {
// //
// Add <DefaultPath> // Add <DefaultPath>
// //
setStrItemToNode(pkgNode, pkgItem.getDefaultPath(), setStrItemToNode(pkgNode, pkgItem.getDefaultPath(), farPackage_DefaultPath);
farPackage_DefaultPath);
// //
// Add <Contents> // Add <Contents>
@ -730,8 +720,7 @@ public class Mainfest implements ManifestInterface {
} }
public void PlfToPlatformNode(Element parentNode, FarPlatformItem fplItem) { public void PlfToPlatformNode(Element parentNode, FarPlatformItem fplItem) {
Element fplNode = this.mainfestDoc Element fplNode = this.mainfestDoc.createElement(farPlatformList_FarPlatform);
.createElement(farPlatformList_FarPlatform);
// //
// Add <FarFileName> // Add <FarFileName>
// //
@ -752,8 +741,7 @@ public class Mainfest implements ManifestInterface {
} }
public void ffiToFfNode(Element parentNode, FarFileItem ffi) { public void ffiToFfNode(Element parentNode, FarFileItem ffi) {
Element farFileName = this.mainfestDoc Element farFileName = this.mainfestDoc.createElement(farPackage_FarfileName);
.createElement(farPackage_FarfileName);
farFileName.setTextContent(ffi.getRelativeFilename()); farFileName.setTextContent(ffi.getRelativeFilename());
System.out.println(farFileName.getTextContent()); System.out.println(farFileName.getTextContent());
System.out.println(ffi.getRelativeFilename()); System.out.println(ffi.getRelativeFilename());
@ -761,8 +749,7 @@ public class Mainfest implements ManifestInterface {
parentNode.appendChild(farFileName); parentNode.appendChild(farFileName);
} }
public void setStrItemToNode(Element parentNode, String strValue, public void setStrItemToNode(Element parentNode, String strValue, String strName) {
String strName) {
Element node = this.mainfestDoc.createElement(strName); Element node = this.mainfestDoc.createElement(strName);
node.setTextContent(strValue); node.setTextContent(strValue);
parentNode.appendChild(node); parentNode.appendChild(node);
@ -885,8 +872,7 @@ public class Mainfest implements ManifestInterface {
* @param fpfListNode * @param fpfListNode
* @param plfList * @param plfList
*/ */
public void parseFarPlatformList(Node fpfListNode, public void parseFarPlatformList(Node fpfListNode, List<FarPlatformItem> plfList) {
List<FarPlatformItem> plfList) {
// //
// Get <FarPlatform> list. // Get <FarPlatform> list.
// //
@ -950,8 +936,7 @@ public class Mainfest implements ManifestInterface {
public FarFileItem parseFarFile(Node farFileNode) { public FarFileItem parseFarFile(Node farFileNode) {
String ffName = farFileNode.getTextContent(); String ffName = farFileNode.getTextContent();
NamedNodeMap attr = farFileNode.getAttributes(); NamedNodeMap attr = farFileNode.getAttributes();
FarFileItem ffItem = new FarFileItem(ffName, attr.getNamedItem( FarFileItem ffItem = new FarFileItem(ffName, attr.getNamedItem(farFileName_Md5sum).getTextContent());
farFileName_Md5sum).getTextContent());
return ffItem; return ffItem;
} }

View File

@ -324,6 +324,15 @@ public class InstallStepTwo extends IDialog implements MouseListener {
this.setVisible(false); this.setVisible(false);
this.dispose(); this.dispose();
} else if (e.getSource() == jButtonFinish) { } else if (e.getSource() == jButtonFinish) {
if (jTablePackage.isEditing()) {
jTablePackage.getCellEditor().stopCellEditing();
}
if (jTablePlatform.isEditing()) {
jTablePlatform.getCellEditor().stopCellEditing();
}
List<String> packageList = new ArrayList<String>(); List<String> packageList = new ArrayList<String>();
List<String> platformList = new ArrayList<String>(); List<String> platformList = new ArrayList<String>();
// //
@ -419,12 +428,18 @@ public class InstallStepTwo extends IDialog implements MouseListener {
} }
private boolean isPathContainMutual(File path1, File path2) { private boolean isPathContainMutual(File path1, File path2) {
if (path1.getPath().startsWith(path2.getParent())) { String s1 = Tools.addFileSeparator(path1.getPath());
String s2 = Tools.addFileSeparator(path2.getParent());
if (s1.length() > s2.length()) {
if (s1.substring(0, s2.length()).equalsIgnoreCase(s2)) {
return true; return true;
} }
if (path2.getPath().startsWith(path1.getPath())) { } else {
if (s2.substring(0, s1.length()).equalsIgnoreCase(s1)) {
return true; return true;
} }
}
return false; return false;
} }

View File

@ -179,6 +179,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
WorkspaceTools wt = new WorkspaceTools(); WorkspaceTools wt = new WorkspaceTools();
farVector = wt.getAllFars(); farVector = wt.getAllFars();
jListFarFromDb.setListData(farVector); jListFarFromDb.setListData(farVector);
jListFarFromDb.setSelectionMode(0);
} }
return jListFarFromDb; return jListFarFromDb;
} }
@ -234,8 +235,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getSource() == jButtonCancel) { if (e.getSource() == jButtonCancel) {
this.setVisible(false); this.setVisible(false);
} } else if (e.getSource() == jButtonNext) {
else if (e.getSource() == jButtonNext) {
// //
// Judge if FAR file is existed // Judge if FAR file is existed
// //
@ -255,7 +255,6 @@ public class UpdateStepOne extends IDialog implements MouseListener {
Log.err(ex.getMessage()); Log.err(ex.getMessage());
} }
// //
// Add more logic process here // Add more logic process here
// //
@ -270,8 +269,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
this.setVisible(false); this.setVisible(false);
stepTwo.prepareTable(); stepTwo.prepareTable();
stepTwo.setVisible(true); stepTwo.setVisible(true);
} } else if (e.getSource() == jButtonBrowser) {
else if (e.getSource() == jButtonBrowser) {
JFileChooser fc = new JFileChooser(); JFileChooser fc = new JFileChooser();
fc.setAcceptAllFileFilterUsed(false); fc.setAcceptAllFileFilterUsed(false);
fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT)); fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));

View File

@ -34,6 +34,7 @@ import javax.swing.JTable;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.Log; import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
@ -71,6 +72,7 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
private JTable jTablePackage = null; private JTable jTablePackage = null;
private PartialTableModel model = null; private PartialTableModel model = null;
List<PackageIdentification> updatPkgList = new ArrayList<PackageIdentification>(); List<PackageIdentification> updatPkgList = new ArrayList<PackageIdentification>();
public UpdateStepTwo(IDialog iDialog, boolean modal, UpdateStepOne stepOne) { public UpdateStepTwo(IDialog iDialog, boolean modal, UpdateStepOne stepOne) {
@ -197,8 +199,7 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace())); str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));
model.addRow(str); model.addRow(str);
} }
} } catch (Exception ex) {
catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
@ -245,11 +246,11 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
} }
return jContentPane; return jContentPane;
} }
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getSource() == jButtonCancel) { if (e.getSource() == jButtonCancel) {
this.setVisible(false); this.setVisible(false);
} } else if (e.getSource() == jButtonFinish) {
else if (e.getSource() == jButtonFinish) {
// //
// Check depedency ? // Check depedency ?
// //
@ -263,11 +264,17 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
} }
List<PackageIdentification> dbPkgList = DistributeRule.vectorToList(wsTools.getAllPackages()); List<PackageIdentification> dbPkgList = DistributeRule.vectorToList(wsTools.getAllPackages());
List<PackageIdentification> resultList = AggregationOperation.minus(depResultList, AggregationOperation.union( List<PackageIdentification> resultList = AggregationOperation
this.updatPkgList, dbPkgList)); .minus(
depResultList,
AggregationOperation
.union(
this.updatPkgList,
dbPkgList));
Iterator resultIter = resultList.iterator(); Iterator resultIter = resultList.iterator();
while (resultIter.hasNext()) { while (resultIter.hasNext()) {
Log.err("Missing dependency package " + ((PackageIdentification)resultIter.next()).toString() + "in workspace!"); Log.err("Missing dependency package " + ((PackageIdentification) resultIter.next()).toString()
+ "in workspace!");
return; return;
} }
@ -313,33 +320,37 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
while (updataIter.hasNext()) { while (updataIter.hasNext()) {
PackageIdentification pkgId = updataIter.next(); PackageIdentification pkgId = updataIter.next();
try { try {
stepOne.getFar().installPackage(pkgId, pkgId.getSpdFile()); stepOne.getFar().installPackage(pkgId, new File(pkgId.getSpdFile().getParent()));
} catch (Exception ex) { } catch (Exception ex) {
Log.err("Can install " + pkgId.toString() + " pakcage, please check it!"); Log.err("Can install " + pkgId.toString() + " pakcage, please check it!");
} }
} }
this.stepOne.returnType = DataType.RETURN_TYPE_OK;
this.setVisible(false); this.setVisible(false);
} this.dispose();
else if (e.getSource() == jButtonPrevious) { } else if (e.getSource() == jButtonPrevious) {
this.setVisible(false); this.setVisible(false);
stepOne.setVisible(true); stepOne.setVisible(true);
} }
} }
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@ -352,12 +363,10 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
if (!platformFiles.contains(fileList[i])) { if (!platformFiles.contains(fileList[i])) {
files.add(fileList[i]); files.add(fileList[i]);
} }
} } else {
else {
if (isContain(fileList[i], platformFiles)) { if (isContain(fileList[i], platformFiles)) {
recursiveDir(files, fileList[i], platformFiles); recursiveDir(files, fileList[i], platformFiles);
} } else {
else {
files.add(fileList[i]); files.add(fileList[i]);
} }
} }
@ -389,7 +398,6 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
} }
} }
class PartialTableModel extends DefaultTableModel { class PartialTableModel extends DefaultTableModel {
/** /**
* *