Révision 1057

tmp/org.txm.links.rcp/src/org/txm/links/rcp/messages/Messages.java (revision 1057)
1
package org.txm.links.rcp.messages;
2

  
3
import org.eclipse.osgi.util.NLS;
4
import org.txm.utils.messages.Utf8NLS;
5

  
6
public class Messages extends NLS {
7
	
8
	private static final String BUNDLE_NAME = "org.txm.links.rcp.handlers.messages"; //$NON-NLS-1$
9
	
10
	public static String link_error_no_match;
11
	public static String link_error_no_query;
12
	
13
	static {
14
		// initialize resource bundle
15
		Utf8NLS.initializeMessages(BUNDLE_NAME, Messages.class);
16
	}
17

  
18
	private Messages() { }
19
}
0 20

  
tmp/org.txm.links.rcp/src/org/txm/links/rcp/messages/messages.properties (revision 1057)
1
link_error_no_match=No matches was set, command canceled.
2
link_error_no_query=No query was set, command canceled.
0 3

  
tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java (revision 1057)
35 35
import org.txm.core.results.TXMResult;
36 36
import org.txm.rcp.handlers.BaseAbstractHandler;
37 37
import org.txm.utils.logger.Log;
38
import org.txm.links.rcp.messages.Messages;
38 39

  
39 40
/**
40 41
 * Base command to send a selection to a command that needs one or more queries to compute the new result.
......
75 76
			String queries = this.createQueries(event, selection);
76 77
			
77 78
			if(query.isEmpty() && queries.isEmpty()) {
78
				Log.severe("No query was set, command canceled.");
79
				Log.severe(Messages.link_error_no_query);
79 80
				return null;
80 81
			}
81 82
			
tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java (revision 1057)
38 38
import org.txm.rcp.handlers.BaseAbstractHandler;
39 39
import org.txm.searchengine.cqp.corpus.query.Match;
40 40
import org.txm.utils.logger.Log;
41
import org.txm.links.rcp.messages.Messages;
41 42

  
42 43
/**
43 44
 * Base command to send a selection to a command that needs a query to compute the new result.
......
48 49
 */
49 50
public abstract class SendSelectionToMatchable extends BaseAbstractHandler {
50 51

  
51
	
52

  
53 52
	/**
54 53
	 * Creates the queries.
55 54
	 * This method is essentially dedicated to be overridden, if needed.
......
67 66
			List<Match> matches = this.createMatches(event, selection);
68 67
			
69 68
			if(matches.isEmpty()) {
70
				Log.severe("No matches was set, command canceled.");
69
				Log.severe(Messages.link_error_no_match);
71 70
				return null;
72 71
			}
73 72
			

Formats disponibles : Unified diff