use of cbit.xml.merge.XmlTreeDiff in project vcell by virtualcell.
the class DatabaseWindowManager method compareWithOther.
// Processes the model comparison,
private void compareWithOther(final VCDocumentInfo docInfo1, final VCDocumentInfo docInfo2) {
final MDIManager mdiManager = new ClientMDIManager(getRequestManager());
mdiManager.blockWindow(getManagerID());
String taskName = "Comparing " + docInfo1.getVersion().getName() + " with " + docInfo2.getVersion().getName();
AsynchClientTask task1 = new AsynchClientTask(taskName, AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
XmlTreeDiff xmlTreeDiff = getRequestManager().compareWithOther(docInfo1, docInfo2);
hashTable.put("xmlTreeDiff", xmlTreeDiff);
}
};
AsynchClientTask task2 = new AsynchClientTask(taskName, AsynchClientTask.TASKTYPE_SWING_BLOCKING, false, false) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
try {
if (hashTable.get(ClientTaskDispatcher.TASK_ABORTED_BY_ERROR) == null) {
XmlTreeDiff xmlTreeDiff = (XmlTreeDiff) hashTable.get("xmlTreeDiff");
String baselineDesc = docInfo1.getVersion().getName() + ", " + docInfo1.getVersion().getDate();
String modifiedDesc = docInfo2.getVersion().getName() + ", " + docInfo2.getVersion().getDate();
getRequestManager().showComparisonResults(DatabaseWindowManager.this, xmlTreeDiff, baselineDesc, modifiedDesc);
}
} finally {
mdiManager.unBlockWindow(getManagerID());
}
}
};
ClientTaskDispatcher.dispatch(getComponent(), new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 }, false);
}
use of cbit.xml.merge.XmlTreeDiff in project vcell by virtualcell.
the class DocumentWindowManager method compareWithSaved.
// /**
// * Insert the method's description here.
// * Creation date: (6/1/2004 2:50:14 AM)
// */
// public static void close(JInternalFrame[] editorFrames) {
// if (editorFrames != null && editorFrames.length > 0) {
// for (int i = 0; i < editorFrames.length; i++){
// close(editorFrames[i]);
// }
// }
// }
//
// /**
// * Insert the method's description here.
// * Creation date: (6/1/2004 2:50:14 AM)
// */
// public static void close(JFrame editorFrame) {
// pane.getDesktopManager().closeFrame(editorFrame);
// editorFrame.dispose();
// }
//
/**
*Processes the comparison (XML based) of the loaded model with its saved edition.
* Creation date: (6/1/2004 9:58:46 PM)
*/
public void compareWithSaved() {
if (getVCDocument().getVersion() == null) {
// shouldn't happen (menu should not be available), but check anyway...
PopupGenerator.showErrorDialog(this, "There is no saved version of this document");
return;
}
final MDIManager mdiManager = new ClientMDIManager(getRequestManager());
mdiManager.blockWindow(getManagerID());
String taskName = "Comparing with saved";
AsynchClientTask task1 = new AsynchClientTask(taskName, AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
XmlTreeDiff xmlTreeDiff = getRequestManager().compareWithSaved(getVCDocument());
hashTable.put("xmlTreeDiff", xmlTreeDiff);
}
};
AsynchClientTask task2 = new AsynchClientTask(taskName, AsynchClientTask.TASKTYPE_SWING_BLOCKING, false, false) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
try {
if (hashTable.get(ClientTaskDispatcher.TASK_ABORTED_BY_ERROR) == null) {
XmlTreeDiff xmlTreeDiff = (XmlTreeDiff) hashTable.get("xmlTreeDiff");
String baselineDesc = getVCDocument() + ", " + (getVCDocument().getVersion() == null ? "not saved" : getVCDocument().getVersion().getDate());
String modifiedDesc = "Opened document instance";
getRequestManager().showComparisonResults(DocumentWindowManager.this, xmlTreeDiff, baselineDesc, modifiedDesc);
}
} finally {
mdiManager.unBlockWindow(getManagerID());
}
}
};
ClientTaskDispatcher.dispatch(getComponent(), new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 }, false);
}
Aggregations