Révision 3923
TXM/trunk/bundles/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java (revision 3923) | ||
---|---|---|
73 | 73 |
|
74 | 74 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); |
75 | 75 |
|
76 |
final List list = selection.toList(); |
|
76 |
final List<?> list = selection.toList();
|
|
77 | 77 |
JobHandler jobhandler = new JobHandler(RUIMessages.sendingToRWorkspaceColon + list) { |
78 | 78 |
|
79 | 79 |
@Override |
... | ... | |
85 | 85 |
monitor.beginTask(RUIMessages.sendingToRWorkspaceColon + list, 100); |
86 | 86 |
int delta = 100 / list.size(); |
87 | 87 |
for (Object o : list) { |
88 |
|
|
89 |
if (o instanceof TXMResult) { |
|
90 |
try { |
|
91 |
((TXMResult)o).compute(false); |
|
92 |
} |
|
93 |
catch (InterruptedException e) { |
|
94 |
e.printStackTrace(); |
|
95 |
continue; |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
88 | 99 |
if (o instanceof RResult) { |
89 |
Log.info(NLS.bind(RUIMessages.P0HasBeenCopiedInTheP1RVariable, ((RResult)o).toString(), ((RResult)o).getRSymbol()));
|
|
100 |
Log.info(NLS.bind("{0} R symbol is: {1}.", ((RResult)o).toString(), ((RResult)o).getRSymbol()));
|
|
90 | 101 |
} else if (o instanceof TXMResult) { |
91 | 102 |
try { |
92 | 103 |
monitor.subTask(RUIMessages.sendingToRWorkspaceColon + o); |
93 | 104 |
this.acquireSemaphore(); |
94 | 105 |
String symbol = send((TXMResult) o); |
106 |
|
|
95 | 107 |
if (symbol == null) { |
96 | 108 |
Log.info(NLS.bind(RUIMessages.P0WasNotTransferedToTheRWorkspace, o)); |
97 | 109 |
this.releaseSemaphore(); |
... | ... | |
160 | 172 |
else { |
161 | 173 |
return null; |
162 | 174 |
} |
163 |
// TODO: MD: create the SendToRCommands commands in all plugins that manage the following TXMResult classes |
|
164 |
/* |
|
165 |
* { |
|
166 |
* if (o instanceof Lexicon) |
|
167 |
* { |
|
168 |
* Lexicon lex = (Lexicon) o; |
|
169 |
* Vector v = lex.asVector(); |
|
170 |
* lex.setSymbol(v.getSymbol()); |
|
171 |
* System.out.println(lex.getName()+" >> "+lex.getSymbol()); //$NON-NLS-1$ |
|
172 |
* } else if (o instanceof Corpus) { |
|
173 |
* Corpus corpus = (Corpus) o; |
|
174 |
* String symbol = corpus.SendToR(); |
|
175 |
* System.out.println(corpus.getName()+" >> "+symbol); //$NON-NLS-1$ |
|
176 |
* } else if (o instanceof Concordance) { |
|
177 |
* Concordance conc = (Concordance) o; |
|
178 |
* String symbol = conc.asRMatrix(); |
|
179 |
* System.out.println(conc.getName()+" >> "+conc.getSymbol()); //$NON-NLS-1$ |
|
180 |
* } else if (o instanceof Referencer) { |
|
181 |
* Referencer referencer = (Referencer) o; |
|
182 |
* String symbol = referencer.asRMatrix(); |
|
183 |
* System.out.println(referencer.getName()+" >> "+referencer.getSymbol()); //$NON-NLS-1$ |
|
184 |
* } else if (o instanceof Cooccurrence) { |
|
185 |
* Cooccurrence cooc = (Cooccurrence) o; |
|
186 |
* String symbol = cooc.asRMatrix(); |
|
187 |
* System.out.println(cooc.getName()+" >> "+cooc.getSymbol()); //$NON-NLS-1$ |
|
188 |
* } else if (o instanceof Index) { |
|
189 |
* Index voc = (Index) o; |
|
190 |
* voc.asRMatrix(); |
|
191 |
* System.out.println(voc.getName()+" >> "+voc.getSymbol()); //$NON-NLS-1$ |
|
192 |
* } |
|
193 |
* } |
|
194 |
*/ |
|
195 | 175 |
} |
196 | 176 |
} |
Formats disponibles : Unified diff