Revision 479 tmp/org.txm.groovy.core/src/groovy/org/txm/export/ExportCAH.groovy

ExportCAH.groovy (revision 479)
1 1
package org.txm.export
2 2

  
3
//import org.txm.rcp.views.*
4
import org.txm.functions.classification.*
3
import org.txm.cah.core.functions.CAH
4
import org.txm.rcpapplication.views.*
5 5
import org.txm.stat.engine.r.*
6 6
// uncomment this
7
//import org.eclipse.jface.viewers.IStructuredSelection
7
import org.eclipse.jface.viewers.*
8 8

  
9 9
// Select the CAH result in the CorporaView and run this script
10 10

  
......
19 19
		def corporaview = CorporaView.getInstance()
20 20
		def tree = corporaview.getTreeViewer()
21 21
		// uncomment these 2 lines
22
//		def sel = (IStructuredSelection) tree.getSelection()
23
//		obj = sel.getFirstElement()
22
		def sel = tree.getSelection()
23
		obj = sel.getFirstElement()
24 24
		}
25 25
	});
26 26
println("Selected object: "+obj)
27 27

  
28
//TODO temporary commented
29
//if (obj != null && obj instanceof CAH) {
28
if (obj != null && obj instanceof CAH) {
30 29
	def rw = RWorkspace.getRWorkspaceInstance()
31 30
	rw.eval("sink(file=\"" + outfile.getAbsolutePath().replace("\\", "\\\\")+"\")")
32
	rw.eval("print("+obj.getSymbol()+")")
31
	rw.eval("print("+((CAH)obj).getSymbol()+")")
33 32
	rw.eval("sink()")
34 33
	println("CAH saved in file: "+outfile)
35
//}
34
}

Also available in: Unified diff