import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.osgi.service.prefs.Preferences;
import org.simantics.databoard.binding.mutable.Variant;
import org.simantics.databoard.type.RecordType;
) throws ExportException {
final TransferableGraphWriter writer = (TransferableGraphWriter) writer_;
-
+ SubMonitor ss = SubMonitor.convert(monitor, 2);
try {
List<Resource> resources = context.session.syncRequest( ExportQueries.toResources2(contents) );
+ SubMonitor subMonitor = ss.split(resources.size());
for ( final Resource model : resources ) {
// TODO: figure out a way to make the TG go directly into a file
// instead of having it all in memory at once.
public SimanticsClipboard perform(ReadGraph graph) throws DatabaseException {
CopyHandler ch = graph.adapt( model, CopyHandler.class );
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, subMonitor.split(1));
return clipboard;
}
});
+ SubMonitor subMonitor2 = ss.split(resources.size());
for (Set<Representation> object : clipboard.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
writer.writeFile(TransferableGraph1.BINDING, tg);
+ subMonitor2.worked(1);
}
}