Revision 731

tmp/org.txm.referencer.core/src/org/txm/referencer/core/preferences/ReferencerPreferences.java (revision 731)
30 30

  
31 31
		preferences.putBoolean(SORT_BY_FREQUENCIES, false);
32 32

  
33
		preferences.put(QUERY, ""); //$NON-NLS-1$
34
		preferences.put(UNIT_PROPERTY, "word"); //$NON-NLS-1$
33
		preferences.put(UNIT_PROPERTY, TXMPreferences.DEFAULT_UNIT_PROPERTY); //$NON-NLS-1$
35 34
		preferences.put(PATTERN, "text_id"); //$NON-NLS-1$
36 35
	}
37 36
}
tmp/org.txm.referencer.core/src/org/txm/referencer/core/functions/Referencer.java (revision 731)
543 543
	@Override
544 544
	public boolean canCompute() {
545 545

  
546
		if (pQuery == null 
547
				|| pQuery.isEmpty()) {
546
		if (pQuery == null || pQuery.isEmpty()) {
548 547
			System.out.println("Empty query");
549 548
			return false;
550 549
		}
551
		if (pPattern == null 
552
				|| pPattern.size() == 0) {
550
		if (pPattern == null || pPattern.size() == 0) {
553 551
			System.out.println("No reference pattern");
554 552
			return false;
555 553
		}
......
564 562
	@Override
565 563
	public boolean loadParameters() throws CqiClientException {
566 564
		this.pQuery = new Query(this.getStringParameterValue(ReferencerPreferences.QUERY));
567
		this.pPattern = StructuralUnitProperty.fromStringToList(this.getCorpus(), this.getStringParameterValue(ReferencerPreferences.PATTERN));
565
		this.pPattern = StructuralUnitProperty.stringToProperties(this.getCorpus(), this.getStringParameterValue(ReferencerPreferences.PATTERN));
568 566
		this.pProperty = this.getCorpus().getProperty(this.getStringParameterValue(ReferencerPreferences.UNIT_PROPERTY));
569 567
		return true;
570 568
	}
571 569

  
572 570
	@Override
573 571
	public boolean saveParameters() {
574
		// TODO Auto-generated method stub
575
		System.err.println("Referencer.saveParameters(): not yet implemented.");
572
		if (this.pQuery != null) {
573
			this.saveParameter(ReferencerPreferences.QUERY, this.pQuery.getQueryString());
574
		}
575

  
576
		if (this.pPattern != null) {
577
			this.saveParameter(ReferencerPreferences.PATTERN, StructuralUnitProperty.propertiesToString(this.pPattern));	
578
		}
579

  
580
		if (this.pProperty != null) {
581
			this.saveParameter(ReferencerPreferences.UNIT_PROPERTY, this.pProperty.getName());
582
		}
576 583
		return true;
577 584
	}
578 585

  
tmp/org.txm.queryindex.rcp/src/org/txm/rcp/editors/queryindex/QueryIndexEditor.java (revision 731)
818 818
		freqColumn = new TableColumn(viewer.getTable(), SWT.RIGHT);
819 819
		try {
820 820
			if (partition != null)
821
				freqColumn.setText(TXMUIMessages.FrequencyListEditorInput_4
821
				freqColumn.setText(TXMCoreMessages.common_frequency
822 822
						+ " T=" + partition.getTotalSize()); //$NON-NLS-1$
823 823
			else
824
				freqColumn.setText(TXMUIMessages.FrequencyListEditorInput_4
824
				freqColumn.setText(TXMCoreMessages.common_frequency
825 825
						+ " T=" + corpus.getSize()); //$NON-NLS-1$
826 826
		} catch (CqiClientException e2) {
827 827
			Log.printStackTrace(e2);
828 828
			return;
829 829
		}
830
		freqColumn.setToolTipText(TXMUIMessages.FrequencyListEditorInput_4);
830
		freqColumn.setToolTipText(TXMCoreMessages.common_frequency);
831 831
		freqColumn.setWidth(100);
832 832
		freqColumn.addSelectionListener(new SelectionListener() {
833 833
			@Override
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 731)
237 237
	
238 238
	
239 239
	/**
240
	 * Create a CQL query using an Index lines
240
	 * Creates a CQL query string from the specified Index lines.
241 241
	 *
242
	 * @param selection the selection
242
	 * @param lines
243 243
	 * @return the query
244 244
	 */
245 245
	public static String createQuery(List<Line> lines) {
......
280 280
	}
281 281

  
282 282

  
283
	/**
284
	 * Creates a Query list from the specified Index lines.
285
	 * @param lines
286
	 * @return
287
	 */
288
	public static List<Query> createQueries(List<Line> lines) {
289
		List<Query> queries = new ArrayList<Query>();
290
		for (Line line : lines) {
291
			String query = ""; //$NON-NLS-1$
292
			int nbToken = line.getUnitsProperties().get(0).size();
293
			int nbProps = line.getProperties().size();
294
			List<List<String>> values = line.getUnitsProperties();
295
			List<Property> props = line.getProperties();
296
			for (int t = 0; t < nbToken; t++) {
297
				query += "["; //$NON-NLS-1$
298
				for (int p = 0; p < nbProps; p++) {
299
					query += props.get(p).getName() + "=\""; //$NON-NLS-1$
300
					String s = values.get(p).get(t);
301
					s = Query.addBackSlash(s);
302
					query += s;
303
					query += "\" & "; //$NON-NLS-1$
304
				}
305
				query = query.substring(0, query.length() - 3);
306
				query += "] "; //$NON-NLS-1$
307
			}
308
			queries.add(new Query(query));
309
		}
310
		return queries;
311

  
312
	}
283 313
	
284 314
	
315
	
285 316
	/**
286 317
	 * This method alter the index first column frequencies using a table stored in the R workspace
287 318
	 * 
......
338 369
	@Override
339 370
	public boolean saveParameters() {
340 371
			
341
		this.saveParameter(IndexPreferences.PROPERTIES, WordProperty.fromListToPreferenceString(pProperties));
372
		this.saveParameter(IndexPreferences.PROPERTIES, WordProperty.propertiesToString(pProperties));
342 373
		
343 374
		if (pQuery != null) {
344 375
			this.saveParameter(IndexPreferences.QUERY, pQuery.getQueryString());
......
350 381
	
351 382
	@Override
352 383
	public boolean loadParameters() {
353
		String s = this.getStringParameterValue(IndexPreferences.PROPERTIES);
354
		this.pProperties = WordProperty.fromStringToList(getCorpus(), s);
384
		this.pProperties = (List<Property>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(IndexPreferences.PROPERTIES));
355 385
		this.pQuery = new Query(this.getStringParameterValue(IndexPreferences.QUERY));
356 386
		return true;
357 387
	}
......
439 469
		// assume the lines are sorted
440 470
		//int before = lines.size();
441 471
		this.lines = this.lines.subList(0, Math.min(lines.size(), pVmaxFilter));
442
		updateFminFmax();
472
		this.updateFminFmax();
443 473

  
444 474
		this.releaseSemaphore();
445 475
	}
......
740 770
	public String getSimpleName() {
741 771
		if (lexicon != null) {
742 772
			return lexicon.getSimpleName();
743
		} else {
773
		}
774
		else {
744 775
			try {
745
				String name = pQuery.getQueryString() + ": "; //$NON-NLS-1$
776
				
777
				String name = ""; //$NON-NLS-1$
778
				
779
				if (pQuery != null && !pQuery.isEmpty())	{
780
					name += pQuery.getQueryString();
781
				}
782
				else	{
783
					name += this.getEmptyName();
784
				}
785
				name += ": "; //$NON-NLS-1$
786
				
746 787
				for (Property s : pProperties)	{
747 788
					name += s.getName() + pPropertiesSeparator;
748 789
				}
tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java (revision 731)
70 70
	public boolean loadParameters() throws Exception {
71 71
		try {
72 72
			this.structuralUnit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(InternalViewPreferences.STRUCTURAL_UNIT));
73
			this.wordProperties = WordProperty.fromStringToList(this.getCorpus(), this.getStringParameterValue(InternalViewPreferences.WORD_PROPERTIES));
74
			this.structuralUnitsProperties = StructuralUnitProperty.stringToStructuralUnitProperties(this.getCorpus(), this.getStringParameterValue(InternalViewPreferences.STRUCTURAL_UNIT_PROPERTIES));
73
			this.wordProperties = (List<Property>) Property.stringToProperties(this.getCorpus(), this.getStringParameterValue(InternalViewPreferences.WORD_PROPERTIES));
74
			this.structuralUnitsProperties = StructuralUnitProperty.stringToProperties(this.getCorpus(), this.getStringParameterValue(InternalViewPreferences.STRUCTURAL_UNIT_PROPERTIES));
75 75
		} catch (CqiClientException e) {
76 76
			Log.printStackTrace(e);
77 77
			return false;
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java (revision 731)
68 68
		preferences.putInt(MIN_RIGHT, 0);
69 69
		preferences.putInt(MAX_RIGHT, 10);
70 70
		
71
		preferences.put(QUERY, ""); //$NON-NLS-1$
72
		preferences.put(PROPERTIES, "word"); //$NON-NLS-1$
71
		preferences.put(PROPERTIES, TXMPreferences.DEFAULT_UNIT_PROPERTY);
73 72
		
74 73
		
75 74
	}
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/CooccurrenceCoreMessages.java (revision 731)
28 28
	public static String info_counting;
29 29
	public static String info_buildingLexicalTable;
30 30
	public static String info_computingSpecificitiesScores;
31
	public static String info_details;
31 32
	
32 33
	static {
33 34
		// initialize resource bundle
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages.properties (revision 731)
19 19
info_buildingQueries              = Building queries.
20 20
info_computingSpecificitiesScores = Computing specificities scores.
21 21
info_counting                     = Counting.
22
info_details                      = Cooc:\n Corpus: {0}\n Query:  {1}\n Properties: {2}\n Structure: {3}\n Empans: {4} < left < {5} ; {6} < right < {7}\n Filters: freq > {8} ; count > {9} ; score > {10}\n\n
22 23
info_retreivingMatches            = Retreiving matches.
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_ru.properties (revision 731)
4 4
info_buildingQueries              = Расчет запроса
5 5
info_computingSpecificitiesScores = Расчет показателей специфичности\	
6 6
info_counting                     = Подсчет
7
info_details                      = 
7 8
info_retreivingMatches            = Расчет ответов
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/messages/messages_fr.properties (revision 731)
19 19
info_buildingQueries              = Calcul des requêtes.
20 20
info_computingSpecificitiesScores = Calcul des indices de spécificité.
21 21
info_counting                     = Comptage.
22
info_details                      = 
22 23
info_retreivingMatches            = Calcul des retours.
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 731)
38 38
import java.util.HashMap;
39 39
import java.util.HashSet;
40 40
import java.util.List;
41
import java.util.Map;
42 41
import java.util.Set;
43 42

  
43
import org.eclipse.osgi.util.NLS;
44 44
import org.rosuda.REngine.REXPMismatchException;
45 45
import org.txm.concordance.core.functions.Concordance;
46 46
import org.txm.concordance.core.functions.Line;
47
import org.txm.concordance.core.preferences.ConcordancePreferences;
48 47
import org.txm.cooccurrence.core.functions.comparators.CLineComparator;
49 48
import org.txm.cooccurrence.core.messages.CooccurrenceCoreMessages;
50 49
import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
......
61 60
import org.txm.searchengine.cqp.corpus.Property;
62 61
import org.txm.searchengine.cqp.corpus.QueryResult;
63 62
import org.txm.searchengine.cqp.corpus.StructuralUnit;
64
import org.txm.searchengine.cqp.corpus.WordProperty;
65 63
import org.txm.searchengine.cqp.corpus.query.Match;
66 64
import org.txm.searchengine.cqp.corpus.query.Query;
67 65
import org.txm.searchengine.cqp.serverException.CqiServerError;
......
210 208
	protected Integer pMinRightContextSize;
211 209
	
212 210
	/** The cooccurents properties to show. */
213
	@Parameter
211
	@Parameter(key=CooccurrencePreferences.PROPERTIES)
214 212
	protected List<Property> pProperties;
215 213
	
216 214
	/** The keyword query. */
......
254 252
	 * @param pIncludeXpivot
255 253
	 * @param buildLexicalTableWithCooccurrents
256 254
	 * @return
255
	 * @throws CqiClientException 
256
	 * @throws CqiServerError 
257
	 * @throws IOException 
258
	 * @throws StatException 
257 259
	 */
258
	protected boolean _compute() {
260
	protected boolean _compute() throws CqiClientException, IOException, CqiServerError, StatException {
259 261
		//FIXME: debug
260 262
		//System.out.println("cooc: "+corpus+" "+query+" "+properties+" "+limit+" "+maxLeft+" "+minLeft+" "+minRight+" "+maxRight+" "+minFreq+" "+minCof+" "+minScore+" "+includeXpivot);
261 263

  
262 264
		this.subTask(CooccurrenceCoreMessages.info_buildingQueries);
263
		try {
264 265
			if (lines != null) this.lines.clear();
265 266
			if (allsignaturesstr != null) this.allsignaturesstr.clear();
266 267
			if (conclines != null) this.conclines.clear();
......
309 310
			this.clearMemory();
310 311
			this.worked(10);
311 312
			
312
		} catch(Exception e) {
313
			e.printStackTrace();
314
			return false;
315
		}
316 313

  
317 314
		return true;
318 315
	}
......
490 487

  
491 488
	@Override
492 489
	public String getDetails() {
493

  
494
		StringBuffer buf = new StringBuffer(60);
495
		buf.append("Cooc: \n"); //$NON-NLS-1$
496
		buf.append(" Corpus: " + this.getParent() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
497
		buf.append(" Query: " + this.pQuery + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
498
		buf.append(" Properties: " + this.pProperties + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
499
		buf.append(" Structure: " + this.pStructuralUnitLimit + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
500
		buf.append(" Empans: " + (this.pMinLeftContextSize-1) + " < left < " + (this.pMaxLeftContextSize-1) + " ; " + (this.pMinRightContextSize-1) + " < right < " + (this.pMaxRightContextSize-1) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
501
		buf.append(" Filters: freq > " + this.pFminFilter + " ; count > " + pFCoocFilter + " ; score > " + pScoreMinFilter + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
502
		return buf.toString();
490
		Object[] params = new Object[]{this.getParent(), this.pQuery, this.pProperties, this.pStructuralUnitLimit, (this.pMinLeftContextSize - 1), (this.pMaxLeftContextSize - 1), (this.pMinRightContextSize - 1),
491
				(this.pMaxRightContextSize-1), this.pFminFilter, this.pFCoocFilter, this.pScoreMinFilter};
492
		return NLS.bind(CooccurrenceCoreMessages.info_details, params);
503 493
	}
504 494

  
505 495
	/**
......
578 568
	public int getNumberOfCooccurrents() {
579 569
		if (numberOfCooccurrents == -1) {
580 570
			numberOfCooccurrents = 0;
581
			for (CLine line : lines)
571
			for (CLine line : lines) {
582 572
				numberOfCooccurrents += line.nbocc;
573
			}
583 574
		}
584 575
		return numberOfCooccurrents;
585 576
	}
......
590 581
	 * @return the lines
591 582
	 */
592 583
	public int getNumberOfDifferentCooccurrents() {
593
		if (lines != null) return lines.size();
584
		if (lines != null) {
585
			return lines.size();
586
		}
594 587
		return 0;
595 588
	}
596 589

  
......
599 592
	 *
600 593
	 * @return the number of keyword
601 594
	 */
602
	public int getNumberOfKeyword()
603
	{
595
	public int getNumberOfKeyword() {
604 596
		return numberOfKeyword;
605 597
	}
606 598

  
......
635 627
	public String getSimpleName() {
636 628
		StringBuffer output = new StringBuffer();
637 629

  
638
		if (pQuery != null)	{
630
		if (pQuery != null && !pQuery.isEmpty())	{
639 631
			output.append(pQuery.getQueryString());
640 632
		}
633
		else	{
634
			output.append(this.getEmptyName());
635
		}
641 636

  
642 637
		if (pMaxLeftContextSize > 0 && pMaxRightContextSize > 0)	{
643
			output.append(" (" + (pMaxLeftContextSize-1) + ", " + (pMaxRightContextSize-1) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
638
			output.append(" (" + (pMaxLeftContextSize - 1) + ", " + (pMaxRightContextSize - 1) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
644 639
		}
645 640

  
646
		if (output.length() == 0) output.append(getParent().getName()); // if the result was not computed
641
		// if the result was not computed
642
		if (output.length() == 0) {
643
			output.append(this.getParent().getName());
644
		}
647 645

  
648 646
		return output.toString();
649 647
	}
......
808 806
		try {
809 807
			Corpus corpus = this.getCorpus();
810 808
			boolean includeXpivot = (Boolean) parameters.getBoolean(CooccurrencePreferences.INCLUDE_X_PIVOT);
811
			Query query = new Query(parameters.get(CooccurrencePreferences.QUERY).toString());
809
			
810
			String queryString = ""; //$NON-NLS-1$
811
			if(parameters.get(CooccurrencePreferences.QUERY) != null)	{
812
				queryString = parameters.get(CooccurrencePreferences.QUERY).toString();
813
			}
814
			Query query = new Query(queryString);
815
			
816
			StructuralUnit limit = (StructuralUnit) parameters.get(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT);
812 817

  
813
			StructuralUnit limit = corpus.getStructuralUnit(this.getStringParameterValue(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT));
814

  
815 818
			Object propsParam = parameters.get(CooccurrencePreferences.PROPERTIES);
816 819
			List<Property> properties = null;
817
			if (propsParam instanceof List)
820
			if (propsParam instanceof List) {
818 821
				properties = (List<Property>)propsParam;
822
			}
819 823
			else if (propsParam instanceof String) {
820
				properties = WordProperty.fromStringToList(corpus, propsParam.toString());
824
				properties = (List<Property>) Property.stringToProperties(corpus, propsParam.toString());
821 825
			}
822 826

  
823 827
			int maxLeft = parameters.getInteger(CooccurrencePreferences.MAX_LEFT);
......
906 910
				}
907 911
			}
908 912
		}
909
		if (Thread.interrupted()) return false; // stop if interrupted by user
910 913

  
911 914
		if (index == null) {
912 915
			try {
......
921 924
				return false;
922 925
			}
923 926
		}
924
		if (Thread.interrupted()) return false; // stop if interrupted by user
925 927

  
926 928
		// ALTER THE INDEX IF A REFERENCE CORPUS IS SET -> this change the base frequencies
927 929
		if (referenceCorpus != null && referenceCorpus.length() > 0) {
......
935 937
			}
936 938
		}
937 939

  
938
		if (Thread.interrupted()) return false; // stop if interrupted by user
939

  
940 940
		List<org.txm.index.core.functions.Line> vocLines = index.getAllLines();
941 941
		int[][] freqs;
942 942
		String[] rownames;
......
1409 1409
	
1410 1410
	@Override
1411 1411
	public boolean loadParameters() throws CqiClientException {
1412
		pProperties = WordProperty.fromStringToList(getCorpus(), this.getStringParameterValue(CooccurrencePreferences.PROPERTIES));
1412
		pProperties = (List<Property>) Property.stringToProperties(getCorpus(), this.getStringParameterValue(CooccurrencePreferences.PROPERTIES));
1413 1413
		pQuery = new Query(this.getStringParameterValue(CooccurrencePreferences.QUERY));
1414 1414
		pStructuralUnitLimit = this.getCorpus().getStructuralUnit(this.getStringParameterValue(CooccurrencePreferences.STRUCTURAL_UNIT_LIMIT));
1415 1415
		return true;
......
1417 1417

  
1418 1418
	@Override
1419 1419
	public boolean saveParameters() {
1420
		this.saveParameter(CooccurrencePreferences.PROPERTIES, WordProperty.fromListToPreferenceString(this.pProperties));
1420
		this.saveParameter(CooccurrencePreferences.PROPERTIES, Property.propertiesToString(this.pProperties));
1421 1421

  
1422 1422
		if (pQuery != null) {
1423 1423
			this.saveParameter(CooccurrencePreferences.QUERY, pQuery.getQueryString());
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 731)
167 167
		this.index = (Index) this.getResult();
168 168

  
169 169
		
170
		// Computing listener
170
		// Computing listeners
171 171
		ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this);
172 172
		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
173 173
		
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToProgression.java (revision 731)
27 27
//
28 28
package org.txm.index.rcp.handlers;
29 29

  
30
import java.util.ArrayList;
31 30
import java.util.List;
32 31

  
33 32
import org.eclipse.core.commands.ExecutionEvent;
......
35 34
import org.eclipse.jface.viewers.IStructuredSelection;
36 35
import org.eclipse.ui.handlers.HandlerUtil;
37 36
import org.txm.core.preferences.TXMPreferences;
37
import org.txm.index.core.functions.Index;
38 38
import org.txm.index.core.functions.Line;
39 39
import org.txm.rcp.editors.TXMEditor;
40 40
import org.txm.rcp.handlers.BaseAbstractHandler;
41 41
import org.txm.searchengine.cqp.corpus.Corpus;
42
import org.txm.searchengine.cqp.corpus.Property;
43 42
import org.txm.searchengine.cqp.corpus.query.Query;
44 43

  
45 44
/**
......
58 57

  
59 58
		if (selection != null && selection.getFirstElement() instanceof Line) {
60 59

  
61
			List<Query> queries = getQueries(selection);
60
			List<Query> queries = Index.createQueries(selection.toList());
62 61

  
63 62
			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
64 63
			Corpus corpus = Corpus.getFirstParentCorpus(editor.getResult());
......
79 78
	}
80 79

  
81 80

  
82
	/**
83
	 * Creates and returns the queries list from the selected table lines.
84
	 *
85
	 * @param selection the selection
86
	 * @return the queries
87
	 */
88
	public static List<Query> getQueries(IStructuredSelection selection) {
89
		List<Line> lines = selection.toList();
90
		List<Query> queries = new ArrayList<Query>();
91
		for (Line line : lines) {
92
			String query = ""; //$NON-NLS-1$
93
			int nbToken = line.getUnitsProperties().get(0).size();
94
			int nbProps = line.getProperties().size();
95
			List<List<String>> values = line.getUnitsProperties();
96
			List<Property> props = line.getProperties();
97
			for (int t = 0; t < nbToken; t++) {
98
				query += "["; //$NON-NLS-1$
99
				for (int p = 0; p < nbProps; p++) {
100
					query += props.get(p).getName() + "=\""; //$NON-NLS-1$
101
					String s = values.get(p).get(t);
102
					s = Query.addBackSlash(s);
103
					query += s;
104
					query += "\" & "; //$NON-NLS-1$
105
				}
106
				query = query.substring(0, query.length() - 3);
107
				query += "] "; //$NON-NLS-1$
108
			}
109
			queries.add(new Query(query));
110
		}
111
		return queries;
112
	}
113 81
	
114 82
	
115 83
}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/IndexToConcordance.java (revision 731)
35 35
import org.eclipse.jface.viewers.IStructuredSelection;
36 36
import org.eclipse.ui.IWorkbenchWindow;
37 37
import org.eclipse.ui.handlers.HandlerUtil;
38
import org.txm.index.core.functions.Index;
38 39
import org.txm.index.core.functions.Line;
39 40
import org.txm.index.rcp.editors.IndexEditor;
40 41
import org.txm.rcp.editors.TXMResultEditorInput;
......
157 158
	 * @return the query
158 159
	 */
159 160
	private static String getQuery(IStructuredSelection selection) {
160
		String query = ""; //$NON-NLS-1$
161

  
162
		Line line = (Line) selection.getFirstElement();
163
		int nbToken = line.getUnitsProperties().get(0).size();
164
		int nbProps = line.getProperties().size();
165
		int nbLines = selection.size();
166
		List<Line> lines = selection.toList();
167
		List<Property> props = line.getProperties();
168
		for (int t = 0; t < nbToken; t++) {
169
			query += "["; //$NON-NLS-1$
170
			for (int p = 0; p < nbProps; p++) {
171
				if (props.get(p) instanceof StructuralUnitProperty) {
172
					query += "_."+((StructuralUnitProperty)props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
173
				} else {
174
					query += props.get(p) + "=\""; //$NON-NLS-1$
175
				}
176
				for (int l = 0; l < nbLines; l++) {
177
					line = lines.get(l);
178
					List<List<String>> values = line.getUnitsProperties();
179
					String s = values.get(p).get(t);
180
					s = Query.addBackSlash(s);
181
					query += s + "|"; //$NON-NLS-1$
182
				}
183
				query = query.substring(0, query.length() - 1);
184
				query += "\" & "; //$NON-NLS-1$
185
			}
186
			query = query.substring(0, query.length() - 3);
187
			query += "] "; //$NON-NLS-1$
188
		}
189
		query = query.substring(0, query.length() - 1);
190
		return query;
161
		return Index.createQuery(selection.toList());
191 162
	}
192 163
}
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages_ru.properties (revision 731)
1 1

  
2
ProgressionDialog_0  = Параметры прогрессии 
3 2
ProgressionDialog_1  = Тип графа: 
4
ProgressionDialog_10 = Прогрессия: некорректное регулярное выражение: 
5 3
ProgressionDialog_11 = Масштаб полос
6
ProgressionDialog_13 = Опции вида
7 4
ProgressionDialog_14 = Различные стили строк
8 5
ProgressionDialog_15 = Повторять идентичные значения
9 6
ProgressionDialog_17 = Ошибка: мультипликатор полосы: 
......
13 10
ProgressionDialog_9  = добавить query
14 11

  
15 12
ProgressionPreferencePage_3 = Кумулятивный граф прогрессии
16
ProgressionPreferencePage_5 = Линии в одном стиле
17 13
ProgressionPreferencePage_6 = Повторять значения с свойств структур
18 14
ProgressionPreferencePage_7 = Масштаб границ структур
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages_fr.properties (revision 731)
1 1

  
2
ProgressionDialog_0  = Paramètres de la progression 
3 2
ProgressionDialog_1  = Type de graphe : 
4
ProgressionDialog_10 = Progression : mauvaise expression régulière : 
5 3
ProgressionDialog_11 = Échelle des bandeaux
6
ProgressionDialog_13 = Options d'affichage
7 4
ProgressionDialog_14 = Styles de ligne multiples
8 5
ProgressionDialog_15 = Répéter les valeurs identiques
9 6
ProgressionDialog_17 = Erreur : multiplicateur de bande : 
......
13 10
ProgressionDialog_9  = ajouter une requête
14 11

  
15 12
ProgressionPreferencePage_3 = Graphe de progression cumulatif
16
ProgressionPreferencePage_5 = Style de ligne unique
17 13
ProgressionPreferencePage_6 = Répéter les valeurs de propriétés de structures
18 14
ProgressionPreferencePage_7 = Échelle des limites de structures
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/ProgressionUIMessages.java (revision 731)
3 3
import org.eclipse.osgi.util.NLS;
4 4
import org.txm.utils.messages.Utf8NLS;
5 5

  
6
/**
7
 * Progression UI messages.
8
 * 
9
 * @author mdecorde
10
 * @author sjacquot
11
 *
12
 */
6 13
public class ProgressionUIMessages extends NLS {
7 14

  
8 15
	private static final String BUNDLE_NAME = "org.txm.progression.rcp.messages.messages"; //$NON-NLS-1$
9 16

  
10 17
	public static String ProgressionPreferencePage_3;
11
	public static String ProgressionPreferencePage_5;
12 18
	public static String ProgressionPreferencePage_6;
13 19
	public static String ProgressionPreferencePage_7;
14 20

  
15
	public static String ProgressionDialog_0;
16 21
	public static String ProgressionDialog_1;
17
	public static String ProgressionDialog_10;
18 22
	public static String ProgressionDialog_11;
19
	public static String ProgressionDialog_13;
20 23
	public static String ProgressionDialog_14;
21 24
	public static String ProgressionDialog_15;
22 25
	public static String ProgressionDialog_17;
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages.properties (revision 731)
1 1

  
2
ProgressionDialog_0  = Progression Parameters
3 2
ProgressionDialog_1  = Graph type:
4
ProgressionDialog_10 = Progression dialog: wrong regular expression:
5 3
ProgressionDialog_11 = Bandewidth multiplier:
6
ProgressionDialog_13 = Display options
7 4
ProgressionDialog_14 = Multiple line styles
8 5
ProgressionDialog_15 = Repeat same values
9 6
ProgressionDialog_17 = Strip multiplier error:
......
13 10
ProgressionDialog_9  = add a query
14 11

  
15 12
ProgressionPreferencePage_3 = Default graph type is cumulative
16
ProgressionPreferencePage_5 = Single line style
17 13
ProgressionPreferencePage_6 = Repeat the values of the structure properties
18 14
ProgressionPreferencePage_7 = Bande size multiplier
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 731)
215 215
				@Override
216 216
				public void widgetSelected(SelectionEvent e) {
217 217
					bandeField.setEnabled(densityButton.getSelection());
218
					getResult().setChartType("density");					
218
					getResult().setChartType(Progression.DENSITY_CHART_TYPE);					
219 219
				}
220 220
				
221 221
				@Override
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/handlers/ComputeProgression.java (revision 731)
29 29

  
30 30
import org.eclipse.core.commands.ExecutionEvent;
31 31
import org.eclipse.core.commands.ExecutionException;
32
import org.txm.chartsengine.core.ChartsEngine;
33
import org.txm.chartsengine.r.core.RChartsEngine;
34
import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
32
import org.eclipse.core.runtime.preferences.InstanceScope;
35 33
import org.txm.chartsengine.rcp.editors.ChartEditor;
36
import org.txm.chartsengine.svgbatik.rcp.SVGSWTChartsComponentsProvider;
37 34
import org.txm.core.preferences.TXMPreferences;
38
import org.txm.core.results.TXMResult;
39 35
import org.txm.progression.core.functions.Progression;
40 36
import org.txm.progression.core.messages.ProgressionCoreMessages;
41
import org.txm.progression.core.preferences.ProgressionPreferences;
42 37
import org.txm.rcp.handlers.BaseAbstractHandler;
43 38
import org.txm.rcp.views.corpora.CorporaView;
44 39
import org.txm.searchengine.cqp.corpus.Corpus;
......
46 41

  
47 42

  
48 43
/**
49
 * Open the ProgressionDialog, computes and opens the result editor part.
44
 * Computes a Progression and opens the result editor.
50 45
 * 
51 46
 * @author mdecorde
52 47
 * @author sjacquot
......
61 56
	
62 57
	
63 58
	
64
	/* (non-Javadoc)
65
	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
66
	 */
67 59
	@Override
68 60
	public Object execute(ExecutionEvent event) throws ExecutionException {
69 61

  
62
		
70 63
		if(!this.checkStatsEngine() || !this.checkCorpusEngine()) {
71 64
			return false;
72 65
		}
73 66

  
74 67
		Object selection = this.getSelection(event);
68

  
69
		
75 70
		Progression progression = null;
76 71
		
77 72

  
......
89 84
				return null;
90 85
			}
91 86
			progression = new Progression(corpus);
87
		
88
			// FIXME: persistence tests from a file named "201805123_433f0b69-1083-4ed6-be1c-bcd48c73aeae"
89
//			progression = new Progression("201805123_433f0b69-1083-4ed6-be1c-bcd48c73aeae", corpus);
90

  
91
			
92 92
		}
93 93
		// Reopening an existing result
94 94
		else if (selection instanceof Progression)	{
95 95
			progression = (Progression) selection;
96 96
		}
97
		// Error
98
		else {
99
			this.logCanNotCompute(selection);
100
		}
97 101

  
98
		
99
		// FIXME: temporary force R/SVG version because the Progression density chart is not yet implemented in JFC mode
100
//		if(!progression.getBooleanParameterValue(ProgressionPreferences.CHART_CUMULATIVE))	{
101
//			SVGSWTChartsComponentsProvider tmpSWTComponentsProvider = (SVGSWTChartsComponentsProvider) SWTChartsComponentsProvider.getComponentsProvider(SVGSWTChartsComponentsProvider.class);
102
//			RChartsEngine tmpChartsEngine = (RChartsEngine) ChartsEngine.getChartsEngine(RChartsEngine.class);									
103
//			tmpSWTComponentsProvider.setChartsEngine(tmpChartsEngine);
104
//			
105
//			// Create and open the chart editor
106
//			//ChartEditor.compute(progression, tmpSWTComponentsProvider);
107
//			
108
//		}
109
//		else	{
110
//			// Create and open the chart editor
111
//			//ChartEditor.compute(progression);
112
//		}
113

  
114 102
		ChartEditor.openEditor(progression);
115 103
		
116 104
		return null;
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/preferences/ChartsEnginePreferences.java (revision 731)
77 77
	
78 78
	// local result preferences
79 79
	public final static String CHART_TYPE = PREFERENCES_PREFIX +  "chart_type"; //$NON-NLS-1$
80
	public final static String RESULT_DATA_TYPE = PREFERENCES_PREFIX +  "result_data_type"; //$NON-NLS-1$
81 80
	
82 81
	
83 82
	
......
96 95
		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
97 96
		
98 97
		preferences.put(CURRENT_NAME, "jfreechart_charts_engine"); //$NON-NLS-1$
99
		preferences.put(DEFAULT_EXPORT_FORMAT, "svg");
98
		preferences.put(DEFAULT_EXPORT_FORMAT, "svg"); //$NON-NLS-1$
100 99

  
101 100
		
102 101
		initializeChartsEngineSharedPreferences(preferences);
......
104 103
	
105 104
	/**
106 105
	 * Initializes the charts engine default preferences.
107
	 * This method is also used to define the charts preference for each command.
106
	 * This method is also used to define the charts preference for each command using charts.
108 107
	 * @param preferences
109 108
	 */
110 109
	public static void initializeChartsEngineSharedPreferences(Preferences preferences)	{
110
		preferences.put(CHART_TYPE, DEFAULT_CHART_TYPE);
111 111
		preferences.putBoolean(SHOW_TITLE, true);
112 112
		preferences.putBoolean(SHOW_LEGEND, true);
113 113
		preferences.putBoolean(SHOW_GRID, true);
114 114
		preferences.putInt(RENDERING_COLORS_MODE, ChartsEngine.RENDERING_COLORS_MODE);
115 115
		preferences.put(MONOCHROME_COLOR, "0,220,20"); //$NON-NLS-1$
116 116
		preferences.putBoolean(MULTIPLE_LINE_STROKES, false);
117

  
118 117
		
119
		
120
		preferences.put(CHART_TYPE, DEFAULT_CHART_TYPE);
121
		
122
		// FIXME: maybe need need to check here the target OS and set a default Unicode installed font
118
		// FIXME: maybe need to check here the target OS and set a default Unicode installed font
123 119
		preferences.put(FONT, DEFAULT_FONT);
124 120
		
125 121
	}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java (revision 731)
676 676
		return charset;
677 677
	}
678 678

  
679
	/* (non-Javadoc)
680
	 * @see org.txm.objects.TxmObject#getChildren()
681
	 */
682
	public List<? extends TxmObject> getChildren() {
683
		List<? extends TxmObject> ret = subcorpora;
684
		return ret;
685
	}
686 679

  
687 680
	/* (non-Javadoc)
688 681
	 * @see org.txm.searchengine.cqp.corpus.CqpObject#getCqpId()
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/StructuralUnitProperty.java (revision 731)
33 33
import java.util.UUID;
34 34

  
35 35
import org.txm.core.messages.TXMCoreMessages;
36
import org.txm.core.preferences.TXMPreferences;
36 37
import org.txm.searchengine.cqp.AbstractCqiClient;
37 38
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
38 39
import org.txm.searchengine.cqp.corpus.query.Query;
......
52 53
	/** The structural unit. */
53 54
	private StructuralUnit structuralUnit;
54 55

  
55
	public static List<StructuralUnitProperty> stringToStructuralUnitProperties(Corpus corpus, String v) {
56
		ArrayList<StructuralUnitProperty> structs = new ArrayList<StructuralUnitProperty>();
57
		if (v == null) return structs;
58
		if (v.length() == 0) return structs;
59 56

  
60
		String[] split = v.split("\t");
61
		for (String s : split) {
62
			String[] split2 = s.split("_", 2);
63
			if (split2.length != 2) continue;
64
			try {
65
				StructuralUnit struc = corpus.getStructuralUnit(split2[0]);
66
				StructuralUnitProperty struc_p = struc.getProperty(split2[1]);
67
				if (struc_p != null) {
68
					structs.add(struc_p);
69
				}
70
			} catch (CqiClientException e) {
71
				System.out.println("Error: "+v+" structure property not found in "+corpus);
72
				Log.printStackTrace(e);
73
				return null;
74
			}
75

  
76
		}
77
		return structs;
78
	}
79

  
80 57
	
81 58
	/**
82
	 * 
83
	 * @param corpus
84
	 * @param s the String to 'deserialize'. Each property is separated with 1 tabulation. Then calls fromString on each token
85
	 * @return a list of StructuralUnitProperty if the s param is well formed
86
	 * @throws CqiClientException 
87
	 */
88
	public static List<StructuralUnitProperty> fromStringToList(Corpus corpus, String s) {
89
		ArrayList<StructuralUnitProperty> properties = new ArrayList<StructuralUnitProperty>();
90
		if (s == null) return properties;
91

  
92
		String[] split = s.split("\t");
93
		for (String s2 : split) {
94
			try {
95
				StructuralUnitProperty sup = fromString(corpus, s2);
96
				if (sup != null) {
97
					properties.add(sup);
98
				}
99
			} catch (Exception e) {
100
				e.printStackTrace();
101
			}
102
		}
103
		return properties;
104
	}
105
	
106
	
107
	/**
108 59
	 * Instantiates a new structural unit property.
109 60
	 * 
110 61
	 * Not intended to be used directly. See
......
242 193
	 */
243 194
	public Integer getNumberOfValues(Corpus corpus) {
244 195
		try {
245
			QueryResult tmp = corpus.query(
246
					new Query("<" + this.getFullName() + ">[]"), UUID.randomUUID().toString(), false); //$NON-NLS-1$ //$NON-NLS-2$
196
			QueryResult tmp = corpus.query(new Query("<" + this.getFullName() + ">[]"), UUID.randomUUID().toString(), false); //$NON-NLS-1$ //$NON-NLS-2$
247 197
			int ret = tmp.getNMatch();
248 198
			tmp.drop();
249 199
			return ret;
......
254 204
	}
255 205

  
256 206
	/**
257
	 * 
207
	 * Converts the specified string to a list of StructuralUnitProperty from the specified Corpus.
258 208
	 * @param corpus
259
	 * @param s the String to 'deserialize'. Follows the structure_property syntax
209
	 * @param str
260 210
	 * @return
211
	 */
212
	public static List<StructuralUnitProperty> stringToProperties(Corpus corpus, String str) {
213
		ArrayList<StructuralUnitProperty> structs = new ArrayList<StructuralUnitProperty>();
214
		if (str == null || str.length() == 0) {
215
			return structs;
216
		}
217

  
218
		String[] split = str.split(TXMPreferences.LIST_SEPARATOR);
219
		for (String s : split) {
220
			String[] split2 = s.split("_", 2);
221
			if (split2.length != 2) {
222
				continue;
223
			}
224
			try {
225
				StructuralUnit struc = corpus.getStructuralUnit(split2[0]);
226
				StructuralUnitProperty struc_p = struc.getProperty(split2[1]);
227
				if (struc_p != null) {
228
					structs.add(struc_p);
229
				}
230
			} catch (CqiClientException e) {
231
				System.out.println("Error: " + str + " structure property not found in " + corpus);
232
				Log.printStackTrace(e);
233
				return null;
234
			}
235

  
236
		}
237
		return structs;
238
	}
239

  
240
	
241
	/**
242
	 * Converts the specified string to a StructuralUnitProperty.
243
	 * @param corpus
244
	 * @param str the String to 'deserialize'. Follows the structure_property syntax
245
	 * @return
261 246
	 * @throws CqiClientException
262 247
	 */
263
	public static StructuralUnitProperty fromString(Corpus corpus, String s) throws CqiClientException {
264
		if (s == null) return null;
248
	public static StructuralUnitProperty stringToStructuralUnitProperty(Corpus corpus, String str) throws CqiClientException {
249
		if (str == null) {
250
			return null;
251
		}
265 252

  
266
		String[] split = s.split("_", 2);
253
		String[] split = str.split("_", 2);
267 254
		if (split.length == 2) {
268 255
			StructuralUnit su = corpus.getStructuralUnit(split[0]);
269 256
			if (su == null) {
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 731)
159 159
		return this.size;
160 160
	}
161 161
	
162
	@Override
163
	public List<? extends TxmObject> getChildren() {
164
		List<? extends TxmObject> ret = super.getChildren();
165
		for (int i = 0 ; i < ret.size() ; i++) {
166
			Object element = ret.get(i);
167
			
168
			if (element instanceof Text || element instanceof SavedQuery) {
169
				ret.remove(i);
170
				i--;
171
			}
172
		}
173
		return ret;
174
	}
175 162

  
176 163
	/**
177 164
	 * Gets the properties available in this corpus.
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java (revision 731)
4 4
import java.util.List;
5 5

  
6 6
import org.apache.commons.lang.StringUtils;
7
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
7
import org.txm.core.preferences.TXMPreferences;
8 8

  
9 9
/**
10 10
 * A CQP property at token/word level
......
14 14
 */
15 15
public class WordProperty extends Property {
16 16

  
17
	/**
18
	 * Creates a new WordProperty.
19
	 * @param name
20
	 * @param corpus
21
	 */
17 22
	protected WordProperty(String name, Corpus corpus) {
18 23
		super(name, corpus);
19 24
	}
......
23 28
		return getName();
24 29
	}
25 30

  
26
	/**
27
	 * 
28
	 * @param corpus
29
	 * @param s the String to 'deserialize'. Each property is separated with 1 tabulation. Then calls fromString on each token
30
	 * @return a list of StructuralUnitProperty if the s param is well formed
31
	 * @throws CqiClientException 
32
	 */
33
	public static List<Property> fromStringToList(Corpus corpus, String s) {
34
		ArrayList<Property> properties = new ArrayList<Property>();
35
		if (s == null) return properties;
36 31

  
37
		String[] split = s.split("\t");
38
		for (String s2 : split) {
39
			try {
40
				WordProperty p = corpus.getProperty(s2);
41
				if (p != null) {
42
					properties.add(p);
43
				}
44
			} catch (CqiClientException e) {
45
				// TODO Auto-generated catch block
46
				e.printStackTrace();
47
			}
48
		}
49
		return properties;
50
	}
51

  
52
	/**
53
	 * create a preference String value from a list of Word properties
54
	 * 
55
	 * @param pProperties the list of properties. May be null (return [])
56
	 * @return
57
	 */
58
	public static String fromListToPreferenceString(List<Property> pProperties) {
59
		if (pProperties == null){
60
			return "";
61
		}
62

  
63
		ArrayList<String> names = new ArrayList<String>();
64

  
65
		for (Property p : pProperties) {
66
			names.add(p.getName());
67
		}
68
		
69
		return StringUtils.join(names, "\t");
70
	}
32
	
71 33
}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java (revision 731)
27 27
//
28 28
package org.txm.searchengine.cqp.corpus;
29 29

  
30
import java.util.ArrayList;
31
import java.util.List;
30 32

  
33
import org.apache.commons.lang.StringUtils;
34
import org.txm.core.preferences.TXMPreferences;
35
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
36

  
37

  
31 38
/**
32 39
 * An abstract CQP corpus property. Represents a <strong>type</strong>, not a the value for a specific unit.
33 40
 * 
......
116 123
	public int compareTo(Property p) {
117 124
		return (this.getQualifiedName().compareTo((p).getQualifiedName()));
118 125
	}
126
	
127
	
128
	/**
129
	 * Converts the specified string to a list of Property from the specified Corpus.
130
	 * @param corpus
131
	 * @param str the String to 'deserialize'. Each property is separated with 1 tabulation. Then calls fromString on each token
132
	 * @return a list of StructuralUnitProperty if the s param is well formed
133
	 * @throws CqiClientException 
134
	 */
135
	public static List<? extends Property> stringToProperties(Corpus corpus, String str) {
136
		ArrayList<Property> properties = new ArrayList<Property>();
137
		
138
		if (str == null) {
139
			return properties;
140
		}
141

  
142
		String[] split = str.split(TXMPreferences.LIST_SEPARATOR);
143
		for (String s : split) {
144
			try {
145
				Property p = corpus.getProperty(s);
146
				if (p != null) {
147
					properties.add(p);
148
				}
149
			} catch (CqiClientException e) {
150
				// TODO Auto-generated catch block
151
				e.printStackTrace();
152
			}
153
		}
154
		return properties;
155
	}
156

  
157

  
158
	/**
159
	 * Converts the specified list of Property to a string.
160
	 * 
161
	 * @param pProperties the list of properties. May be null (return "")
162
	 * @return
163
	 */
164
	public static String propertiesToString(List<? extends Property> pProperties) {
165
		if (pProperties == null){
166
			return ""; //$NON-NLS-1$
167
		}
168

  
169
		ArrayList<String> names = new ArrayList<String>();
170

  
171
		for (Property p : pProperties) {
172
			names.add(p.getName());
173
		}
174
		
175
		return StringUtils.join(names, TXMPreferences.LIST_SEPARATOR);
176
	}
177
	
119 178
}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Query.java (revision 731)
32 32
import java.util.regex.Matcher;
33 33
import java.util.regex.Pattern;
34 34

  
35
import org.txm.core.preferences.TXMPreferences;
36

  
35 37
/**
36 38
 * Implements a CQL query. Use fixQuery to use query sugar.
37 39
 * 
......
89 91
		else {
90 92
			this.queryString = "";
91 93
		}
92
		
93 94
	}
94 95

  
95 96
	/**
......
103 104
		if (str == null || str.length() == 0) {
104 105
			return queries;
105 106
		}
106
		String[] split = str.split("\t");
107
		String[] split = str.split(TXMPreferences.LIST_SEPARATOR);
107 108
		for (String s : split) {
108 109
			queries.add(new Query(s));
109 110
		}
......
113 114
	
114 115
	/**
115 116
	 * Converts the specified list of Query to a string.
116
	 * Queries are separated by a tabulation.
117
	 * Queries strings are separated by a tabulation.
117 118
	 * @param queries
118 119
	 * @return
119 120
	 */
......
121 122
		String str = "";
122 123
		for (int i = 0; i < queries.size(); i++) {
123 124
			if(i > 0)	{
124
				str += "\t";
125
				str += TXMPreferences.LIST_SEPARATOR;
125 126
			}
126 127
			str += queries.get(i).getQueryString();			
127 128
		}
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java (revision 731)
161 161
				continue;
162 162
			
163 163
			//System.out.println("check "+container.getName());
164
			if (container.getResults().size() > 0
164
			if (container.getChildren().size() > 0
165 165
					//FIXME: commented by SJ for TXMResult implementation
166 166
					//|| container.getSubHasResults().size() > 0
167 167
					)
......
185 185
	 */
186 186
	protected boolean deepSearch(TXMResult container)
187 187
	{
188
		boolean own = hasSymbol(container.getResults());
188
		boolean own = hasSymbol(container.getChildren());
189 189
		if (own)
190 190
		{
191 191
			return true;
......
193 193
		else // continue deeper
194 194
		{
195 195
			
196
			for(TXMResult children : container.getResults())
196
			for(TXMResult children : container.getChildren())
197 197
			{
198 198
				boolean childrencontainer = deepSearch(children);
199 199
				if (childrencontainer)
tmp/org.txm.rcp/OSGI-INF/l10n/bundle.properties (revision 731)
40 40

  
41 41
command.label.101 = Chart...
42 42

  
43
command.label.102 = Send to concordances
44

  
45 43
command.label.103 = Send to progression
46 44

  
47 45
command.label.105 = Merge lines
tmp/org.txm.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 731)
24 24

  
25 25
command.label.101 = Экспорт SVG
26 26

  
27
command.label.102 = Отправить в конкорданс
28

  
29 27
command.label.103 = Отправить на прогрессию
30 28

  
31 29
command.label.105 = Объединить строки
tmp/org.txm.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 731)
40 40

  
41 41
command.label.101 = Graphique...
42 42

  
43
command.label.102 = Envoyer vers concordances
44

  
45 43
command.label.103 = Envoyer vers progression
46 44

  
47 45
command.label.104 = Supprimer la ligne
tmp/org.txm.rcp/OSGI-INF/l10n/bundle_ru_utf-8.properties (revision 731)
55 55
command.tooltip.32=Показать издание корпуса
56 56
command.label.103=Отправить на прогрессию
57 57
command.tooltip.30=Импортирует корпус из папки, содержащей исходный материал в формате Alceste
58
command.label.102=Отправить в конкорданс
59 58
command.label.101=Экспорт SVG
60 59
command.tooltip.29=Импортирует корпус из папки, содержащей исходный материал в формате Hyperbase
61 60
command.tooltip.28=Импортирует корпус из папки, содержащей файл csv и файлы cnr
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java (revision 731)
226 226
					}
227 227
				} else if (o instanceof Partition) {
228 228
					Partition p = (Partition)o;
229
					for (int i = 0 ; i < p.getResults().size() ; i++) {
230
						deleted.addAll(delete(p.getResults().get(i)));
229
					for (int i = 0 ; i < p.getChildren().size() ; i++) {
230
						deleted.addAll(delete(p.getChildren().get(i)));
231 231
						i--;
232 232
					}
233 233
					if (!((TxmObject) o).delete()) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java (revision 731)
104 104
		}
105 105

  
106 106
		if (element instanceof TXMResult) {
107
			return ((TXMResult)element).getResults().toArray();
107
			return ((TXMResult)element).getChildren().toArray();
108 108
		}
109 109
		return new Object[0];
110 110
	}
......
136 136
			//System.out.println("corpora view content: "+elements);
137 137
			return elements.toArray();
138 138
		} else if (element instanceof TXMResult) {
139
			return ((TXMResult)element).getResults().toArray();
139
			return ((TXMResult)element).getChildren().toArray();
140 140
		}
141 141
		return new Object[0];
142 142
	}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/debug/TXMResultDebugView.java (revision 731)
124 124
		buffer.append("Selected object = " + this.currentResult + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
125 125
		buffer.append("Node visible = " + this.currentResult.isVisible() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
126 126
		if (this.currentResult instanceof ChartResult) 	{
127
			buffer.append("Chart object = " + ((ChartResult)this.currentResult).getChart() + ", chart type = " + ((ChartResult)this.currentResult).getChartType() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
127
			buffer.append("Chart engine = " + ((ChartResult)this.currentResult).getChartsEngine() + ", chart object = " + ((ChartResult)this.currentResult).getChart() + ", chart type = " + ((ChartResult)this.currentResult).getChartType() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
128 128
		}
129 129
		buffer.append("Selection full path name = " + this.currentResult.getFullPathSimpleName() + " - " + this.currentResult.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
130
		buffer.append("Direct children count = " + this.currentResult.getResults().size() + ", direct visible children count = " + this.currentResult.getChildren(true).size() + ", children count = " + this.currentResult.getDeepChildren().size() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
130
		buffer.append("Direct children count = " + this.currentResult.getChildren().size() + ", direct visible children count = " + this.currentResult.getChildren(true).size() + ", children count = " + this.currentResult.getDeepChildren().size() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
131 131
		buffer.append("Root parent = " + this.currentResult.getRootParent() + ", main corpus parent = " + Corpus.getParentMainCorpus(this.currentResult) + ", first parent corpus = " + Corpus.getFirstParentCorpus(this.currentResult)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
132 132
		
133 133
		displayArea.setText(buffer.toString());
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/RCPPreferences.java (revision 731)
54 54
	/** The Constant RIGHT_CONTEXT_SIZE_DEFAULT. */
55 55
	public static final int RIGHT_CONTEXT_SIZE_DEFAULT = 15;
56 56

  
57
	
57 58
	@Override
58 59
	public void initializeDefaultPreferences() {
59 60
		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/AdvancePreferencePage.java (revision 731)
111 111
		addField(new BooleanFieldEditor(TBXPreferences.EXPERT_USER, TXMUIMessages.AdvancePreferencePage_4, getFieldEditorParent()));
112 112
		
113 113
		// Show all result nodes in Corpora view
114

  
115
		// Expert mode
116 114
		addField(new BooleanFieldEditor(TBXPreferences.SHOW_ALL_RESULT_NODES, "Show all result nodes in Corpora view", getFieldEditorParent()));
117 115

  
116
		// Auto save each result after computing
117
		addField(new BooleanFieldEditor(TBXPreferences.AUTO_SAVE_RESULTS, "Auto save results", getFieldEditorParent()));
118

  
118 119
	}
119 120

  
120 121
	/* (non-Javadoc)
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 731)
500 500
						this.syncExec(new Runnable() {
501 501
							@Override
502 502
							public void run() {
503
								
504
								// FIXME: file persistence flush tests
505
								//TXMPreferences.flush(currentEditor.getResult());
506
								
507 503
								currentEditor.refresh(update);
508 504
							}
509 505
						});
......
518 514
					return Status.CANCEL_STATUS;
519 515
				}
520 516
				catch (Exception e) {
521
					System.out.println(e.getLocalizedMessage());
522 517
					Log.printStackTrace(e);
523 518
				}
524 519
				finally {
......
621 616
			//MD commented 'if (!update) {...}'
622 617
			// SJ need to check all works, it also was dedicated to not refresh the Editor from result after a computing, it's not needed since the computing has been done
623 618
			// from fields themselves
624
			//if (!update) {
619
			if (!update) {
625 620
				// FIXME: debug
626 621
				System.err.println("TXMEditor.refresh(): auto updating editor from result.");
627 622
				this.autoUpdateEditorFieldsFromResult(update); // auto update from Parameter annotations
628 623
	
629 624
				// FIXME: debug
630
				System.err.println("TXMEditor.refresh():  updating subclass editor from result.");
625
				System.err.println("TXMEditor.refresh(): updating subclass editor (" + getClass().getSimpleName() + ") from result.");
631 626
				this.updateEditorFromResult(update); // subclasses manual settings
632
			//}
627
			}
633 628
				
634 629
				// FIXME: became useless?
635 630
			//this.__updateEditorFromResult(update); // essentially for ChartEditor
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedQueryWidget.java (revision 731)
133 133
	 * @param query the new text
134 134
	 */
135 135
	public void setText(String query) {
136
		
137
//		if(query.isEmpty())	{
138
//			query = ""; //$NON-NLS-1$
139
//		}
140
		
136 141
		querywidget.setText(query);
137 142
	}
138 143

  
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryWidget.java (revision 731)
66 66
	 */
67 67
	public String getQueryString() {
68 68
		String rawQuery;
69
		if (getSelectionIndex() < 0)
69
		if (getSelectionIndex() < 0) {
70 70
			rawQuery = getText();
71
		else
71
		}
72
		else {
72 73
			rawQuery = this.getItem(this.getSelectionIndex());
74
		}
73 75
		return Query.fixQuery(rawQuery);
74 76
	}
75 77

  
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 731)
854 854
				// the folders to copy from TXM install dir
855 855
				String copyfolders[] = {"css", "scripts", "xsl", "samples", "scripts", "schema"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
856 856
				for (String folder : copyfolders) {
857
					File ffile = new File(TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR), folder);
857
					File ffile = new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE), folder);
858 858
					if (!ffile.exists()) {
859 859
						System.out.println(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_39, ffile));
860 860
						continue;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff