Révision 1260

tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java (revision 1260)
10 10
import java.util.Map;
11 11
import java.util.TreeSet;
12 12

  
13
import org.txm.rcp.translate.devtools.NormalizeKeys;
14
import org.txm.utils.io.IOUtils;
15

  
16 13
/**
17 14
 * Manages the messages of the TXM projects of an RCP workspace
18 15
 * 
......
21 18
 */
22 19
public class WorkspaceMessagesManager {
23 20

  
24
	boolean debug = false;
21
	/**
22
	 * Debug state.
23
	 */
24
	protected boolean debug = false;
25 25

  
26 26
	LinkedHashMap<File, PluginMessages> pluginsMessagesPerProject = new LinkedHashMap<File, PluginMessages>();
27 27

  
......
35 35

  
36 36

  
37 37

  
38
	
38 39
	/**
40
	 * 
41
	 * @throws UnsupportedEncodingException
42
	 * @throws FileNotFoundException
43
	 * @throws IOException
44
	 */
45
	public WorkspaceMessagesManager() throws UnsupportedEncodingException, FileNotFoundException, IOException {
46
		this(false);
47
	}
48
	
49
	/**
39 50
	 * Creates the manager using the "user.dir" parent directory -> works when run from Eclipse
40 51
	 * @throws IOException 
41 52
	 * @throws FileNotFoundException 
42 53
	 * @throws UnsupportedEncodingException 
43 54
	 */
44
	public WorkspaceMessagesManager() throws UnsupportedEncodingException, FileNotFoundException, IOException {
45
		this(new File(System.getProperty("user.dir")).getParentFile());
55
	public WorkspaceMessagesManager(boolean debug) throws UnsupportedEncodingException, FileNotFoundException, IOException {
56
		this(new File(System.getProperty("user.dir")).getParentFile(), debug);
46 57
	}
47 58

  
48

  
49

  
50 59
	/**
51 60
	 * 
52 61
	 * @param workspaceLocation
......
54 63
	 * @throws FileNotFoundException
55 64
	 * @throws IOException
56 65
	 */
57
	public WorkspaceMessagesManager(File workspaceLocation) throws UnsupportedEncodingException, FileNotFoundException, IOException {
66
	public WorkspaceMessagesManager(File workspaceLocation, boolean debug) throws UnsupportedEncodingException, FileNotFoundException, IOException {
58 67

  
59 68
		this.workspaceLocation = workspaceLocation;
60

  
69
		this.debug = debug;
70
		
61 71
		if (debug) {
62 72
			System.out.println("WorkspaceMessagesManager.WorkspaceMessagesManager(): workspace location = " + this.workspaceLocation);
63 73
		}
......
79 89
					if (messagesJavaFile.isDirectory()) continue;
80 90
					if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
81 91

  
82
					PluginMessages messages = new PluginMessages(project, messagesJavaFile);
92
					PluginMessages messages = new PluginMessages(project, messagesJavaFile, debug);
83 93

  
84 94
					pluginsMessagesPerProject.put(project, messages);
85 95

  

Formats disponibles : Unified diff