Révision 3388

TXM/trunk/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationArea.java (revision 3388)
109 109
	
110 110
	/**
111 111
	 * 
112
	 * @return true if the corpus indexes & editions needs to be updated **after saving annotation**
112
	 * @return true if the corpus indexes needs to be updated **after saving annotation**
113 113
	 */
114 114
	public abstract boolean needToUpdateIndexes();
115 115
	
116
	/**
117
	 * 
118
	 * @return true if the corpus editions needs to be updated **after saving updating indexes**
119
	 */
120
	public abstract boolean needToUpdateEditions();
121
	
116 122
	public abstract boolean hasChanges();
117 123
}
TXM/trunk/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java (revision 3388)
20 20
import org.eclipse.swt.widgets.ToolItem;
21 21
import org.txm.annotation.rcp.messages.AnnotationUIMessages;
22 22
import org.txm.concordance.core.functions.Concordance;
23
import org.txm.core.preferences.TBXPreferences;
23 24
import org.txm.core.results.TXMResult;
24 25
import org.txm.objects.Text;
25 26
import org.txm.rcp.IImageKeys;
......
297 298
					
298 299
					Log.info("Saving annotations...");
299 300
					boolean needToUpdateIndexes = false;
301
					boolean needToUpdateEditions = false;
300 302
					// System.out.println("Saving annotations...");
301 303
					if (annotationAreas != null && annotationAreas.size() > 0) {
302 304
						for (AnnotationArea aa : annotationAreas) {
......
304 306
									|| (aa.isDirty() 
305 307
											&& aa.save()
306 308
											&& aa.needToUpdateIndexes());
309
							needToUpdateEditions = needToUpdateEditions || aa.needToUpdateEditions();
307 310
						}
308 311
					}
309 312
					
310 313
					if (needToUpdateIndexes) {
311 314
						final MainCorpus corpus = editor.getResult().getFirstParent(MainCorpus.class);
312 315
						monitor.setTaskName("Updating corpus indexes and editions");
313
						if (corpus != null && UpdateCorpus.update(corpus) != null) {
316
						if (corpus != null && UpdateCorpus.update(corpus, needToUpdateEditions) != null) {
314 317
							monitor.worked(50);
315 318
							this.syncExec(new Runnable() {
316 319
								
TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/preferences/KRAnnotationPreferences.java (revision 3388)
7 7
 * Preferences initializer and manager.
8 8
 * 
9 9
 * @author mdecorde
10
 * @author sjacquot
11 10
 *
12 11
 */
13 12
public class KRAnnotationPreferences extends TXMPreferences {
14 13
	
15 14
	public static final String UPDATE_EDITION = "udpate_edition";
16 15
	
16
	public static final String UPDATE_INDEXES = "udpate_indexes";
17
	
17 18
	public static final String PRESERVE_ANNOTATIONS = "reset_temporary_annotations_when leaving_txm";
18 19
	
19 20
	/**
......
22 23
	 * @return the instance
23 24
	 */
24 25
	public static TXMPreferences getInstance() {
26
		
25 27
		if (!TXMPreferences.instances.containsKey(KRAnnotationPreferences.class)) {
26 28
			new KRAnnotationPreferences();
27 29
		}
......
30 32
	
31 33
	@Override
32 34
	public void initializeDefaultPreferences() {
35
		
33 36
		super.initializeDefaultPreferences();
34 37
		Preferences preferences = this.getDefaultPreferencesNode();
35 38
		preferences.putBoolean(UPDATE_EDITION, true);
39
		preferences.putBoolean(UPDATE_INDEXES, true);
36 40
		preferences.putBoolean(PRESERVE_ANNOTATIONS, true);
37 41
	}
38 42
}
TXM/trunk/org.txm.whatsnew.rcp/src/org/txm/whatsnew/rcp/NewsPreferencesPage.java (revision 3388)
3 3
import org.eclipse.jface.preference.BooleanFieldEditor;
4 4
import org.eclipse.ui.IWorkbench;
5 5
import org.txm.rcp.IImageKeys;
6
import org.txm.rcp.preferences.RCPPreferences;
6 7
import org.txm.rcp.preferences.TXMPreferencePage;
7 8
import org.txm.rcp.preferences.TXMPreferenceStore;
8 9

  
......
13 14
	public void init(IWorkbench workbench) {
14 15
		
15 16
		this.setPreferenceStore(new TXMPreferenceStore(NewsPreferences.getInstance().getPreferencesNodeQualifier()));
16
		this.setTitle("New setups");
17
		this.setTitle("New version");
17 18
		this.setImageDescriptor(IImageKeys.getImageDescriptor("platform:/plugin/org.eclipse.ui.editors/icons/full/obj16/quick_assist_obj.gif"));
18 19
	}
19 20
	
......
22 23
		
23 24
		//this.addField(new BooleanFieldEditor(NewsPreferences.SHOW_NEWS, "Show news when TXM starts up", this.getFieldEditorParent()));
24 25
		
25
		this.addField(new BooleanFieldEditor(NewsPreferences.SHOW_NEW_SETUP, "Show new setup popups when TXM starts up", this.getFieldEditorParent()));
26
		this.addField(new BooleanFieldEditor(NewsPreferences.SHOW_NEW_SETUP, "Announce the availability of new versions of TXM/Annoncer la disponibilité de nouvelles versions de TXM", this.getFieldEditorParent()));
26 27
		
27 28
		// enable if dev needs to update the NEWS_VERSION value
28
		//this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEWS_VERSION, "Current news index", this.getFieldEditorParent()));
29
		//this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEW_SETUP_VERSION, "Current new setup index", this.getFieldEditorParent()));
29
		if (RCPPreferences.getInstance().getBoolean(RCPPreferences.EXPERT_USER)) {
30
			this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEWS_VERSION, "Current news index", this.getFieldEditorParent()));
31
			this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEW_SETUP_VERSION, "Current new setup index", this.getFieldEditorParent()));
32
		}
30 33
	}
31 34
}
TXM/trunk/org.txm.referencer.rcp/plugin.xml (revision 3388)
88 88
       <definition
89 89
                  id="OneReferencerSelected">
90 90
               <with
91
                     variable="selection">
91
                     variable="corporaSelection">
92 92
                  <iterate
93 93
                        ifEmpty="false"
94 94
                        operator="and">
TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java (revision 3388)
600 600
				Log.severe(TXMCoreMessages.error_errorWhileSortingResult);
601 601
				org.txm.utils.logger.Log.printStackTrace(e);
602 602
			}
603
			TXMEditor.packColumns(this.viewer);
603
			TXMEditor.refreshColumns(this.viewer);
604
			//TXMEditor.packColumns(this.viewer);
604 605
		}
605 606
	}
606 607
	
TXM/trunk/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/EmpantWidget.java (revision 3388)
126 126
			
127 127
			@Override
128 128
			public void widgetSelected(SelectionEvent e) {
129
				
129 130
				structs.setEnabled(false);
130 131
				checkLeft.setSelection(true);
131 132
				checkRight.setSelection(true);
133
				maxLeft.setEnabled(true);
134
				minLeft.setEnabled(true);
135
				minRight.setEnabled(true);
136
				maxRight.setEnabled(true);
137
				
132 138
				checkXword.setEnabled(false);
139
				checkXword.setSelection(false);
133 140
				
134
				checkXword.setSelection(false);
135 141
				maxLeft.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MAX_LEFT)-1);
136 142
				minLeft.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MIN_LEFT)-1);
137 143
				minRight.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MIN_RIGHT)-1);
138 144
				maxRight.setSelection(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MAX_RIGHT)-1);
145
				
146
				maxLeft.setMinimum(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MIN_LEFT)-1);
147
				minLeft.setMaximum(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MAX_LEFT)-1);
148
				minRight.setMaximum(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MAX_RIGHT)-1);
149
				maxRight.setMinimum(CooccurrencePreferences.getInstance().getInt(CooccurrencePreferences.MIN_RIGHT)-1);
139 150
			}
140 151
			
141 152
			@Override
......
149 160
			
150 161
			@Override
151 162
			public void widgetSelected(SelectionEvent e) {
163
				
152 164
				structs.setEnabled(true);
153 165
				checkLeft.setSelection(false);
154 166
				checkRight.setSelection(false);
167
				
155 168
				checkXword.setEnabled(true);
169
				checkXword.setSelection(true);
156 170
				
157
				checkXword.setSelection(true);
158 171
				maxLeft.setSelection(0);
159 172
				minLeft.setSelection(0);
160 173
				minRight.setSelection(0);
161 174
				maxRight.setSelection(0);
175
				
176
				maxLeft.setMinimum(0);
177
				minLeft.setMaximum(0);
178
				minRight.setMaximum(0);
179
				maxRight.setMinimum(0);
180
				
181
				maxLeft.setEnabled(false);
182
				minLeft.setEnabled(false);
183
				minRight.setEnabled(false);
184
				maxRight.setEnabled(false);
162 185
			}
163 186
			
164 187
			@Override
TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java (revision 3388)
88 88
	 */
89 89
	@Override
90 90
	public String getColumnText(Object element, int columnIndex) {
91

  
92
		//if (1 == 1 ) return "tmp:"+element;
91 93
		
92
		Object[] line = (Object[]) element;
94
		SpecifLine line = (SpecifLine) element;
93 95
		
94
		int[] freqs = (int[]) line[2];// get the freqs
96
//		int[] freqs = (int[]) line[2];// get the freqs
95 97
		// line content : {unit, freq, freqs[], scores[]}
96 98
		
97
		if (columnIndex < 2) {
98
			Object cell = line[columnIndex];
99
			return cell.toString();
99
		if (columnIndex == 0) {
100
			return line.name;
101
		} else if (columnIndex == 1) {
102
			return Integer.toString(line.f);
100 103
		}
101 104
		else if (columnIndex == 2) { // separator column
102 105
			return EMPTY;
103 106
		}
104
		else if (columnIndex == (freqs.length * separatorOffset) + 3) { // separator column
107
		else if (columnIndex == (line.freqs.length * separatorOffset) + 3) { // separator column
105 108
			return EMPTY;
106 109
		}
107 110
		else {
108 111
			columnIndex = columnIndex - 3;// this.partindexes[columnIndex - 3];
109 112
			if (columnIndex % 2 == 0) { // FREQ COLUMN
110 113
				columnIndex = columnIndex / 2; // because there is 2 col per part
111
				return String.valueOf(freqs[columnIndex]);
114
				return Integer.toString(line.freqs[columnIndex]);//String.valueOf(line.freqs[columnIndex]);
112 115
			}
113 116
			else { // SCORE COLUMN
114 117
				columnIndex = columnIndex / 2; // because there is 2 cols per part
115
				Object specif = line[3]; // get the scores
116
				double[] specifs = (double[]) specif;
118
//				Object specif = line[3]; // get the scores
119
//				double[] specifs = (double[]) specif;
117 120
				
118
				double s = specifs[columnIndex];
121
				double s = line.specifs[columnIndex];
119 122
				// if (-2 < s && s < 2) return "";
120 123
				return String.format(format, s);
121 124
				// if (showPValues) {
......
136 139
		return false;
137 140
	}
138 141
	
139
	
140 142
}
TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesLinesViewerComparator.java (revision 3388)
20 20
 *
21 21
 */
22 22
public class SpecificitiesLinesViewerComparator extends TableLinesViewerComparator {
23

  
24 23
	
24
	
25 25
	/**
26 26
	 * 
27 27
	 * @param collator
28 28
	 */
29 29
	public SpecificitiesLinesViewerComparator(Collator collator) {
30
		
30 31
		super(collator);
31 32
	}
32 33
	
33 34
	
34 35
	@Override
35 36
	public int compare(Viewer viewer, Object e1, Object e2) {
36
		Object[] line1 = (Object[]) e1;
37
		Object[] line2 = (Object[]) e2;
38 37
		
38
		SpecifLine line1 = (SpecifLine) e1;
39
		SpecifLine line2 = (SpecifLine) e2;
40
		
39 41
		int result = 0;
40 42
		
41 43
		switch (this.lastColumnIndex) {
42
		// type names
43
		case 0:
44
			result = this.collator.compare(line1[0], line2[0]);
45
			break;
46
		// total frequencies	
47
		case 1:
48
			result = ((Integer) line1[1]).compareTo(((Integer) line2[1]));
49
			break;
50
		// single part frequencies or single part scores
51
		default:
52
			int dataArrayRowIndex = (this.lastColumnIndex - 3) / 2; // 3 is the index of the column of the first part
53
			
54
			// part score
55
			if((this.lastColumnIndex % 2) == 0)	{
56
				result = new Double(((double[]) line1[3])[dataArrayRowIndex]).compareTo(new Double(((double[]) line2[3])[dataArrayRowIndex]));
57
			}
58
			// part frequency
59
			else	{
60
				result = new Integer(((int[]) line1[2])[dataArrayRowIndex]).compareTo(new Integer(((int[]) line2[2])[dataArrayRowIndex]));
61
			}
44
			// type names
45
			case 0:
46
				result = this.collator.compare(line1.name, line2.name);
47
				break;
48
			// total frequencies
49
			case 1:
50
				result = line1.f - line2.f;
51
				break;
52
			// single part frequencies or single part scores
53
			default:
54
				int dataArrayRowIndex = (this.lastColumnIndex - 3) / 2; // 3 is the index of the column of the first part
55
				
56
				// part score
57
				if ((this.lastColumnIndex % 2) == 0) {
58
					result = new Double(line1.specifs[dataArrayRowIndex]).compareTo(new Double(line2.specifs[dataArrayRowIndex]));
59
				}
60
				// part frequency
61
				else {
62
					result = new Integer(line1.freqs[dataArrayRowIndex]).compareTo(new Integer(line2.freqs[dataArrayRowIndex]));
63
				}
62 64
		}
63

  
65
		
64 66
		// reverse if needed
65 67
		if (this.direction == DESCENDING) {
66 68
			result = -result;
67 69
		}
68 70
		return result;
69 71
	}
70

  
72
	
71 73
	@Override
72 74
	public void addSelectionAdapter(final TableViewer viewer, final TableColumn column, final int index) {
75
		
73 76
		column.addSelectionListener(new SelectionAdapter() {
77
			
74 78
			@Override
75 79
			public void widgetSelected(SelectionEvent e) {
76 80
				
81
				// System.out.println("select column="+column.getText());
77 82
				boolean partScoreFirstSort = (index != 0 && (index % 2) == 0 && lastColumnIndex != index);
78 83
				
79 84
				setColumn(index);
80 85
				
81 86
				// force descending order on part score column first sorting
82
				if(partScoreFirstSort)	{
87
				if (partScoreFirstSort) {
83 88
					setDirection(DESCENDING);
84 89
				}
85 90
				viewer.getTable().setSortDirection(getDirection());
86 91
				viewer.getTable().setSortColumn(column);
87 92
				
88
				TXMEditor.packColumns(viewer);
93
				// long t = System.currentTimeMillis();
94
				TXMEditor.refreshColumns(viewer);
95
				// System.out.println("T="+(System.currentTimeMillis()-t));
89 96
			}
90 97
		});
91 98
	}
92 99
	
93
	
94 100
}
TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java (revision 3388)
110 110
	protected Spinner fMinSpinner;
111 111
	
112 112
	/**
113
	 * MAximum frequency filtering spinner.
113
	 * Maximum frequency filtering spinner.
114 114
	 */
115 115
	@Parameter(key = TXMPreferences.F_MAX)
116 116
	protected Spinner fMaxSpinner;
......
138 138
				ArrayList<WordProperty> availableProperties = new ArrayList<>();
139 139
				availableProperties.addAll(CQPCorpus.getFirstParentCorpus(this.getResult()).getOrderedProperties());
140 140
				availableProperties.addAll(CQPCorpus.getFirstParentCorpus(this.getResult()).getVirtualProperties());
141
				this.unitPropertyComboViewer = new PropertiesComboViewer(mainParametersArea, this, false,
142
						availableProperties, this.getResult().getUnitProperty(), false);
141
				this.unitPropertyComboViewer = new PropertiesComboViewer(mainParametersArea, this, false, availableProperties, this.getResult().getUnitProperty(), false);
143 142
			}
144 143
			
145 144
			
......
169 168
			this.viewerComparator = new SpecificitiesLinesViewerComparator(Toolbox.getCollator(this.getResult()));
170 169
			viewer.setComparator(this.viewerComparator);
171 170
			
172
			
173 171
			// create 1st column: Unit
174 172
			TableColumn unitColumn = new TableColumn(specificitesTable, SWT.NONE);
175 173
			unitColumn.setText(TXMCoreMessages.common_units);
......
257 255
			// //&& this.getResult().hasBeenComputedOnce()
258 256
			) {
259 257
				
260
				
261
				
262 258
				// remove lexical table columns if already exist
263 259
				// int columnsCount = specificitesTable.getColumnCount();
264 260
				// System.out.println("SpecificitiesEditor.updateEditorFromResult(): column count = " + columnsCount);
......
283 279
					
284 280
					viewerComparator.addSelectionAdapter(viewer, freqpartTableColumn, firstLexicalTableColumnIndex);
285 281
					
286
					
287 282
					// System.err.println("SpecificitiesEditor.updateEditorFromResult() creating column score at index " + (firstLexicalTableColumnIndex + 1));
288 283
					
289 284
					// SCORE COLUMN
......
304 299
			
305 300
			if (!this.getResult().isDirty()) {
306 301
				
307
				
308 302
				String[] typeNames = this.getResult().getTypeNames(); // units
309 303
				int[] typeFreq = this.getResult().getFormFrequencies(); // units' total freq
310 304
				double[][] specIndex = this.getResult().getSpecificitesIndex(); // units' index for each part
......
319 313
				// Log.finest("len specfreqs: " + specFreqs.length);
320 314
				// Log.finest("len specidx: " + specIndex.length);
321 315
				
322
				Object[] tableLines = new Object[typeNames.length];
316
				SpecifLine[] tableLines = new SpecifLine[typeNames.length];
323 317
				for (int j = 0; j < tableLines.length; j++) {
324
					tableLines[j] = new Object[] { typeNames[j], new Integer(typeFreq[j]), specFreqs[j], specIndex[j] };
318
					tableLines[j] = new SpecifLine(typeNames[j], typeFreq[j], specFreqs[j], specIndex[j]);
325 319
				}
326 320
				viewer.setInput(tableLines);
327 321
			}
TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecifLine.java (revision 3388)
1
package org.txm.specificities.rcp.editors;
2

  
3

  
4
public class SpecifLine {
5
	public String name;
6
	public int f;
7
	public int[] freqs;
8
	public double[] specifs;
9
	
10
	public SpecifLine(String name, int f, int[] freqs, double[] specifs) {
11
		this.name = name;
12
		this.f = f;
13
		this.freqs = freqs;
14
		this.specifs = specifs;
15
	}
16
}
0 17

  
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/CorporaSourceProvider.java (revision 3388)
4 4
import java.util.Map;
5 5

  
6 6
import org.eclipse.jface.viewers.ISelection;
7
import org.eclipse.jface.viewers.StructuredSelection;
7 8
import org.eclipse.ui.AbstractSourceProvider;
8 9
import org.txm.utils.logger.Log;
9 10

  
......
17 18
	
18 19
	public CorporaSourceProvider() {
19 20
		
20
		currentState.put(NAME, null);
21
		StructuredSelection selection = new StructuredSelection();
22
		currentState.put(NAME, selection);
23
		fireSourceChanged(1, NAME, selection);
24
		
21 25
		instance = this;
22 26
	}
23 27
	
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java (revision 3388)
145 145
				// def.setPageBreakTag("pb");
146 146
				// }
147 147
				
148
				project.setDoUpdate(false);
148
				project.setDoUpdate(false, false);
149 149
				project.saveParameters();
150 150
				return true;
151 151
			}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java (revision 3388)
29 29

  
30 30
import java.util.Set;
31 31

  
32
import org.eclipse.jface.preference.BooleanFieldEditor;
32 33
import org.eclipse.jface.preference.ComboFieldEditor;
33 34
import org.eclipse.jface.preference.StringFieldEditor;
34 35
import org.eclipse.swt.SWT;
......
59 60
	private StringFieldEditor defaultlang;
60 61
	
61 62
	private StringFieldEditor empty_code;
63
	
64
	private BooleanFieldEditor update_editions;
62 65

  
63 66
	/**
64 67
	 * Instantiates a new export preference page.
......
73 76
	 */
74 77
	@Override
75 78
	protected void createFieldEditors() {
76
		Set<String> encodings = java.nio.charset.Charset.availableCharsets()
77
				.keySet();
79
		
80
		update_editions = new BooleanFieldEditor(TBXPreferences.UPDATEEDITIONS, "Update editions when updating a corpus", getFieldEditorParent());
81
		addField(update_editions);
82
		
83
		Set<String> encodings = java.nio.charset.Charset.availableCharsets().keySet();
78 84
		String[][] values = new String[encodings.size()][2];
79 85
		int i = 0;
80 86
		for (String s : encodings) {
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TableLinesViewerComparator.java (revision 3388)
160 160
				viewer.getTable().setSortDirection(getDirection());
161 161
				viewer.getTable().setSortColumn(column);
162 162
				
163
				if(autoPackColumns)	{
163
				if (autoPackColumns)	{
164 164
					TXMEditor.packColumns(viewer);
165 165
				}
166 166
				else	{
167 167
					viewer.refresh();
168 168
				}
169
				
170 169
			}
171 170
		});
172 171
	}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/TokenizerSection.java (revision 3388)
110 110
		doRetokenizeStepButton.setSelection(true);
111 111
		doRetokenizeStepButton.setVisible(moduleParams.get(ImportModuleCustomization.ADVANCEDTOKENIZER));
112 112
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
113
		gdata.indent = 20;
113 114
		gdata.colspan = 3;
114 115
		doRetokenizeStepButton.setLayoutData(gdata);
115 116
		
......
118 119
		doBuildWordIDsButton.setSelection(true);
119 120
		doBuildWordIDsButton.setVisible(moduleParams.get(ImportModuleCustomization.ADVANCEDTOKENIZER));
120 121
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
122
		gdata.indent = 20;
121 123
		gdata.colspan = 3;
122 124
		doBuildWordIDsButton.setLayoutData(gdata);
123 125
		
124 126
		Label l0 = toolkit.createLabel(sectionClient, TXMUIMessages.separatorCharacters, SWT.WRAP);
125 127
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
126 128
		gdata.colspan = 3;
127
		gdata.indent = 10;
129
		gdata.indent = 20;
128 130
		l0.setLayoutData(gdata);
129 131
		
130 132
		Label l1 = toolkit.createLabel(sectionClient, TXMUIMessages.spaces, SWT.WRAP);
131 133
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
132 134
		gdata.colspan = 2;
133
		gdata.indent = 20;
135
		gdata.indent = 40;
134 136
		l1.setLayoutData(gdata);
135 137
		
136 138
		textWhiteSpaces = toolkit.createText(sectionClient, "", SWT.BORDER);
......
140 142
		Label l2 = toolkit.createLabel(sectionClient, TXMUIMessages.punctuations, SWT.WRAP);
141 143
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
142 144
		gdata.colspan = 2;
143
		gdata.indent = 20;
145
		gdata.indent = 40;
144 146
		l2.setLayoutData(gdata);
145 147
		
146 148
		textPuncts = toolkit.createText(sectionClient, "", SWT.BORDER);
......
150 152
		Label l4 = toolkit.createLabel(sectionClient, TXMUIMessages.elisionCharacters, SWT.WRAP);
151 153
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
152 154
		gdata.colspan = 2;
153
		gdata.indent = 10;
155
		gdata.indent = 20;
154 156
		l4.setLayoutData(gdata);
155 157
		
156 158
		textElisions = toolkit.createText(sectionClient, "", SWT.BORDER);
......
160 162
		Label l3 = toolkit.createLabel(sectionClient, TXMUIMessages.endOfSentenceCharacters, SWT.WRAP);
161 163
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
162 164
		gdata.colspan = 2;
163
		gdata.indent = 10;
165
		gdata.indent = 20;
164 166
		l3.setLayoutData(gdata);
165 167
		
166 168
		textPunctsStrong = toolkit.createText(sectionClient, "", SWT.BORDER);
......
170 172
		Button defaultBtn = toolkit.createButton(sectionClient, TXMUIMessages._default_2, SWT.PUSH);
171 173
		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL);
172 174
		gdata.colspan = 2;
173
		gdata.indent = 10;
175
		gdata.indent = 20;
174 176
		defaultBtn.setLayoutData(gdata);
175 177
		defaultBtn.addSelectionListener(new SelectionListener() {
176 178
			
......
313 315
		boolean enabled = doTokenizeStepButton.getSelection();
314 316
		doRetokenizeStepButton.setEnabled(enabled);
315 317
		doBuildWordIDsButton.setEnabled(enabled);
318
		if (!enabled) {
319
			doRetokenizeStepButton.setSelection(false);
320
			doBuildWordIDsButton.setSelection(false);
321
		}
316 322
		textWhiteSpaces.setEnabled(enabled);
317 323
		textPuncts.setEnabled(enabled);
318 324
		textElisions.setEnabled(enabled);
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java (revision 3388)
91 91
		gdata2.colspan = 4; // one line
92 92
		buildDefaultEditionButton.setLayoutData(gdata2);
93 93
		
94
		collapsibleMetadataDefaultEditionButton = toolkit.createButton(sectionClient, "Enable collapsible metadata", SWT.CHECK);
95
		// collapsibleMetadataDefaultEditionButton.setSelection(true);
96
		gdata2 = getButtonLayoutData();
97
		gdata2.colspan = 4; // one line
98
		gdata2.indent = 20;
99
		collapsibleMetadataDefaultEditionButton.setLayoutData(gdata2);
100
		
94 101
		paginateDefaultEditionButton = toolkit.createButton(sectionClient, "Paginate", SWT.CHECK);
95 102
		// paginateDefaultEditionButton.setSelection(true);
96 103
		gdata2 = getButtonLayoutData();
97 104
		gdata2.colspan = 4; // one line
105
		gdata2.indent = 20;
98 106
		paginateDefaultEditionButton.setLayoutData(gdata2);
99 107
		
100
		collapsibleMetadataDefaultEditionButton = toolkit.createButton(sectionClient, "Enable collapsible metadata", SWT.CHECK);
101
		// collapsibleMetadataDefaultEditionButton.setSelection(true);
102
		gdata2 = getButtonLayoutData();
103
		gdata2.colspan = 4; // one line
104
		collapsibleMetadataDefaultEditionButton.setLayoutData(gdata2);
105
		
106 108
		// words per page -> pageSize
107 109
		Label tmpLabel = null;
108 110
		if (moduleParams.get(ImportModuleCustomization.EDITIONS_WORDSPERPAGE)) {
109 111
			tmpLabel = toolkit.createLabel(sectionClient, TXMUIMessages.wordsPerPage);
110
			tmpLabel.setLayoutData(getLabelGridData());
112
			TableWrapData gdata = getLabelGridData();
113
			gdata.indent = 40;
114
			tmpLabel.setLayoutData(gdata);
111 115
			
112 116
			wordsPerPageText = toolkit.createText(sectionClient, "1000", SWT.BORDER); //$NON-NLS-1$
113
			TableWrapData gdata = getTextGridData();
117
			gdata = getTextGridData();
114 118
			wordsPerPageText.setLayoutData(gdata);
115 119
		}
116 120
		
......
121 125
			pageBreakText = toolkit.createText(sectionClient, "pb", SWT.BORDER); //$NON-NLS-1$
122 126
			TableWrapData gdata = getTextGridData();
123 127
			pageBreakText.setLayoutData(gdata);
128
		}
129
		
130
		if (scriptName.startsWith("xtz")) {
124 131
			
125
			if ("xtzLoader.groovy".equals(scriptName)) {
132
			// build text edition or not button
133
			buildFacsEditionCheckButton = toolkit.createButton(sectionClient, "Build 'facs' edition", SWT.CHECK);
134
			buildFacsEditionCheckButton.setSelection(false);
135
			TableWrapData gdata22 = getButtonLayoutData();
136
			gdata22.colspan = 4; // one line
137
			buildFacsEditionCheckButton.setLayoutData(gdata22);
138
			buildFacsEditionCheckButton.addSelectionListener(new SelectionListener() {
126 139
				
127
				// build text edition or not button
128
				buildFacsEditionCheckButton = toolkit.createButton(sectionClient, "Build 'facs' edition", SWT.CHECK);
129
				buildFacsEditionCheckButton.setSelection(false);
130
				TableWrapData gdata22 = getButtonLayoutData();
131
				gdata22.colspan = 4; // one line
132
				buildFacsEditionCheckButton.setLayoutData(gdata22);
133
				buildFacsEditionCheckButton.addSelectionListener(new SelectionListener() {
134
					
135
					@Override
136
					public void widgetSelected(SelectionEvent e) {
137
						imageDirectoryText.setEnabled(buildFacsEditionCheckButton.getSelection());
140
				@Override
141
				public void widgetSelected(SelectionEvent e) {
142
					imageDirectoryText.setEnabled(buildFacsEditionCheckButton.getSelection());
143
				}
144
				
145
				@Override
146
				public void widgetDefaultSelected(SelectionEvent e) {}
147
			});
148
			// image directory
149
			tmpLabel = toolkit.createLabel(sectionClient, "Images directory: ");
150
			TableWrapData gdata = getLabelGridData();
151
			gdata.indent = 20;
152
			tmpLabel.setLayoutData(gdata);
153
			imageDirectoryText = toolkit.createText(sectionClient, "", SWT.BORDER); //$NON-NLS-1$
154
			gdata = getTextGridData();
155
			gdata.colspan = 2;
156
			
157
			imageDirectoryText.setLayoutData(gdata);
158
			imageDirectoryText.setEnabled(false);
159
			
160
			Button selectImageDirectoryButton = toolkit.createButton(sectionClient, "...", SWT.PUSH);
161
			gdata = getButtonLayoutData();
162
			selectImageDirectoryButton.setLayoutData(gdata);
163
			selectImageDirectoryButton.addSelectionListener(new SelectionListener() {
164
				
165
				@Override
166
				public void widgetSelected(SelectionEvent e) {
167
					DirectoryDialog dialog = new DirectoryDialog(form.getShell(), SWT.OPEN);
168
					if (LastOpened.getFile(ID) != null) {
169
						dialog.setFilterPath(LastOpened.getFolder(ID));
138 170
					}
139
					
140
					@Override
141
					public void widgetDefaultSelected(SelectionEvent e) {}
142
				});
143
				// image directory
144
				tmpLabel = toolkit.createLabel(sectionClient, "Images directory: ");
145
				tmpLabel.setLayoutData(getLabelGridData());
146
				imageDirectoryText = toolkit.createText(sectionClient, "", SWT.BORDER); //$NON-NLS-1$
147
				gdata = getTextGridData();
148
				gdata.colspan = 2;
149
				imageDirectoryText.setLayoutData(gdata);
150
				imageDirectoryText.setEnabled(false);
171
					else {
172
						dialog.setFilterPath(Toolbox.getTxmHomePath());
173
					}
174
					if (dialog.open() != null) {
175
						File imgDirectory = new File(dialog.getFilterPath());
176
						LastOpened.set(ID, imgDirectory.getParent(), "");
177
						imageDirectoryText.setText(imgDirectory.getAbsolutePath());
178
					}
179
				}
151 180
				
152
				Button selectImageDirectoryButton = toolkit.createButton(sectionClient, "...", SWT.PUSH);
153
				gdata = getButtonLayoutData();
154
				selectImageDirectoryButton.setLayoutData(gdata);
155
				selectImageDirectoryButton.addSelectionListener(new SelectionListener() {
156
					
157
					@Override
158
					public void widgetSelected(SelectionEvent e) {
159
						DirectoryDialog dialog = new DirectoryDialog(form.getShell(), SWT.OPEN);
160
						if (LastOpened.getFile(ID) != null) {
161
							dialog.setFilterPath(LastOpened.getFolder(ID));
162
						}
163
						else {
164
							dialog.setFilterPath(Toolbox.getTxmHomePath());
165
						}
166
						if (dialog.open() != null) {
167
							File imgDirectory = new File(dialog.getFilterPath());
168
							LastOpened.set(ID, imgDirectory.getParent(), "");
169
							imageDirectoryText.setText(imgDirectory.getAbsolutePath());
170
						}
171
					}
172
					
173
					@Override
174
					public void widgetDefaultSelected(SelectionEvent e) {}
175
				});
176
			}
177
		}
178
		
179
		if (scriptName.startsWith("xtz")) {
181
				@Override
182
				public void widgetDefaultSelected(SelectionEvent e) {}
183
			});
180 184
			
181 185
			tmpLabel = toolkit.createLabel(sectionClient, "Default edition: ");
182 186
			tmpLabel.setLayoutData(getLabelGridData());
183 187
			
184 188
			defaultEditions = toolkit.createText(sectionClient, "", SWT.BORDER);
185
			TableWrapData gdata = getTextGridData();
189
			gdata = getTextGridData();
186 190
			gdata.colspan = 2;
187 191
			defaultEditions.setLayoutData(gdata);
188 192
		}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java (revision 3388)
11 11
import org.eclipse.swt.widgets.Button;
12 12
import org.eclipse.swt.widgets.Combo;
13 13
import org.eclipse.swt.widgets.Composite;
14
import org.eclipse.swt.widgets.Label;
14 15
import org.eclipse.ui.forms.events.ExpansionAdapter;
15 16
import org.eclipse.ui.forms.events.ExpansionEvent;
16 17
import org.eclipse.ui.forms.widgets.FormToolkit;
......
85 86
		}
86 87
		if (engines.size() > 1) {
87 88
			
88
			toolkit.createLabel(sectionClient, "Annotation engine"); //$NON-NLS-1$
89
			Label tmp = toolkit.createLabel(sectionClient, "Annotation engine"); //$NON-NLS-1$
90
			TableWrapData gdata = getTextGridData();
91
			gdata.indent = 20;
92
			tmp.setLayoutData(gdata);
89 93
			
90 94
			annotateEngineCombo = new Combo(sectionClient, SWT.BORDER);
91
			annotateEngineCombo.setLayoutData(getTextGridData());
95
			gdata = getTextGridData();
96
			annotateEngineCombo.setLayoutData(gdata);
92 97
			annotateEngineCombo.setToolTipText("Annotation engines");
93 98
			annotateEngineCombo.setItems(engines.toArray(new String[engines.size()]));
94 99
			annotateEngineCombo.setText(annotateEngineCombo.getItem(0));
......
97 102
		// if widget selected change the radio buttons value
98 103
		
99 104
		btnGuessLang = toolkit.createButton(sectionClient, TXMUIMessages.guessColon, SWT.RADIO);
105
		TableWrapData gdata = getTextGridData();
106
		gdata.indent = 20;
107
		btnGuessLang.setLayoutData(gdata);
100 108
		toolkit.createLabel(sectionClient, ""); //$NON-NLS-1$
101 109
		
102 110
		btnSelectLang = toolkit.createButton(sectionClient, TXMUIMessages.selectColon, SWT.RADIO);
111
		gdata = getTextGridData();
112
		gdata.indent = 20;
113
		btnSelectLang.setLayoutData(gdata);
103 114
		
104 115
		langcombo = new Combo(sectionClient, SWT.BORDER);
105
		TableWrapData gdata = getTextGridData();
116
		gdata = getTextGridData();
106 117
		langcombo.setLayoutData(gdata);
107 118
		langcombo.setToolTipText("Sources lang (show only the TreeTagger common language)");
108 119
		// if widget selected change the radio buttons value
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 3388)
1052 1052
	public void startImport() {
1053 1053
		// TODO: test all sections here
1054 1054
		project.setDirty();
1055
		project.setDoUpdate(false);
1055
		project.setDoUpdate(false, false);
1056 1056
		project.setNeedToBuild();
1057 1057
		
1058 1058
		if (project.getChildren().size() > 0) {
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 3388)
335 335
			public void partActivated(IWorkbenchPartReference partRef) {
336 336
				
337 337
				// FIXME: SJ: why? when opening a new Editor the view will be refreshed twice...
338
				CorporaView.refresh();
338
				//CorporaView.refresh();
339 339
			}
340 340
			
341 341
			@Override
......
1744 1744
	}
1745 1745
	
1746 1746
	/**
1747
	 * Refresh the columns after updating line sort
1748
	 * 
1749
	 * @param viewer the table viewer
1750
	 */
1751
	public static void refreshColumns(TableViewer viewer) {
1752
//		viewer.getControl().setRedraw(false);
1753
		viewer.refresh();
1754
//		viewer.getControl().setRedraw(true);
1755
//		viewer.getControl().update();
1756
	}
1757
	/**
1747 1758
	 * Packs the columns of the specified table viewer so the label of the sort column is not truncated due of the sorting order arrow display.
1748 1759
	 * 
1749
	 * TODO: compute the column width using FontMetrics -> more precise. Currently the column width is an aproximation using the font height and the longest string length
1760
	 * TODO: compute the column width using FontMetrics -> more precise. Currently the column width is an approximation using the font height and the longest string length
1750 1761
	 * 
1751 1762
	 * @param viewer the table viewer
1752 1763
	 */
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java (revision 3388)
9 9
import org.eclipse.core.runtime.IProgressMonitor;
10 10
import org.eclipse.core.runtime.IStatus;
11 11
import org.eclipse.core.runtime.Status;
12
import org.eclipse.jface.dialogs.MessageDialog;
12 13
import org.eclipse.jface.viewers.ISelection;
13 14
import org.eclipse.jface.viewers.IStructuredSelection;
14 15
import org.eclipse.osgi.util.NLS;
15 16
import org.eclipse.swt.widgets.Display;
16 17
import org.eclipse.ui.handlers.HandlerUtil;
18
import org.txm.core.preferences.TBXPreferences;
17 19
import org.txm.objects.Project;
18 20
import org.txm.rcp.commands.CloseEditorsUsing;
19 21
import org.txm.rcp.commands.RestartTXM;
......
38 40
		}
39 41
		MainCorpus corpus = (MainCorpus) s;
40 42
		
43
		boolean updateEdition = false;
44
		
41 45
		// force corpus to be recomputed
42 46
		String forceDirty = event.getParameter("org.txm.rcp.commands.workspace.UpdateCorpus.force"); //$NON-NLS-1$
43 47
		if ("true".equals(forceDirty)) {
44 48
			corpus.getProject().setDirty();
49
			updateEdition = true;
50
		} else {
51
			if (corpus.getProject().getBuiltEditionNames().size() > 0) {
52
				updateEdition = MessageDialog.openQuestion(HandlerUtil.getActiveShell(event), "Update editions", "Do you want to update the edition pages as well ?");
53
			} else {
54
				updateEdition = false; // no edition to do, skip the pager step when updating
55
			}
45 56
		}
46 57
		
47
		update(corpus);
58
		update(corpus, updateEdition);
48 59
		
49 60
		return corpus;
50 61
	}
51 62
	
52 63
	public static JobHandler update(final MainCorpus corpus) {
64
		return update(corpus, TBXPreferences.getInstance().getBoolean(TBXPreferences.UPDATEEDITIONS));
65
	}
66
	
67
	public static JobHandler update(final MainCorpus corpus, boolean updateEdition) {
53 68
		
54 69
		final Project project = corpus.getProject();
55 70
		if (project == null) return null;
......
101 116
		project.setDirty(false);// false=dont propagate dirty
102 117
		project.setNeedToBuild();
103 118
		project.setDoMultiThread(false); // too soon
104
		project.setDoUpdate(true);
119
		project.setDoUpdate(true, updateEdition);
105 120
		String currentModule = project.getImportModuleName();
106 121
		if (!(currentModule.equals("xtz") || currentModule.equals("transcriber"))) {
107 122
			project.setImportModuleName("xtz");
TXM/trunk/org.txm.rcp/plugin.xml (revision 3388)
61 61
         </property>
62 62
         <property
63 63
               name="cssTheme"
64
               value="org.txm.rcp.theme.default.linux">
64
               value="org.txm.rcp.theme.default.linux2">
65 65
         </property>
66 66
         <property
67 67
               name="preferenceCustomization"
......
2624 2624
      <command
2625 2625
            defaultHandler="org.txm.rcp.commands.ExportXMLTXMFiles"
2626 2626
            id="org.txm.rcp.commands.ExportXMLTXMFiles"
2627
            name="XML-TXM files...">
2627
            name="Corpus au format XML-TXM (.xml)...">
2628 2628
      </command>
2629 2629
   </extension>
2630 2630
   <extension
......
2943 2943
            <definition
2944 2944
                  id="OneProjectSelected">
2945 2945
               <with
2946
                     variable="selection">
2946
                     variable="corporaSelection">
2947 2947
                  <iterate
2948 2948
                        ifEmpty="false"
2949 2949
                        operator="and">
......
2956 2956
            <definition
2957 2957
                  id="OneIProjectSelected">
2958 2958
               <with
2959
                     variable="selection">
2959
                     variable="corporaSelection">
2960 2960
                  <iterate
2961 2961
                        ifEmpty="false"
2962 2962
                        operator="and">
......
2969 2969
            <definition
2970 2970
                  id="OneTextSelected">
2971 2971
               <with
2972
                     variable="selection">
2972
                     variable="corporaSelection">
2973 2973
                  <iterate
2974 2974
                        ifEmpty="false"
2975 2975
                        operator="and">
......
3035 3035
            <definition
3036 3036
                  id="OneLexicalTableAbleSelected">
3037 3037
               <with
3038
                     variable="selection">
3038
                     variable="corporaSelection">
3039 3039
                  <iterate
3040 3040
                        ifEmpty="false"
3041 3041
                        operator="and">
......
3085 3085
            <definition
3086 3086
                  id="OneTXMResultSelected">
3087 3087
               <with
3088
                     variable="selection">
3088
                     variable="corporaSelection">
3089 3089
                  <iterate
3090 3090
                        ifEmpty="false"
3091 3091
                        operator="and">
......
3126 3126
            <definition
3127 3127
                  id="OneProjectSelected">
3128 3128
               <with
3129
                     variable="selection">
3129
                     variable="corporaSelection">
3130 3130
                  <iterate
3131 3131
                        ifEmpty="false"
3132 3132
                        operator="and">
TXM/trunk/org.txm.core/src/java/org/txm/importer/xtz/ImportKeys.java (revision 3388)
10 10
	public static final String MULTITHREAD = "multithread";
11 11
	public static final String DEBUG = "debug";
12 12
	public static final String UPDATECORPUS = "corpus.update";
13
	public static final String UPDATECORPUSEDITION = "corpus.update.edition";
13 14
	
14 15
	public static final String NORMALISEANAVALUES = "normalize.ana.values";
15 16
	public static final String NORMALISEATTRIBUTEVALUES = "normalize.attribute.values";
TXM/trunk/org.txm.core/src/java/org/txm/importer/xtz/ImportModule.java (revision 3388)
48 48
	
49 49
	public boolean updateCorpus = false;
50 50
	
51
	public boolean updateEdition = true;
52
	
51 53
	public String corpusName;
52 54
	
53 55
	IProgressMonitor monitor;
......
73 75
		return updateCorpus;
74 76
	}
75 77
	
78
	public boolean isUpdatingEdition() {
79
		return updateEdition;
80
	}
81
	
76 82
	public void init(Project p) {
77 83
		this.project = p;
78 84
		
......
84 90
		}
85 91
		this.multithread = project.getDoMultiThread();
86 92
		this.updateCorpus = project.getDoUpdate();
93
		this.updateEdition = project.getDoUpdateEdition();
87 94
		
88 95
		
89 96
		this.sourceDirectory = project.getSrcdir();
......
255 262
			}
256 263
		}
257 264
		
258
		Tpager.start();
265
		if (updateEdition) {
266
			Tpager.start();
267
		}
268
		
259 269
		if (multithread) Tcompiler.join(); // wait for both threads to end
260
		Tpager.join();
261 270
		
271
		if (updateEdition) {
272
			Tpager.join();
273
		}
274
		
262 275
		if (isSuccessful) { // all done TODO remove this code when Text._compute() will be implemented
263
			for (Text t : project.getTexts()) {
264
				t.compute(false);
276
			if (updateEdition) {
277
				for (Text t : project.getTexts()) {
278
					t.compute(false);
279
				}
265 280
			}
266 281
			
267
			project.setDoUpdate(false);
282
			project.setDoUpdate(false, false);
268 283
		}
269 284
	}
270 285
	
TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 3388)
163 163
	public static final String DEBUG = "debug";
164 164
	
165 165
	public static final String UPDATECORPUS = "corpus.update";
166
	public static final String UPDATEEDITIONS = "update_editions";
166 167
	
167 168
	public static final String NORMALISEANAVALUES = "normalize.ana.values";
168 169
	
169 170
	public static final String NORMALISEATTRIBUTEVALUES = "normalize.attribute.values";
170 171
	
171 172
	public static final String CORPUS_VERSION = "corpus_version";
173

  
172 174
	
173 175
	/**
174 176
	 * Gets the instance.
......
225 227
		preferences.putBoolean(SHOW_ALL_RESULT_NODES, false);
226 228
		preferences.putBoolean(AUTO_PERSISTENCE_ENABLED, false);
227 229
		
230
		preferences.putBoolean(UPDATEEDITIONS, true);
231
		
228 232
		if (Toolbox.getTxmHomePath().endsWith("-dev")) {
229 233
			preferences.put(UPDATESITE,		"file://" + System.getProperty("user.home") + "/workspace047/TXMReleasePlugins.site/");
230 234
			preferences.put(RAWFILESSITE,	"file://" + System.getProperty("user.home") + "/workspace047/org.txm.setups/");
TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java (revision 3388)
1464 1464
		return this.getImportParameters().getBoolean(ImportKeys.UPDATECORPUS, false);
1465 1465
	}
1466 1466
	
1467
	public void setDoUpdate(boolean update) {
1467
	public boolean getDoUpdateEdition() {
1468
		return this.getImportParameters().getBoolean(ImportKeys.UPDATECORPUSEDITION, true);
1469
	}
1470
	
1471
	public void setDoUpdate(boolean update, boolean updateedition) {
1468 1472
		this.getImportParameters().putBoolean(ImportKeys.UPDATECORPUS, update);
1473
		this.getImportParameters().putBoolean(ImportKeys.UPDATECORPUSEDITION, updateedition);
1469 1474
	}
1470 1475
	
1471 1476
	public boolean getDoMultiThread() {
TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 3388)
113 113

  
114 114
		/** The score. */
115 115
		public double score;
116
		
117
		/** The score. */
118
		public String debug;
116 119

  
117 120
		/**
118 121
		 * Instantiates a new c line.
......
663 666

  
664 667

  
665 668
		String pquery = CQLQuery.fixQuery(this.getQuery().getQueryString(), this.getCorpus().getLang());
666
		if (this.getMaxLeft() == 0) {
669
		if (this.getMaxLeft() == 0 && !this.pIncludeXpivot) {
667 670
			query = "" + pquery + " []* " + query + " " + maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
668 671
		}
669
		else if (this.getMaxRight() == 0) {
672
		else if (this.getMaxRight() == 0 && !this.pIncludeXpivot) {
670 673
			query = "" + query + " []* " + pquery + " " + maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
671 674
		}
672 675
		else {
......
1485 1488
	 * @throws CqiClientException
1486 1489
	 */
1487 1490
	public boolean stepGetMatches() throws CqiClientException {
1491
		
1488 1492
		CQPCorpus corpus = this.getCorpus();
1489 1493
		QueryResult r1 = corpus.query(pQuery, "CoocFocusQuery", false); // keywords positions //$NON-NLS-1$
1490 1494
		QueryResult r2 = null;
......
1505 1509
			r3 = corpus.query(anticontextquery, "CoocAntiContextFocusQuery", false); // no context //$NON-NLS-1$
1506 1510
		}
1507 1511

  
1508

  
1509 1512
		m1 = r1.getMatches();
1510 1513
		numberOfKeyword = m1.size();
1511 1514
		m2 = r2.getMatches();
......
1585 1588
						indexfreqs.get(specifrownames[ii]), scores[ii][1], // freq
1586 1589
						((float) (distances.get(signaturestr) / counts.get(signaturestr))), // mean distance
1587 1590
						-1);
1591
				cline.debug = ""+this;
1588 1592
				// System.out.println("Line: "+specifrownames[ii]+" dists="+distances.get(signaturestr)+" counts="+counts.get(signaturestr)+" mean="+((float) (distances.get(signaturestr) / counts.get(signaturestr))));
1589 1593
				// select the line
1590 1594
				if (cline.freq >= this.pFminFilter && cline.nbocc >= this.pFCoocFilter && cline.score >= this.pScoreMinFilter) {
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitConcordanceToolbar.java (revision 3388)
126 126
	
127 127
	@Override
128 128
	public String getName() {
129
		return "Unit (URS)";
129
		return "Annotation d'Unité URS";
130 130
	}
131 131
	
132 132
	@Override
......
214 214
		
215 215
		annotationArea = new GLComposite(parent, SWT.NONE, "Unit URS");
216 216
		annotationArea.getLayout().numColumns = 12;
217
		annotationArea.getLayout().horizontalSpacing = 1;
217
		annotationArea.getLayout().horizontalSpacing = 2;
218 218
		annotationArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
219 219
		
220
		GridData gdata = new GridData(SWT.CENTER, SWT.CENTER, false, false);
221
		gdata.widthHint = 90;
220 222
		
221
		Button closeButton = new Button(annotationArea, SWT.PUSH);
222
		closeButton.setToolTipText("End URS annotation");
223
		closeButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_DELETE));
223
		Label typeLabel = new Label(annotationArea, SWT.NONE);
224
		typeLabel.setText("Type"); //$NON-NLS-1$
225
		typeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
224 226
		
225
		closeButton.addSelectionListener(new SelectionListener() {
226
			
227
			@Override
228
			public void widgetSelected(SelectionEvent e) {
229
				extension.closeArea(UnitConcordanceToolbar.this, true);
230
			}
231
			
232
			@Override
233
			public void widgetDefaultSelected(SelectionEvent e) {}
234
		});
235 227
		
236
		
237
		GridData gdata = new GridData(SWT.CENTER, SWT.CENTER, false, false);
238
		gdata.widthHint = 90;
239
		
240 228
		// UNIT TYPE
241 229
		annotationTypesCombo = new ComboViewer(annotationArea, SWT.SINGLE);
242 230
		annotationTypesCombo.setContentProvider(new ArrayContentProvider());
......
401 389
		// public void widgetDefaultSelected(SelectionEvent e) {}
402 390
		// });
403 391
		
392
		Button closeButton = new Button(annotationArea, SWT.PUSH);
393
		closeButton.setToolTipText("End URS annotation");
394
		closeButton.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
395
		closeButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_DELETE));
404 396
		
397
		closeButton.addSelectionListener(new SelectionListener() {
398
			
399
			@Override
400
			public void widgetSelected(SelectionEvent e) {
401
				extension.closeArea(UnitConcordanceToolbar.this, true);
402
			}
403
			
404
			@Override
405
			public void widgetDefaultSelected(SelectionEvent e) {}
406
		});
407
		
405 408
		onAnnotationTypeSelected(null);
406 409
		
407 410
		editor.layout(true);
......
724 727
	public boolean notifyStartOfCompute() throws Exception {
725 728
		return true;
726 729
	}
730

  
731
	@Override
732
	public boolean needToUpdateEditions() {
733
		
734
		return false;
735
	}
727 736
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitToolbar.java (revision 3388)
114 114
	public UnitToolbar() {}
115 115
	
116 116
	@Override
117
	public boolean install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
118
		super.install(txmeditor, extension, parent, position);
117
	protected boolean _install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
119 118
		
120 119
		annotationArea.getLayout().numColumns = 11;
121 120
		annotationArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
......
1259 1258
	public boolean hasChanges() {
1260 1259
		return analecCorpus.isModifie();
1261 1260
	}
1261

  
1262
	@Override
1263
	public boolean needToUpdateEditions() {
1264
		
1265
		return false;
1266
	}
1262 1267
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/SchemaToolbar.java (revision 3388)
89 89
	public SchemaToolbar() { }
90 90

  
91 91
	@Override
92
	public boolean install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
93
		super.install(txmeditor, extension, parent, position);
92
	protected boolean _install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
94 93
		
95 94
		annotationArea.getLayout().numColumns = 8;
96 95
		annotationArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
......
1001 1000
	public boolean hasChanges() {
1002 1001
		return analecCorpus.isModifie();
1003 1002
	}
1003

  
1004
	@Override
1005
	public boolean needToUpdateEditions() {
1006
		return false;
1007
	}
1004 1008
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/URSAnnotationToolbar.java (revision 3388)
106 106
		}
107 107
	}
108 108
	
109
	protected abstract boolean _install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception; 
110

  
109 111
	@Override
110
	public boolean install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
112
	public final boolean install(TXMEditor<? extends TXMResult> txmeditor, AnnotationExtension extension, Composite parent, int position) throws Exception {
111 113
		
112 114
		this.extension = extension;
113 115
		this.editor = (SynopticEditionEditor) txmeditor;
......
165 167
		button = extension.getSaveButton();
166 168
		button.setEnabled(analecCorpus.isModifie());
167 169
		
170
		_install(txmeditor, extension, parent, position);
171
		
168 172
		closeButton = new Button(annotationArea, SWT.PUSH);
169 173
		closeButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_DELETE));
170 174
		closeButton.addSelectionListener(new SelectionListener() {
......
180 184
		return true;
181 185
	}
182 186
	
187
	protected void installCloseButton() {
188
		
189
	}
183 190
	
191
	
184 192
	protected abstract ProgressListener getPageReloadListener();
185 193
	
186 194
	public Corpus getAnalecCorpus() {
TXM/trunk/org.txm.analec.rcp/OSGI-INF/l10n/bundle.properties (revision 3388)
8 8
Bundle-Vendor = Textometrie.org
9 9

  
10 10
command.label   = Import Glozz annotations (clear the current annotations)...
11
command.label.0 = Corpus in XML-TEI URS format...
12
command.label.1 = Corpus in Glozz format (.ac, .ac and .aam)...
11
command.label.0 = Annotations URS in XML-TEI URS format (-urs.xml, .aam)...
12
command.label.1 = Texts and URS Units in Glozz format (.ac, .ac and .aam)...
13 13
command.label.2 = XML-TEI Analec
14 14
command.name    = Load Annotation Structure
15 15
command.name.0  = Edit Annotation Structure
TXM/trunk/org.txm.analec.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 3388)
11 11

  
12 12
command.label = Importer des annotations Glozz (supprime les annotations d\u00E9j\u00E0 existantes)...
13 13

  
14
command.label.0 = Corpus au format XML-TEI URS...
14
command.label.0 = Annotations URS au format XML-TEI URS (-urs.xml, .aam)...
15 15

  
16
command.label.1 = Corpus au format Glozz (.ac, .aa et .aam)...
16
command.label.1 = Textes et Unit?s URS au format Glozz (.ac, .aa, .aam)...
17 17

  
18 18
command.label.2 = XML-TEI Analec
19 19

  
TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/dialogs/ExportCorpusDialog.java (revision 3388)
148 148
			public void widgetDefaultSelected(SelectionEvent e) {}
149 149
		});
150 150
		
151
		new Label(comp, SWT.NONE).setText("Rename corpus");
151
		new Label(comp, SWT.NONE).setText("Corpus name");
152 152
		renameField = new Text(comp, SWT.BORDER);
153 153
		GridData gdata2 = GridDataFactory.fillDefaults().create();
154 154
		gdata2.widthHint = 50;
155 155
		gdata2.horizontalSpan = 2;
156 156
		renameField.setLayoutData(gdata2);
157
		renameField.setText(corpus.getProject().getName());
158
		renameField.setToolTipText("To rename the corpus");
157 159
		
158 160
		new Label(comp, SWT.NONE).setText("Corpus version");
159 161
		versionField = new Combo(comp, SWT.SINGLE | SWT.READ_ONLY);
......
211 213
			
212 214
			if (files.length > 0) {
213 215
				treeViewer = new TableViewer(comp, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
214
				
216
				treeViewer.getTable().setToolTipText("Directories not managed by TXM");
215 217
				treeViewer.setContentProvider(new ArrayContentProvider());
216 218
				
217 219
				treeViewer.getTable().addListener(SWT.Selection, event -> {
TXM/trunk/org.txm.searchengine.cqp.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 3388)
7 7
command.label.8=Partition
8 8
command.name=Sous-corpus
9 9
command.name.2=Partition
10
command.name.52=Corpus en format binaire...
10
command.name.52=Corpus en format binaire (.txm)...
11 11
command.name.63=Ouvrir la fiche bibliographique
12 12
command.tooltip.4=Construire une partition
13 13
command.tooltip.71=Exporter en fichier binaire
TXM/trunk/org.txm.searchengine.cqp.rcp/OSGI-INF/l10n/bundle.properties (revision 3388)
7 7
command.label.8=Partition
8 8
command.name=Sub-corpus
9 9
command.name.2=Partition
10
command.name.52=Corpus in binary format...
10
command.name.52=Corpus in binary format (.txm)...
11 11
command.name.63=Open Bibliographic notice
12 12
command.tooltip.4=Build a partition
13 13
command.tooltip.71=Export as a binary file
TXM/trunk/org.txm.annotation.kr.rcp/plugin.xml (revision 3388)
59 59
   </extension>
60 60
  <extension
61 61
        point="org.eclipse.ui.preferencePages">
62
     <page
63
           category="org.txm.annotation.rcp.preferences.AnnotationPreferencePage"
64
           class="org.txm.annotation.kr.rcp.preferences.KRAnnotationPreferencePage"
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff