|
From: <hu...@us...> - 2006-12-07 20:32:37
|
Revision: 346
http://svn.sourceforge.net/cishell/?rev=346&view=rev
Author: huangb
Date: 2006-12-07 12:32:26 -0800 (Thu, 07 Dec 2006)
Log Message:
-----------
If the selected data is an in-memory JAVA object, some times, only one
converter can save the data to a file. In this case, the length of the
converters equals to 1. So the application should use this converter to
save the data to a temporary file directly and then bring the text editor.
Modified Paths:
--------------
trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/view/FileView.java
Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/view/FileView.java
===================================================================
--- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/view/FileView.java 2006-12-07 16:45:38 UTC (rev 345)
+++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/view/FileView.java 2006-12-07 20:32:26 UTC (rev 346)
@@ -96,8 +96,15 @@
data[i].getData().getClass().getName(),
"Please install a plugin that will save the data type to a file");
}
+ else if (converters.length == 1){
+ //If length=1, use the unique path to save it directly
+ //and bring the text editor.
+ Data newData = converters[0].convert(data[i]);
+ copy((File)newData.getData(), tempFile);
+ lastSaveSuccessful = true;
+ }
else {
- if (!parentShell.isDisposed()) {
+ if (!parentShell.isDisposed()) {
DataViewer dataViewer = new DataViewer(parentShell, data[i], converters);
display.syncExec(dataViewer);
lastSaveSuccessful = dataViewer.isSaved;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|