Revision 434

tmp/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/InstallPluginHandler.java (revision 434)
45 45
		
46 46
		RepositoryDiscoveryStrategy strategy = new RepositoryDiscoveryStrategy();
47 47
		try {
48
			String updateLevel = TXMPreferences.getString(RCPPreferences.PREFERENCES_NODE, RCPPreferences.UPDATE_LEVEL, "STABLE");//$NON-NLS-1$
48
			//FIXME: should be initialized in the default preference initializer
49
			String updateLevel = TXMPreferences.getString(RCPPreferences.UPDATE_LEVEL, null, RCPPreferences.PREFERENCES_NODE, "STABLE");//$NON-NLS-1$
49 50
			boolean alphaMode = false;
50 51
			boolean betaMode = false;
51 52
			boolean devMode = false;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/TXMUpdateHandler.java (revision 434)
197 197
			Log.printStackTrace(e);
198 198
		}
199 199
		
200
		String updateLevel = TXMPreferences.getString(RCPPreferences.PREFERENCES_NODE, RCPPreferences.UPDATE_LEVEL, "STABLE"); //$NON-NLS-1$
200
		//FIXME: should be defined in the preference initializer 
201
		String updateLevel = TXMPreferences.getString(RCPPreferences.UPDATE_LEVEL, null, RCPPreferences.PREFERENCES_NODE, "STABLE");
201 202
		boolean alphaMode = false;
202 203
		boolean betaMode = false;
203 204
		boolean devMode = false;
......
260 261
			Log.severe("Could not add update default repository: " + uriDefault);
261 262
			Log.printStackTrace(e);
262 263
		}
263
		
264
		String updateLevel = TXMPreferences.getString(RCPPreferences.PREFERENCES_NODE, RCPPreferences.UPDATE_LEVEL, "STABLE"); //$NON-NLS-1$
264
		//FIXME: should be defined in the preference initializer 
265
		String updateLevel = TXMPreferences.getString(RCPPreferences.UPDATE_LEVEL, null, RCPPreferences.PREFERENCES_NODE, "STABLE"); //$NON-NLS-1$
265 266
		boolean alphaMode = false;
266 267
		boolean betaMode = false;
267 268
		boolean devMode = false;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/testers/ExpertEnabled.java (revision 434)
13 13
	public boolean test(Object receiver, String property, Object[] args,
14 14
			Object expectedValue) {
15 15

  
16
		boolean expert = TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.EXPERT_USER);
16
		boolean expert = TXMPreferences.getBoolean(TBXPreferences.EXPERT_USER, TBXPreferences.PREFERENCES_NODE);
17 17
		//System.out.println("IS expert enabled: "+expert);
18 18
		return expert;
19 19
	}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java (revision 434)
52 52
public abstract class JobHandler extends Job implements ProgressWatcher {
53 53

  
54 54
	/** The parent. */
55
	//Composite parent;
56 55
	IProgressMonitor currentMonitor;
57 56

  
58 57
	protected Thread myThread = null;
......
92 91
	}
93 92

  
94 93
	@Override
94
	public void subTask(String name) {
95
		if (currentMonitor != null) {
96
			currentMonitor.subTask(name);
97
		}
98
	}
99

  
100
	
101
	@Override
95 102
	public void worked(int amount) {
96 103
		if (currentMonitor != null) {
97 104
			currentMonitor.worked(amount);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/RCPPreferences.java (revision 434)
8 8
public class RCPPreferences extends TXMPreferences {
9 9

  
10 10
	/** The Constant SORTBYFREQ. */
11
	//FIXME: to extract to referencer plug-in
11 12
	public static final String SORTBYFREQ = "referencer_sorttype"; //$NON-NLS-1$
12 13

  
13 14
	/** The Constant UI_LOCALE. */
......
62 63
		preferences.put(TBXPreferences.EXPORT_ENCODING, System.getProperty("file.encoding")); //$NON-NLS-1$
63 64
		preferences.put(TBXPreferences.EXPORT_COLSEPARATOR, "\t"); //$NON-NLS-1$
64 65
		preferences.put(TBXPreferences.EXPORT_TXTSEPARATOR, ""); //$NON-NLS-1$
65

  
66
		preferences.put(RCPPreferences.UI_LOCALE, "en"); //$NON-NLS-1$
67
		
66 68
		preferences.putBoolean(AUTO_UPDATE_EDITOR, false);
67 69
		preferences.putBoolean(SHOW_SEVERE_DIALOG, false);
68 70
		preferences.putBoolean(USER_ALERT_DELETE, false);
......
70 72
		
71 73
		preferences.putInt(RCPPreferences.NO_SESSION, 1);
72 74
		
75
		
73 76
		preferences.put(ANNOTATION_MODE, "simple"); //$NON-NLS-1$
74 77

  
75 78
	}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java (revision 434)
89 89
			i++;
90 90
		}
91 91

  
92
		if (TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_ENCODING) == null)
93
			TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_ENCODING, "UTF-8"); //$NON-NLS-1$
94
		if (TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_COLSEPARATOR) == null)
95
			TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_COLSEPARATOR, ","); //$NON-NLS-1$
92
//		if (TXMPreferences.getString(TBXPreferences.METADATA_ENCODING, TBXPreferences.PREFERENCES_NODE) == null)
93
//			TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_ENCODING, "UTF-8"); //$NON-NLS-1$
94
//		if (TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_COLSEPARATOR) == null)
95
//			TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.METADATA_COLSEPARATOR, ","); //$NON-NLS-1$
96 96
//		if (TxmPreferences.get(METADATA_TXTSEPARATOR) == null) {
97 97
//			System.out.println("SET DEFAULT VALUE FOR METADATA_TEXTSEPARATOR");
98 98
//			TxmPreferences.set(METADATA_TXTSEPARATOR, "\""); //$NON-NLS-1$
......
115 115
		csvMetadataGroup.setLayout(gridlayout);
116 116
		
117 117
		
118
		encoding = new ComboFieldEditor(TBXPreferences.METADATA_ENCODING,
119
				Messages.ImportPreferencePage_0, values, csvMetadataGroup);
118
		encoding = new ComboFieldEditor(TBXPreferences.METADATA_ENCODING, Messages.ImportPreferencePage_0, values, csvMetadataGroup);
120 119
		addField(encoding);
121 120
		
122 121
		String[][] cols = {{"TAB","\t"}, {",", ","}, {";", ";"}}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
123 122
		String txts[][] = {{"none", ""}, {"\"", "\""}, {"'", "'"}}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
124
		colseparators = new ComboFieldEditor(TBXPreferences.METADATA_COLSEPARATOR,
125
				Messages.ExportPreferencePage_18, cols, csvMetadataGroup);
123
		colseparators = new ComboFieldEditor(TBXPreferences.METADATA_COLSEPARATOR, Messages.ExportPreferencePage_18, cols, csvMetadataGroup);
126 124
		addField(colseparators);
127 125

  
128
		txtseparators = new ComboFieldEditor(TBXPreferences.METADATA_TXTSEPARATOR,
129
				Messages.ExportPreferencePage_19, txts, csvMetadataGroup);
126
		txtseparators = new ComboFieldEditor(TBXPreferences.METADATA_TXTSEPARATOR, Messages.ExportPreferencePage_19, txts, csvMetadataGroup);
130 127
		addField(txtseparators);
131 128
		
132 129
		Group langGroup = new Group(getFieldEditorParent(), SWT.NONE);
......
139 136
		rlayout.marginHeight = 5;
140 137
		langGroup.setLayout(rlayout);
141 138
		
142
		defaultlang = new StringFieldEditor(TBXPreferences.IMPORT_DEFAULT_LANG,
143
				Messages.ImportPreferencePage_4, langGroup);
139
		defaultlang = new StringFieldEditor(TBXPreferences.IMPORT_DEFAULT_LANG, Messages.ImportPreferencePage_4, langGroup);
144 140
		defaultlang.setEmptyStringAllowed(false);
145 141
		
146 142
		Label l = new Label(langGroup, SWT.NONE);
......
150 146
		l.setLayoutData(ldata);
151 147
		addField(defaultlang);
152 148
		
153
		empty_code = new StringFieldEditor(TBXPreferences.CQP_EMPTY_VALUE_CODE,
154
				"Empty property value code", getFieldEditorParent());
149
		empty_code = new StringFieldEditor(TBXPreferences.CQP_EMPTY_VALUE_CODE, "Empty property value code", getFieldEditorParent());
155 150
		addField(empty_code);
156 151
		
157 152
	}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/TXMMainPreferencePage.java (revision 434)
205 205
//		addField(buttonImport);
206 206

  
207 207
		// disable if expert user
208
		if (!TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.EXPERT_USER)) {
208
		if (!TXMPreferences.getBoolean(TBXPreferences.EXPERT_USER, TBXPreferences.PREFERENCES_NODE)) {
209 209
			Group updateGroup = new Group(getFieldEditorParent(), SWT.NONE);
210 210
			updateGroup.setText(Messages.TextometriePreferencePage_2);
211 211
			GridData gridData2 = new GridData(SWT.FILL, SWT.FILL, true, false);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/objectexplorer/ObjectExplorer.java (revision 434)
51 51
import org.eclipse.ui.IEditorSite;
52 52
import org.eclipse.ui.PartInitException;
53 53
import org.eclipse.ui.part.EditorPart;
54
import org.txm.core.results.ITXMResult;
54
import org.txm.core.results.TXMResult;
55 55
import org.txm.objects.TxmObject;
56 56
import org.txm.rcp.Messages;
57 57
import org.txm.rcp.commands.editor.CustomizableEditor;
......
227 227
					if (!dlg.getValue().matches("")) //$NON-NLS-1$
228 228
					{
229 229
						// System.out.println("add ok");
230
						for (ITXMResult o : txmObject.getResults()) {
230
						for (TXMResult o : txmObject.getResults()) {
231 231
							if (!((TxmObject) o).getMetadatas().keySet().contains(dlg.getValue()))
232 232
								((TxmObject) o).setAttribute(dlg.getValue(),
233 233
										Messages.ObjectExplorer_9);
......
258 258
					if (!dlg.getValue().matches("")) //$NON-NLS-1$
259 259
					{
260 260
						// System.out.println("rmv ok");
261
						for (ITXMResult o : txmObject.getResults()) {
261
						for (TXMResult o : txmObject.getResults()) {
262 262
							((TxmObject) o).removeProperty(dlg.getValue());
263 263
						}
264 264
						int columnindex = columnsName.indexOf(dlg.getValue());
......
310 310
		TxmObject o = (TxmObject) txmObject.getResults().get(0);
311 311
		for (String key : o.getMetadatas().keySet()) {
312 312
			columnsName.add(key);
313
			for (ITXMResult o2 : txmObject.getResults()) {
313
			for (TXMResult o2 : txmObject.getResults()) {
314 314
				if (!((TxmObject) o2).getMetadatas().containsKey(key)) {
315 315
					columnsName.remove(key);
316 316
					break;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 434)
1011 1011
		} else if (lastOpenedSrcDir != null) {
1012 1012
			dialog.setFilterPath(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
1013 1013
		} else
1014
			dialog.setFilterPath(new File(TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR), "corpora").getAbsolutePath()); //$NON-NLS-1$
1014
			dialog.setFilterPath(new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE), "corpora").getAbsolutePath()); //$NON-NLS-1$
1015 1015

  
1016 1016
		if (dialog.open() != null) {
1017 1017
			String path = dialog.getFilterPath();
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/LastOpened.java (revision 434)
25 25
	}
26 26
	
27 27
	public static String getFolder(String ID) {
28
		return TXMPreferences.getString(PREFERENCES_NODE, ID+FOLDER);
28
		return TXMPreferences.getString(ID+FOLDER, PREFERENCES_NODE);
29 29
	}
30 30
	
31 31
	public static String getFile(String ID) {
32
		return TXMPreferences.getString(PREFERENCES_NODE, ID+FILE);
32
		return TXMPreferences.getString(ID+FILE, PREFERENCES_NODE);
33 33
	}
34 34
}

Also available in: Unified diff