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

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

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

revision 292 by alfonx, Wed Aug 5 12:34:15 2009 UTC revision 298 by alfonx, Tue Aug 11 12:18:00 2009 UTC
# Line 72  public class TranslationEditJPanel exten Line 72  public class TranslationEditJPanel exten
72          /**          /**
73           * Remembers all {@link JTextField} that have been created.           * Remembers all {@link JTextField} that have been created.
74           */           */
75          private Set<JTextField> langTextFields = new HashSet<JTextField>();           private Set<TranslationJTextField> langTextFields = new HashSet<TranslationJTextField>();
   
76          private WeakHashMap<ActionListener, ActionListener> actionListeners = new WeakHashMap<ActionListener, ActionListener>();          private WeakHashMap<ActionListener, ActionListener> actionListeners = new WeakHashMap<ActionListener, ActionListener>();
77    
78          /**          /**
# Line 107  public class TranslationEditJPanel exten Line 106  public class TranslationEditJPanel exten
106                                          .setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));                                          .setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
107                          add(questionLable, BorderLayout.NORTH);                          add(questionLable, BorderLayout.NORTH);
108                  }                  }
109    
110                    /**
111                     * Add listeners
112                     */
113            }
114    
115            /**
116             * Creates a {@link JPanel} that asks the user for the translation of a
117             * String in several languages and additionally puts a {@link JLabel} with a
118             * question at the {@link JPanel}'s first row.
119             *
120             * <br/>
121             * This constructor also sets a TitledBorder with the given title.
122             */
123            public TranslationEditJPanel(Translation title, List<String> languages2,
124                            String borderTitle) {
125                    this(title, languages2);
126    
127                    setBorder(BorderFactory.createTitledBorder(borderTitle));
128          }          }
129    
130          private JPanel getTranslationGrid() {          private JPanel getTranslationGrid() {
# Line 128  public class TranslationEditJPanel exten Line 146  public class TranslationEditJPanel exten
146                                  translationGrid.add(langDesc);                                  translationGrid.add(langDesc);
147                                  translationGrid.add(langTextField);                                  translationGrid.add(langTextField);
148    
149                                  langTextFields.add(langTextField);                                   langTextFields.add(langTextField);
150                          }                          }
151    
152                          // Lay out the panel.                          // Lay out the panel.
# Line 149  public class TranslationEditJPanel exten Line 167  public class TranslationEditJPanel exten
167                  return trans;                  return trans;
168          }          }
169    
170            /**
171             * TODO Is never called?!
172             */
173            public void dispose() {
174                    for (TranslationJTextField f: langTextFields) {
175                            f.dispose();
176                    }
177            }
178    
179          public void addTranslationChangeListener(final ActionListener al) {          public void addTranslationChangeListener(final ActionListener al) {
180                  final ActionListener actionListener = new ActionListener() {                  final ActionListener actionListener = new ActionListener() {
181    

Legend:
Removed from v.292  
changed lines
  Added in v.298

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26