Index: maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/ui/KeysModifier.java diff -u maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/ui/KeysModifier.java:1.4 maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/ui/KeysModifier.java:1.5 --- maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/ui/KeysModifier.java:1.4 Fri Nov 2 15:20:04 2007 +++ maven-i18n-plugin/src/java/org/codelutin/i18n/plugin/ui/KeysModifier.java Fri Nov 2 16:06:37 2007 @@ -1,3 +1,22 @@ +/* *##% + * Copyright (C) 2007 + * I18nPlugin, Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + package org.codelutin.i18n.plugin.ui; import java.awt.Container; @@ -23,6 +42,13 @@ import org.codelutin.i18n.plugin.core.ParserException; import org.codelutin.util.FileUtil; +/** + * IHM permettant de modifier les clés de traduction en direct dans les fichiers + * parsés et les fichiers de propriétés. + * + * @author julien + * + */ public class KeysModifier extends JFrame implements ParserEvent { private static final long serialVersionUID = 1L; @@ -38,6 +64,11 @@ protected JTextField key = new JTextField(); protected JButton next = new JButton("Next >>"); + /** + * Contructeur + * @param patternLeft + * @param patternRight + */ public KeysModifier(String patternLeft, String patternRight) { this.patternLeft = patternLeft; this.patternRight = patternRight; @@ -72,6 +103,10 @@ setVisible(true); } + /* + * (non-Javadoc) + * @see org.codelutin.i18n.plugin.core.ParserEvent#eventChangeFile(java.io.File) + */ public void eventChangeFile(File file) { name.setText(file.getName()); path.setText(file.getPath()); @@ -81,6 +116,10 @@ newKeys = new ArrayList(); } + /* + * (non-Javadoc) + * @see org.codelutin.i18n.plugin.core.ParserEvent#eventNextFile(java.io.File) + */ public void eventNextFile(File file) { if(!newKeys.isEmpty()) { String content = ""; @@ -111,6 +150,10 @@ } } + /* + * (non-Javadoc) + * @see org.codelutin.i18n.plugin.core.ParserEvent#eventChangeKey(java.lang.String) + */ public synchronized void eventChangeKey(String keyI18n) { key.setText(keyI18n); newKeys.add(key.getText()); @@ -124,17 +167,27 @@ } } + /* + * (non-Javadoc) + * @see org.codelutin.i18n.plugin.core.ParserEvent#eventGetRealKey() + */ public String eventGetRealKey() { newKeys.add(key.getText()); return key.getText(); } + /** + * Action sur le boutton pour passer à la clé suivante + */ class EventNextKey implements ActionListener { public void actionPerformed(ActionEvent e) { eventNextKey(); } } + /** + * Action sur la fermeture de la frame + */ class EventWindows implements WindowListener { public void windowClosed(WindowEvent e) {} @@ -150,6 +203,9 @@ } + /** + * Permet de passer à la clé suivante + */ public synchronized void eventNextKey() { notifyAll(); }