|
On Mar 20, 2012, at 10:31 AM, Christophe Leterrier wrote:
> Hi,
>
> I'd like to process the Results Table output at the end of a plugin,
> i.e. launch a script that would get the values in this displayed Table
> after the plugin has finished. However, this Table is not the System
> Results Table, so the ResultsTable.getResultsTable() static method
> does not work. How can I do that? Is there something that would grab
> the content of a text table and create a Results Table object from it?
Here is JavaScript code that creates a results table named "Sine/Cosine Table":
rt = new ResultsTable();
for (n=0; n<=2*Math.PI; n += 0.1) {
rt.incrementCounter();
rt.addValue("n", n);
rt.addValue("Sine(n)", Math.sin(n));
rt.addValue("Cos(n)", Math.cos(n));
}
rt.showRowNumbers(false);
rt.show("Sine/Cosine Table");
And here is JavaScript code that gets that table's ResultsTable:
window = WindowManager.getFrame("Sine/Cosine Table");
if (window!=null) {
rt = window.getTextPanel().getResultsTable();
}
This is what it looks like in Java:
Frame window = WindowManager.getFrame("Sine/Cosine Table");
if (window ==null) return;
ResultsTable rt = ((TextWindow)window).getTextPanel().getResultsTable();
-wayne
|