Révision 2735

tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java (revision 2735)
358 358
						StatusLine.setMessage("");
359 359
					}
360 360
					else {
361
						StatusLine.setMessage(((TXMResult) selectedItem).getDetails());
361
						// TODO uncomment when status line will be restored
362
						// StatusLine.setMessage(((TXMResult) selectedItem).getDetails());
362 363
					}
363 364
				}
364
				
365 365
			}
366 366
			
367 367
			@Override
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 2735)
887 887
			return this.computingJob;
888 888
		}
889 889
		
890
		StatusLine.setMessage(this.getResult().getComputingStartMessage());
890
		// TODO uncomment when StatusLine behavior will be decided
891
		// StatusLine.setMessage(this.getResult().getComputingStartMessage());
891 892
		
892 893
		// FIXME: SJ: tests to hide/display the result area while computing
893 894
		// this.resultArea.setVisible(false);
......
993 994
								// focus in the main widget
994 995
								setFocus();
995 996
								
996
								StatusLine.setMessage(TXMEditor.this.getResult().getComputingDoneMessage());
997
								// TODO uncomment when StatusLine behavior will be decided
998
								// StatusLine.setMessage(TXMEditor.this.getResult().getComputingDoneMessage());
997 999
								
998 1000
								// FIXME: SJ: tests to enable/disable the editor widgets while computing
999 1001
								// recursiveSetEnabled(true);
......
1068 1070
			// && !editorInput.getResult().getParent().hasBeenComputedOnce()
1069 1071
			) {
1070 1072
				try {
1071
					if (editorInput.getResult().isDirty()) {
1072
						try {
1073
							StatusLine.setMessage(editorInput.getResult().getComputingStartMessage());
1074
						}
1075
						catch (Exception e) {
1076
							// TODO Auto-generated catch block
1077
							e.printStackTrace();
1078
						}
1079
					}
1073
					// TODO uncomment when StatusLine behavior will be decided
1074
					// if (editorInput.getResult().isDirty()) {
1075
					// try {
1076
					// StatusLine.setMessage(editorInput.getResult().getComputingStartMessage());
1077
					// }
1078
					// catch (Exception e) {
1079
					// // TODO Auto-generated catch block
1080
					// e.printStackTrace();
1081
					// }
1082
					// }
1080 1083
					
1081 1084
					ComputeProgressMonitorDialog dialog = new ComputeProgressMonitorDialog(window.getShell(), editorInput.getResult());
1082 1085
					dialog.runComputingProcess(true);
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 2735)
164 164
	 * The user name (to rename a result).
165 165
	 */
166 166
	@Parameter(key = TXMPreferences.USER_NAME, type = Parameter.INTERNAL)
167
	protected String userName;
167
	private String userName;
168 168
	
169 169
	/**
170 170
	 * To store the simple name for unserialization and lazy loading.
tmp/org.txm.core/src/java/org/txm/objects/Text.java (revision 2735)
120 120
		catch (Exception e2) {
121 121
		}
122 122
		
123
		userName = e.getAttribute("name"); //$NON-NLS-1$
123
		this.setUserName(e.getAttribute("name")); //$NON-NLS-1$
124 124
		
125 125
		Element editionsnode = (Element) e.getElementsByTagName("editions").item(0); //$NON-NLS-1$
126 126
		NodeList editionList = editionsnode.getElementsByTagName("edition"); //$NON-NLS-1$
......
267 267
	}
268 268
	
269 269
	public void setName(String name) {
270
		this.userName = name;
270
		this.setUserName(name);
271 271
	}
272 272
	
273 273
	public void setSourceFile(File src) {
......
283 283
	
284 284
	@Override
285 285
	public String getName() {
286
		return userName;
286
		return getUserName();
287 287
	}
288 288
	
289 289
	@Override
290 290
	public String getSimpleName() {
291
		return userName;
291
		return getUserName();
292 292
	}
293 293
	
294 294
	@Override
295 295
	public String getDetails() {
296
		return userName;
296
		return getUserName();
297 297
	}
298 298
	
299 299
	@Override
......
325 325
	
326 326
	@Override
327 327
	public String toString() {
328
		return userName + " (file: " + pXMLTXMFile + ")";
328
		return getUserName() + " (file: " + pXMLTXMFile + ")";
329 329
	}
330 330
}
tmp/org.txm.core/src/java/org/txm/objects/SavedQuery.java (revision 2735)
100 100
	}
101 101
	
102 102
	protected boolean setParameters(Element pElement) {
103
		this.userName = pElement.getAttribute("name"); //$NON-NLS-1$
103
		this.setUserName(pElement.getAttribute("name")); //$NON-NLS-1$
104 104
		this.pValue = pElement.getAttribute("value"); //$NON-NLS-1$
105 105
		this.examples = new ArrayList<>();
106 106
		NodeList examplesN = pElement.getElementsByTagName("example"); //$NON-NLS-1$
......
108 108
			Element e = (Element) examplesN.item(i);
109 109
			examples.add(e.getTextContent());
110 110
		}
111
		if (this.userName == null || this.pValue == null)
111
		if (this.getUserName() == null || this.pValue == null)
112 112
			return false;
113 113
		return true;
114 114
	}
......
137 137
	 */
138 138
	@Override
139 139
	public String toString() {
140
		return this.userName + "=" + this.pValue; // + " >> " + this.examples; //$NON-NLS-1$
140
		return this.getUserName() + "=" + this.pValue; // + " >> " + this.examples; //$NON-NLS-1$
141 141
	}
142 142
	
143 143
	@Override
......
152 152
	
153 153
	@Override
154 154
	public boolean setParameters(TXMParameters parameters) throws Exception {
155
		this.userName = parameters.getString(TBXPreferences.NAME);
155
		this.setUserName(parameters.getString(TBXPreferences.NAME));
156 156
		this.pValue = parameters.getString(TBXPreferences.VALUE);
157 157
		return true;
158 158
	}
159 159
	
160 160
	@Override
161 161
	public String getName() {
162
		return userName;
162
		return getUserName();
163 163
	}
164 164
	
165 165
	@Override
166 166
	public String getSimpleName() {
167
		return userName;
167
		return getUserName();
168 168
	}
169 169
	
170 170
	@Override
......
193 193
	}
194 194
	
195 195
	public void setParameters(String query, ArrayList<String> examples) {
196
		this.userName = query;
196
		this.setUserName(query);
197 197
		this.pValue = query;
198 198
		this.examples = examples;
199 199
	}
tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java (revision 2735)
229 229
	 */
230 230
	@SuppressWarnings("unchecked")
231 231
	public List<SavedQuery> getQueriesLog() {
232
		return (List<SavedQuery>) getChildren(SavedQuery.class);
232
		return getChildren(SavedQuery.class);
233 233
	}
234 234
	
235 235
	// /**
......
334 334
	protected boolean _load(Element e) {
335 335
		if (e == null) return false;
336 336
		
337
		this.userName = e.getAttribute(NAME);
337
		this.setUserName(e.getAttribute(NAME));
338 338
		this.pID = e.getAttribute(NAME);
339 339
		// this.pLanguage = e.getAttribute(LANG);
340 340
		// System.out.println("LOAD BASE "+this.name);
......
943 943
	}
944 944
	
945 945
	public void setName(String name) {
946
		this.userName = name;
946
		this.setUserName(name);
947 947
	}
948 948
	
949 949
	protected void setID(String id) {
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 2735)
113 113
	protected boolean _load(Element e) {
114 114
		// pType = e.getAttribute("type"); //$NON-NLS-1$
115 115
		pIndex = e.getAttribute("index"); //$NON-NLS-1$
116
		userName = e.getAttribute("name"); //$NON-NLS-1$
116
		this.setUserName(e.getAttribute("name")); //$NON-NLS-1$
117 117
		
118 118
		// System.out.println(" build edition "+name);
119 119
		NodeList pagesList = e.getElementsByTagName("page"); //$NON-NLS-1$
......
344 344
	@Override
345 345
	public String toString() {
346 346
		try {
347
			return "Edition [name=" + userName + " index=" + pIndex + ", pages=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
347
			return "Edition [name=" + getUserName() + " index=" + pIndex + ", pages=" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
348 348
					+ pPageNames.size() + "]"; //$NON-NLS-1$
349 349
		}
350 350
		catch (Exception e) {
......
401 401
	
402 402
	@Override
403 403
	public String getName() {
404
		return userName;
404
		return getUserName();
405 405
	}
406 406
	
407 407
	@Override
408 408
	public String getSimpleName() {
409
		return userName;
409
		return getUserName();
410 410
	}
411 411
	
412 412
	@Override
413 413
	public String getDetails() {
414
		return userName;
414
		return getUserName();
415 415
	}
416 416
	
417 417
	@Override
......
455 455
	}
456 456
	
457 457
	public void setName(String name) {
458
		this.userName = name;
458
		this.setUserName(name);
459 459
	}
460 460
	
461 461
	public ArrayList<String> getPageNames() {
tmp/org.txm.core/src/java/org/txm/objects/Workspace.java (revision 2735)
132 132
			}
133 133
		}
134 134
		
135
		this.userName = corporaProject.getName(); // corpora
135
		this.setUserName(corporaProject.getName()); // corpora
136 136
		// this.setPath("/"+pName);
137 137
		// this.xmlDefinitionFile = xmlfile;
138 138
	}
......
177 177
	
178 178
	@Override
179 179
	public String getSimpleName() {
180
		return userName;
180
		return getUserName();
181 181
	}
182 182
	
183 183
	@Override
184 184
	public String getDetails() {
185
		return userName;
185
		return getUserName();
186 186
	}
187 187
	
188 188
	@Override
......
193 193
	@Override
194 194
	@Deprecated
195 195
	public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
196
		// TODO Auto-generated method stub
197 196
		return false;
198 197
	}
199 198
	
......
376 375
	
377 376
	@Override
378 377
	public String getName() {
379
		return userName;
378
		return getUserName();
380 379
	}
381 380
	
382 381
	@Override
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 2735)
178 178
		super("/project/" + name + "/" + createUUID() + "_Project", workspace);
179 179
		
180 180
		this.needToBuild = needToBuild;
181
		this.userName = name;
181
		this.setUserName(name);
182 182
		
183 183
		this.setVisible(false);
184 184
		
......
324 324
	
325 325
	@Override
326 326
	public boolean canCompute() throws Exception {
327
		if (userName == null) {
327
		if (getUserName() == null) {
328 328
			Log.severe("Project.canCompute(): can not compute with missing name.");
329 329
			return false;
330 330
		}
......
613 613
	 */
614 614
	public boolean _load(BaseOldParameters params) throws Exception {
615 615
		params.load();
616
		userName = params.name;
616
		this.setUserName(params.name);
617 617
		
618
		// set the improt module name using the Loader script name
618
		// set the import module name using the Loader script name
619 619
		this.pImportModuleName = params.scriptFile;
620 620
		if (this.pImportModuleName != null) {
621 621
			int idx = this.pImportModuleName.indexOf("Loader.groovy");
......
636 636
			pSrcDirectory = new File(getProjectDirectory(), "src");
637 637
		}
638 638
		
639
		File dir = new File(this.getWorkspace().getLocation(), userName);
639
		File dir = new File(this.getWorkspace().getLocation(), getUserName());
640 640
		File paramFile = new File(dir, "import.xml");
641 641
		if (!paramFile.exists()) return false;
642 642
		
......
841 841
	 */
842 842
	public File getProjectDirectory() {
843 843
		if (this.rcpProject == null || this.rcpProject.getLocation() == null) {
844
			return new File(Toolbox.workspace.getLocation(), "corpora/" + this.userName);
844
			return new File(Toolbox.workspace.getLocation(), "corpora/" + this.getUserName());
845 845
		}
846 846
		return this.rcpProject.getLocation().toFile();
847 847
	}
......
926 926
	
927 927
	@Override
928 928
	public String getName() {
929
		return userName;
929
		return getUserName();
930 930
	}
931 931
	
932 932
	@Override
933 933
	public String getSimpleName() {
934
		return userName;
934
		return getUserName();
935 935
	}
936 936
	
937 937
	@Override
938 938
	public String getDetails() {
939
		return userName;
939
		return getUserName();
940 940
	}
941 941
	
942 942
	@Override
......
962 962
	}
963 963
	
964 964
	public void setName(String name) {
965
		this.userName = name;
965
		this.setUserName(name);
966 966
	}
967 967
	
968
	
969
	
970 968
	@Override
971 969
	public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
972 970
		return false;
......
1390 1388
	
1391 1389
	@Override
1392 1390
	public String toString() {
1393
		return this.userName;// +((this.rcpProject != null && this.rcpProject.getLocation() != null)?" ("+this.rcpProject.getLocation()+")":"");
1391
		return this.getUserName();// +((this.rcpProject != null && this.rcpProject.getLocation() != null)?" ("+this.rcpProject.getLocation()+")":"");
1394 1392
	}
1395 1393
	
1396 1394
	/**
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 2735)
128 128
			String parent_id = this.getCorpusParent().getQualifiedCqpId();
129 129
			CorpusManager.getCorpusManager().getCqiClient().cqpQuery(parent_id, this.pID, CQLQuery.fixQuery(this.pQuery.getQueryString()));
130 130
			
131
			this.qresult = new QueryResult(this.pID, this.userName, this.getCorpusParent(), this.pQuery); // getCorpusParent().query(pQuery, this.pID, true);
131
			this.qresult = new QueryResult(this.pID, this.getUserName(), this.getCorpusParent(), this.pQuery); // getCorpusParent().query(pQuery, this.pID, true);
132 132
		}
133 133
		
134 134
		cqpTextIDS = null; // reset text ids cache
......
158 158
	@Override
159 159
	protected boolean _load(Element e) {
160 160
		if (e != null) {
161
			this.userName = e.getAttribute(NAME);
161
			this.setUserName(e.getAttribute(NAME));
162 162
			this.pID = "S" + getNextSubcorpusCounter();
163 163
			this.pQuery = new CQLQuery(e.getAttribute("query")); //$NON-NLS-1$
164 164
			
......
210 210
	
211 211
	@Override
212 212
	public boolean canCompute() {
213
		return userName != null && userName.length() > 0 &&
213
		return getUserName() != null && getUserName().length() > 0 &&
214 214
				((pQuery != null && pQuery.getQueryString().length() > 0) || qresult != null);
215 215
	}
216 216
	
......
510 510
	protected void setParameters(String pID, String name, CQLQuery query) throws InvalidCqpIdException {
511 511
		this.pID = pID;
512 512
		this.pQuery = query;
513
		this.userName = name;
513
		this.setUserName(name);
514 514
	}
515 515
	
516 516
	/**
......
521 521
	 */
522 522
	public void setParameters(String cqpId, String name, QueryResult queryResult) {
523 523
		this.pID = cqpId;
524
		this.userName = name;
524
		this.setUserName(name);
525 525
		this.pQuery = queryResult.getQuery();
526 526
		this.qresult = queryResult;
527 527
		
......
744 744
	
745 745
	@Override
746 746
	public String getSimpleName() {
747
		return this.userName;
747
		return this.getUserName();
748 748
	}
749 749
	
750 750
	@Override
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 2735)
55 55
	public Part(Partition partition, String partName, String query) {
56 56
		super(partition);
57 57

  
58
		this.userName = partName;
58
		this.setUserName(partName);
59 59
		this.pQuery = new CQLQuery(query);
60 60
		this.pID = CqpObject.partNamePrefix + CQPCorpus.getNextSubcorpusCounter();
61 61
		this.setVisible(false);
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 2735)
146 146
	 */
147 147
	public boolean _compute_with_lists(TXMProgressMonitor monitor) throws Exception {
148 148
		
149
		if (this.userName == null || this.userName.length() == 0) {
150
			this.userName = "no_name";
149
		if (this.getUserName() == null || this.getUserName().length() == 0) {
150
			this.setUserName("no_name");
151 151
		}
152 152
		
153
		Log.finest(NLS.bind(SearchEngineCoreMessages.info_creatingNewPartition, this.userName, this.getParent()));
153
		Log.finest(NLS.bind(SearchEngineCoreMessages.info_creatingNewPartition, this.getUserName(), this.getParent()));
154 154
		long start = System.currentTimeMillis();
155 155
		
156 156
		monitor.setTask("Building parts...");
......
170 170
			
171 171
		}
172 172
		long end = System.currentTimeMillis();
173
		Log.fine(NLS.bind(SearchEngineCoreMessages.info_partitionCreatedInXMs, this.userName, (end - start)));
173
		Log.fine(NLS.bind(SearchEngineCoreMessages.info_partitionCreatedInXMs, this.getUserName(), (end - start)));
174 174
		
175 175
		return pQueries.size() > 0;
176 176
	}
......
193 193
	protected boolean _compute_with_property(TXMProgressMonitor monitor) throws Exception {
194 194
		
195 195
		CQPCorpus corpus = this.getParent();
196
		if (this.userName == null || this.userName.length() == 0) {
197
			this.userName = corpus.getName() + "_" + pProperty.getFullName(); //$NON-NLS-1$
196
		if (this.getUserName() == null || this.getUserName().length() == 0) {
197
			this.setUserName(corpus.getName() + "_" + pProperty.getFullName()); //$NON-NLS-1$
198 198
		}
199 199
		
200
		Log.finest(NLS.bind(SearchEngineCoreMessages.info_creatingNewPartition, this.userName, this.getParent()));
200
		Log.finest(NLS.bind(SearchEngineCoreMessages.info_creatingNewPartition, this.getUserName(), this.getParent()));
201 201
		
202 202
		if (pValues == null) {
203 203
			pValues = pProperty.getValues(corpus);
......
374 374
	
375 375
	@Override
376 376
	public String getDetails() {
377
		String name = this.userName;
377
		String name = this.getUserName();
378 378
		int partsCount = this.getPartsCount();
379 379
		
380 380
		if (partsCount > 0) {
......
386 386
	
387 387
	@Override
388 388
	public String getSimpleName() {
389
		return this.userName;
389
		return this.getUserName();
390 390
	}
391 391
	
392 392
	@Override
......
526 526
	 *             the cqi client exception
527 527
	 */
528 528
	public List<QueryResult> query(CQLQuery query, String name) throws CqiClientException {
529
		Log.finest(TXMCoreMessages.queryingPartitionP0 + this.userName);
529
		Log.finest(TXMCoreMessages.queryingPartitionP0 + this.getUserName());
530 530
		List<Part> parts = getParts();
531 531
		List<QueryResult> results = new ArrayList<>(parts.size());
532 532
		for (Subcorpus part : parts) {
......
604 604
	
605 605
	@Override
606 606
	public String toString() {
607
		if (!this.userName.isEmpty()) {
608
			return this.userName;
607
		if (!this.getUserName().isEmpty()) {
608
			return this.getUserName();
609 609
		}
610 610
		return super.toString();
611 611
	}
......
620 620
	public boolean setParameters(String name, StructuralUnitProperty property, List<String> values) {
621 621
		this.pProperty = property;
622 622
		this.pValues = values;
623
		this.userName = name;
623
		this.setUserName(name);
624 624
		this.pQueries = null;
625 625
		this.pPartNames = null;
626 626
		return true;
......
629 629
	public boolean setParameters(String name, List<String> queries, List<String> names) {
630 630
		this.pProperty = null;
631 631
		this.pValues = null;
632
		this.userName = name;
632
		this.setUserName(name);
633 633
		this.pQueries = queries;
634 634
		this.pPartNames = names;
635 635
		return true;
......
637 637
	
638 638
	@Override
639 639
	public boolean setParameters(TXMParameters parameters) {
640
		this.userName = parameters.getString(TXMPreferences.USER_NAME);
640
		this.setUserName(parameters.getString(TXMPreferences.USER_NAME));
641 641
		String tmp = parameters.getString(CQPPreferences.PART_NAMES);
642 642
		if (tmp != null) {
643 643
			this.pPartNames = Arrays.asList(tmp.split("\t"));
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java (revision 2735)
927 927
	
928 928
	@Override
929 929
	public String getName() {
930
		return this.userName;
930
		return this.getUserName();
931 931
	}
932 932
	
933 933
	/**
......
1028 1028
	
1029 1029
	@Override
1030 1030
	public String getSimpleName() {
1031
		return this.userName;
1031
		return this.getUserName();
1032 1032
	}
1033 1033
	
1034 1034
	// /* (non-Javadoc)
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 2735)
611 611
	
612 612
	@Override
613 613
	public void setName(String name) {
614
		this.userName = name;
614
		this.setUserName(name);
615 615
	}
616 616
	
617 617
	@Override
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java (revision 2735)
58 58
 * @author mdecorde.
59 59
 */
60 60
public class SendToRCommand extends BaseAbstractHandler {
61

  
62
	/* (non-Javadoc)
61
	
62
	/*
63
	 * (non-Javadoc)
63 64
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
64 65
	 */
65 66
	@Override
66 67
	public Object execute(ExecutionEvent event) throws ExecutionException {
67

  
68
		if(!super.checkStatsEngine())	{
68
		
69
		if (!super.checkStatsEngine()) {
69 70
			return null;
70 71
		}
71

  
72
		
72 73
		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
73

  
74
		
74 75
		final List list = selection.toList();
75
		JobHandler jobhandler = new JobHandler(RUIMessages.sendingToRWorkspaceColon+ list) {
76
		JobHandler jobhandler = new JobHandler(RUIMessages.sendingToRWorkspaceColon + list) {
77
			
76 78
			@Override
77 79
			protected IStatus run(IProgressMonitor monitor) {
78 80
				this.runInit(monitor);
79 81
				try {
80 82
					JobsTimer.start();
81 83
					
82
					monitor.beginTask(RUIMessages.sendingToRWorkspaceColon+ list, 100);
84
					monitor.beginTask(RUIMessages.sendingToRWorkspaceColon + list, 100);
83 85
					int delta = 100 / list.size();
84
					for(Object o : list) {
86
					for (Object o : list) {
85 87
						if (o instanceof TXMResult) {
86 88
							try {
87
								monitor.subTask(RUIMessages.sendingToRWorkspaceColon+ o);
89
								monitor.subTask(RUIMessages.sendingToRWorkspaceColon + o);
88 90
								this.acquireSemaphore();
89
								String symbol = send((TXMResult)o);
91
								String symbol = send((TXMResult) o);
90 92
								if (symbol == null) {
91
									Log.info(NLS.bind("** {0} was not transfered to the R workspace.", ((TXMResult) o).getSimpleName()));
93
									Log.info(NLS.bind("** {0} was not transfered to the R workspace.", o));
92 94
									this.releaseSemaphore();
93 95
									return Status.CANCEL_STATUS;
94
								} else {
96
								}
97
								else {
95 98
									Log.info(NLS.bind("{0} has been copied in the ''{1}'' R variable.", o.toString(), symbol));
96 99
								}
97 100
								this.releaseSemaphore();
98

  
101
								
99 102
								monitor.worked(delta);
100

  
101
							} catch (Exception e) {
102
								System.out.println("Failed to send to R: "+o);
103
								
104
							}
105
							catch (Exception e) {
106
								System.out.println("Failed to send to R: " + o);
103 107
								org.txm.utils.logger.Log.printStackTrace(e);
104 108
							}
105 109
						}
......
107 111
					
108 112
					monitor.subTask(RUIMessages.refreshingViews);
109 113
					this.syncExec(new Runnable() {
114
						
110 115
						@Override
111 116
						public void run() {
112 117
							CorporaView.refresh();
113 118
							RVariablesView.reload();
114 119
						}
115 120
					});
116
				} catch (ThreadDeath td) {
121
				}
122
				catch (ThreadDeath td) {
117 123
					return Status.CANCEL_STATUS;
118
				} finally {
124
				}
125
				finally {
119 126
					monitor.done();
120 127
					JobsTimer.stopAndPrint();
121 128
				}
......
123 130
			}
124 131
		};
125 132
		jobhandler.startJob();
126

  
127

  
133
		
134
		
128 135
		return null;
129 136
	}
130

  
137
	
131 138
	/**
132 139
	 * Static method to create a R object from a TXMResult
133 140
	 *
......
135 142
	 * @throws Exception the exception
136 143
	 */
137 144
	public String send(TXMResult o) throws Exception {
138
	
139
		RStatsEngine rengine = (RStatsEngine)StatsEnginesManager.getREngine();
145
		
146
		RStatsEngine rengine = (RStatsEngine) StatsEnginesManager.getREngine();
140 147
		HashMap<String, RTransformer<? extends TXMResult>> transformers = rengine.getTransformers();
141 148
		if (transformers.containsKey(o.getClass().getName())) {
142 149
			RTransformer<? extends TXMResult> transformer = rengine.getTransformers().get(o.getClass().getName());
143 150
			return transformer.fromTXMtoR(o);
144
		} else {
151
		}
152
		else {
145 153
			return null;
146 154
		}
147
	//TODO: MD: create the SendToRCommands commands in all plugins that manage the following TXMResult classes
148
	/*{
149

  
150
		if (o instanceof Lexicon) 
151
		{
152
			Lexicon lex = (Lexicon) o;
153
			Vector v = lex.asVector();
154
			lex.setSymbol(v.getSymbol());
155

  
156
			System.out.println(lex.getName()+" >> "+lex.getSymbol()); //$NON-NLS-1$
157
		}  else if (o instanceof Corpus) {
158
			Corpus corpus = (Corpus) o;
159
			String symbol = corpus.SendToR();
160

  
161
			System.out.println(corpus.getName()+" >> "+symbol); //$NON-NLS-1$
162
		} else if (o instanceof Concordance) {
163
			Concordance conc = (Concordance) o;
164
			String symbol = conc.asRMatrix();
165

  
166
			System.out.println(conc.getName()+" >> "+conc.getSymbol()); //$NON-NLS-1$
167
		} else if (o instanceof Referencer) {
168
			Referencer referencer = (Referencer) o;
169
			String symbol = referencer.asRMatrix();
170

  
171
			System.out.println(referencer.getName()+" >> "+referencer.getSymbol()); //$NON-NLS-1$
172
		} else if (o instanceof Cooccurrence) {
173
			Cooccurrence cooc = (Cooccurrence) o;
174
			String symbol = cooc.asRMatrix();
175

  
176
			System.out.println(cooc.getName()+" >> "+cooc.getSymbol()); //$NON-NLS-1$
177
		} else if (o instanceof Index) {
178
			Index voc = (Index) o;
179
			voc.asRMatrix();
180

  
181
			System.out.println(voc.getName()+" >> "+voc.getSymbol()); //$NON-NLS-1$
182
		}
155
		// TODO: MD: create the SendToRCommands commands in all plugins that manage the following TXMResult classes
156
		/*
157
		 * {
158
		 * if (o instanceof Lexicon)
159
		 * {
160
		 * Lexicon lex = (Lexicon) o;
161
		 * Vector v = lex.asVector();
162
		 * lex.setSymbol(v.getSymbol());
163
		 * System.out.println(lex.getName()+" >> "+lex.getSymbol()); //$NON-NLS-1$
164
		 * } else if (o instanceof Corpus) {
165
		 * Corpus corpus = (Corpus) o;
166
		 * String symbol = corpus.SendToR();
167
		 * System.out.println(corpus.getName()+" >> "+symbol); //$NON-NLS-1$
168
		 * } else if (o instanceof Concordance) {
169
		 * Concordance conc = (Concordance) o;
170
		 * String symbol = conc.asRMatrix();
171
		 * System.out.println(conc.getName()+" >> "+conc.getSymbol()); //$NON-NLS-1$
172
		 * } else if (o instanceof Referencer) {
173
		 * Referencer referencer = (Referencer) o;
174
		 * String symbol = referencer.asRMatrix();
175
		 * System.out.println(referencer.getName()+" >> "+referencer.getSymbol()); //$NON-NLS-1$
176
		 * } else if (o instanceof Cooccurrence) {
177
		 * Cooccurrence cooc = (Cooccurrence) o;
178
		 * String symbol = cooc.asRMatrix();
179
		 * System.out.println(cooc.getName()+" >> "+cooc.getSymbol()); //$NON-NLS-1$
180
		 * } else if (o instanceof Index) {
181
		 * Index voc = (Index) o;
182
		 * voc.asRMatrix();
183
		 * System.out.println(voc.getName()+" >> "+voc.getSymbol()); //$NON-NLS-1$
184
		 * }
185
		 * }
186
		 */
183 187
	}
184
	 */
185
	}
186
}
188
}

Formats disponibles : Unified diff