/[schmitzm]/trunk/src/skrueger/swing/TranslationJTextField.java
ViewVC logotype

Diff of /trunk/src/skrueger/swing/TranslationJTextField.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 710 by alfonx, Wed Feb 10 15:04:02 2010 UTC revision 711 by alfonx, Fri Feb 19 01:09:35 2010 UTC
# Line 120  public class TranslationJTextField exten Line 120  public class TranslationJTextField exten
120    
121                          @Override                          @Override
122                          public void actionPerformed(ActionEvent e) {                          public void actionPerformed(ActionEvent e) {
123  //                              LOGGER.debug("ActionListener called ");                                  // LOGGER.debug("ActionListener called ");
124    
125                                  if (e.getSource() == trans)  //                              if (e.getSource() == trans)
126  //                                              && langCode.equals(e.getActionCommand()))  //                              // && langCode.equals(e.getActionCommand()))
127                                                  {  //                              {
128  //                                      LOGGER.debug(" and omittet!\n");  //                                      // LOGGER.debug(" and omittet!\n");
129                                          return;  //                                      return;
130                                  }  //                              }
131                                  LOGGER.debug(" and performed!\n");  //                              LOGGER.debug(" and performed!\n");
132                                  String newString = trans.get(langCode);                                  String newString = trans.get(langCode);
133                                  if (newString == null)                                  if (newString == null)
134                                          newString = "";                                          newString = "";
135                                  if ((newString != null && !newString.equals(getText()))) {                                  if ((newString != null && !newString.equals(getText()))) {
136                                          LOGGER.debug("Setting text to " + newString  //                                      LOGGER.debug("Setting text to " + newString
137                                                          + " becuse oldString was " + getText());  //                                                      + " becuse oldString was " + getText());
138                                          setText(newString);                                          setText(newString);
139                                  }                                  }
140                          }                          }
# Line 180  public class TranslationJTextField exten Line 180  public class TranslationJTextField exten
180                  }                  }
181    
182                  // LOGGER.debug("putting '"+trimmedText+"' into the translation");                  // LOGGER.debug("putting '"+trimmedText+"' into the translation");
183                  trans.put(langCode, trimmedText);                  if (!trimmedText.equals(trans.get(langCode)))
184                            trans.put(langCode, trimmedText);
185          }          }
186    //
187    //      ActionListener listenToChangesOfTheTranslationAndUpdateTheGUI = new ActionListener() {
188    //
189    //              @Override
190    //              public void actionPerformed(ActionEvent e) {
191    //                      if (!hasFocus())
192    //                              translationChangedExternally();
193    //              }
194    //      };
195    //
196    //      /**
197    //       * Call it when the translation object has changed to update the JTextFields
198    //       */
199    //      public void translationChangedExternally() {
200    //              setText(trans.get(langCode));
201    //      }
202    
203  }  }

Legend:
Removed from v.710  
changed lines
  Added in v.711

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26