Révision 4002

TXM/trunk/bundles/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___TableEditor.java (revision 4002)
27 27
//
28 28
package org.txm.lexicaltable.rcp.editors;
29 29

  
30
import java.util.Locale;
31

  
30 32
import org.eclipse.core.runtime.IProgressMonitor;
31 33
import org.eclipse.jface.action.MenuManager;
32 34
import org.eclipse.jface.viewers.TableViewer;
......
182 184
		tableSorter.setColumnTypes(tableInput.getColumnTypes());
183 185
		if (this.iEditorInput instanceof ___LexicalTableEditorInput) {
184 186
			___LexicalTableEditorInput ed = (___LexicalTableEditorInput) this.iEditorInput;
185
			tableSorter.setLocale(ed.getResult().getPartition().getParent().getLocale());
187
			tableSorter.setLocale(new Locale(ed.getResult().getPartition().getParent().getLang()));
186 188
		}
187 189
		viewer.setSorter(tableSorter);
188 190
		
TXM/trunk/bundles/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/comparators/CLineComparator.java (revision 4002)
88 88
	 * @param corpus the corpus
89 89
	 */
90 90
	public void initialize(CQPCorpus corpus) {
91
		setLocale(corpus.getLocale());
91
		setLocale(new Locale(corpus.getLang()));
92 92
	}
93 93
	
94 94
	/**
TXM/trunk/bundles/org.txm.index.core/src/org/txm/index/core/functions/LineComparator.java (revision 4002)
29 29

  
30 30
import java.text.Collator;
31 31
import java.util.Comparator;
32
import java.util.Locale;
32 33

  
33 34
import org.txm.searchengine.cqp.corpus.CQPCorpus;
34 35

  
......
137 138
	 * @param corpus the corpus
138 139
	 */
139 140
	public void initialize(CQPCorpus corpus) {
140
		collator = Collator.getInstance(corpus.getLocale());
141
		collator = Collator.getInstance(new Locale(corpus.getLang()));
141 142
		collator.setStrength(Collator.TERTIARY);
142 143
	}
143 144
}
TXM/trunk/bundles/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/LocalizedLineComparator.java (revision 4002)
81 81
	 */
82 82
	@Override
83 83
	public void initialize(CQPCorpus corpus) {
84
		setLocale(corpus.getLocale());
84
		setLocale(new Locale(corpus.getLang()));
85 85
	}
86 86
}
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/ComboDialog.java (revision 4002)
158 158
	protected void okPressed() {
159 159
		
160 160
		selectedIndex = combo.getSelectionIndex();
161
		selectedValue = values.get(selectedIndex);
161
		if (selectedIndex > 0) {
162
			selectedValue = values.get(selectedIndex);
163
		} else {
164
			selectedValue = combo.getText();
165
		}
162 166
		super.okPressed();
163 167
	}
164 168

  
TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java (revision 4002)
877 877
		return getProject().getLang();
878 878
	}
879 879
	
880
	/**
881
	 * Get the corpus locale using txmcorpus_lang property
882
	 * @deprecated use getProject.getLlang() instead, will be fixed later to mange multi lang corpus
883
	 * @return
884
	 */
885
	public Locale getLocale() {
886
		/*
887
		 * Serializable lang = this.getAttribute("lang"); //$NON-NLS-1$ if (lang !=
888
		 * null) { return new Locale(lang.toString()); } else return
889
		 * Locale.getDefault();
890
		 */
891
		// System.out.println("getLang1: "+lang);
892
		if (lang == null) {
893
			try {
894
				StructuralUnit su = this.getStructuralUnit("txmcorpus"); //$NON-NLS-1$
895
				StructuralUnitProperty prop = su.getProperty("lang"); //$NON-NLS-1$
896
				List<String> values = prop.getValues();
897
				if (values.size() > 0)
898
					lang = values.get(0);
899
				// System.out.println("get lang: "+lang);
900
			}
901
			catch (Exception e) {
902
				// TODO Auto-generated catch block
903
				// org.txm.utils.logger.Log.printStackTrace(e);
904
				System.out.println(TXMCoreMessages.corpusColongetLocaleColonCQPIsNotReadyToAnswerColon + e);
905
			}
906
		}
907
		if (lang != null)
908
			return new Locale(lang);
909
		else
910
			return Locale.getDefault();
911
	}
880
//	/**
881
//	 * Get the corpus locale using txmcorpus_lang property
882
//	 * @deprecated use getProject.getLlang() instead, will be fixed later to mange multi lang corpus
883
//	 * @return
884
//	 */
885
//	public Locale getLocale() {
886
//		/*
887
//		 * Serializable lang = this.getAttribute("lang"); //$NON-NLS-1$ if (lang !=
888
//		 * null) { return new Locale(lang.toString()); } else return
889
//		 * Locale.getDefault();
890
//		 */
891
//		// System.out.println("getLang1: "+lang);
892
//		if (lang == null) {
893
//			try {
894
//				StructuralUnit su = this.getStructuralUnit("txmcorpus"); //$NON-NLS-1$
895
//				StructuralUnitProperty prop = su.getProperty("lang"); //$NON-NLS-1$
896
//				List<String> values = prop.getValues();
897
//				if (values.size() > 0)
898
//					lang = values.get(0);
899
//				// System.out.println("get lang: "+lang);
900
//			}
901
//			catch (Exception e) {
902
//				// TODO Auto-generated catch block
903
//				// org.txm.utils.logger.Log.printStackTrace(e);
904
//				System.out.println(TXMCoreMessages.corpusColongetLocaleColonCQPIsNotReadyToAnswerColon + e);
905
//			}
906
//		}
907
//		if (lang != null)
908
//			return new Locale(lang);
909
//		else
910
//			return Locale.getDefault();
911
//	}
912 912
	
913 913
	/*
914 914
	 * (non-Javadoc)

Formats disponibles : Unified diff