Révision 3878

TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/preferences/TreeSearchPreferences.java (revision 3878)
11 11
 */
12 12
public class TreeSearchPreferences extends TXMPreferences {
13 13
	
14
	public static final String VERSION = "version";
14
	public static final String VERSION = "version"; //$NON-NLS-1$
15 15
	
16
	public static final String DEFAULT_VISUALISATION = "default_representation";
16
	public static final String DEFAULT_VISUALISATION = "default_representation"; //$NON-NLS-1$
17 17
	
18
	public static final String TFEATURE = "t";
18
	public static final String TFEATURE = "t"; //$NON-NLS-1$
19 19
	
20
	public static final String NTFEATURE = "nt";
20
	public static final String NTFEATURE = "nt"; //$NON-NLS-1$
21 21

  
22
	public static final String VISUALISATION = "visualisation";
22
	public static final String VISUALISATION = "visualisation"; //$NON-NLS-1$
23 23

  
24
	public static String BACKTOTREE_POSITION = "linked_editor_position";
24
	public static String BACKTOTREE_POSITION = "linked_editor_position"; //$NON-NLS-1$
25 25
	
26 26
	/**
27 27
	 * Gets the instance.
......
40 40
		super.initializeDefaultPreferences();
41 41
		
42 42
		Preferences preferences = this.getDefaultPreferencesNode();
43
		preferences.put(DEFAULT_VISUALISATION, "TIGER");
44
		preferences.put(TFEATURE, "word");
45
		preferences.put(NTFEATURE, "cat");
46
		preferences.put(VISUALISATION, ""); // no supplementary visualisation
43
		preferences.put(DEFAULT_VISUALISATION, "TIGER"); //$NON-NLS-1$
44
		preferences.put(TFEATURE, "word"); //$NON-NLS-1$
45
		preferences.put(NTFEATURE, "cat"); //$NON-NLS-1$
46
		preferences.put(VISUALISATION, ""); // no supplementary visualisation //$NON-NLS-1$
47 47
		preferences.putInt(BACKTOTREE_POSITION, 0);
48 48
	}
49 49
}
TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java (revision 3878)
83 83
		if (pQuery != null) {
84 84
			return pQuery.toString();
85 85
		}
86
		return "no query";
86
		return Messages.noQuery;
87 87
	}
88 88

  
89 89
	@Override
......
92 92
		if (pQuery != null) {
93 93
			return pQuery.toString();
94 94
		}
95
		return "no query";
95
		return Messages.noQuery;
96 96
	}
97 97

  
98 98
	public abstract int getNMatchingSentences();
......
113 113
		if (pQuery != null) {
114 114
			return pQuery.toString();
115 115
		}
116
		return "no query";
116
		return Messages.noQuery;
117 117
	}
118 118

  
119 119
	public String getComputingStartMessage() {
120 120
		
121
		return NLS.bind("Rendering {0} Syntactic Tree...", this.getSelector().getEngine());
121
		return NLS.bind(Messages.renderingP0SyntacticTree, this.getSelector().getEngine());
122 122
	}
123 123

  
124 124
	public String getComputingDoneMessage() {
......
126 126
		int n = this.getNMatchingSentences();
127 127
		
128 128
		if (n > 0) {
129
			return ""+n+" matching sentence"+(n > 1?"s":"");
129
			return ""+n+Messages.P0matchingSentenceP1+(n > 1?"s":""); //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-4$
130 130
		} else {
131
			return "No matching sentence.";
131
			return Messages.noMatchingSentence;
132 132
		}
133 133
	}
134 134

  
......
145 145
		String values = getStringParameterValue(TreeSearchPreferences.TFEATURE);
146 146

  
147 147
		if (values != null && !values.isEmpty() && values.length() > 0) {
148
			this.T.addAll(Arrays.asList(values.split(",")));
148
			this.T.addAll(Arrays.asList(values.split(","))); //$NON-NLS-1$
149 149
		}
150 150

  
151 151
		this.NT = new ArrayList<>();
152 152
		values = getStringParameterValue(TreeSearchPreferences.TFEATURE);
153 153

  
154 154
		if (values != null && !values.isEmpty() && values.length() > 0) {
155
			this.NT.addAll(Arrays.asList(values.split(",")));
155
			this.NT.addAll(Arrays.asList(values.split(","))); //$NON-NLS-1$
156 156
		}
157 157

  
158 158
		String squery = getStringParameterValue(TreeSearchPreferences.QUERY);
......
170 170
			this.saveParameter(TreeSearchPreferences.QUERY, IQuery.toPrefString(pQuery));
171 171
		}
172 172

  
173
		this.saveParameter(TreeSearchPreferences.TFEATURE, StringUtils.join(this.T, ","));
173
		this.saveParameter(TreeSearchPreferences.TFEATURE, StringUtils.join(this.T, ",")); //$NON-NLS-1$
174 174

  
175
		this.saveParameter(TreeSearchPreferences.NTFEATURE, StringUtils.join(this.NT, ","));
175
		this.saveParameter(TreeSearchPreferences.NTFEATURE, StringUtils.join(this.NT, ",")); //$NON-NLS-1$
176 176

  
177 177
		return true;
178 178
	}
TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/function/Messages.java (revision 3878)
1
package org.txm.treesearch.function;
2

  
3
import org.eclipse.osgi.util.NLS;
4

  
5
public class Messages extends NLS {
6
	
7
	private static final String BUNDLE_NAME = Messages.class.getPackageName() + ".messages"; //$NON-NLS-1$
8
	
9
	public static String noMatchingSentence;
10
	
11
	public static String noQuery;
12
	
13
	public static String P0matchingSentenceP1;
14
	
15
	public static String renderingP0SyntacticTree;
16
	static {
17
		// initialize resource bundle
18
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
19
	}
20
	
21
	private Messages() {}
22
}
0 23

  
TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/function/messages.properties (revision 3878)
1
noMatchingSentence=No matching sentence.
2
noQuery=no query
3
P0matchingSentenceP1=\ matching sentence
4
renderingP0SyntacticTree=Rendering {0} Syntactic Tree...
0 5

  

Formats disponibles : Unified diff