200 |
} |
} |
201 |
|
|
202 |
/** |
/** |
203 |
* Called when the dilaog is closed using the cancel button. |
* Called when the dilaog is closed using the cancel button. When |
204 |
|
* overwriting this method, call super.cancel() after restoring your |
205 |
|
* properties. |
206 |
*/ |
*/ |
207 |
protected void cancel() { |
public void cancel() { |
208 |
restore(); |
restore(); |
209 |
firePropertyChange(PROPERTY_CANCEL_AND_CLOSE, null, null); |
firePropertyChange(PROPERTY_CANCEL_AND_CLOSE, null, null); |
210 |
setCancelled(true); |
setCancelled(true); |
215 |
/** |
/** |
216 |
* Used to restore all the values when cancel has been pressed. |
* Used to restore all the values when cancel has been pressed. |
217 |
*/ |
*/ |
218 |
protected void restore() { |
private void restore() { |
219 |
int count = 0; |
int count = 0; |
220 |
for (JComponent component : translationEditJPanelsOrJustComponents) { |
for (JComponent component : translationEditJPanelsOrJustComponents) { |
221 |
if (component instanceof TranslationEditJPanel) { |
if (component instanceof TranslationEditJPanel) { |
271 |
if (cancelButton == null) { |
if (cancelButton == null) { |
272 |
cancelButton = new CancelButton(new AbstractAction("") { |
cancelButton = new CancelButton(new AbstractAction("") { |
273 |
public void actionPerformed(ActionEvent evt) { |
public void actionPerformed(ActionEvent evt) { |
274 |
// restore(); |
// restore(); |
275 |
// TranslationAskJDialog.this.firePropertyChange( |
// TranslationAskJDialog.this.firePropertyChange( |
276 |
// PROPERTY_CANCEL_AND_CLOSE, null, null); |
// PROPERTY_CANCEL_AND_CLOSE, null, null); |
277 |
// setVisible(false); |
// setVisible(false); |
278 |
// setCancelled(true); |
// setCancelled(true); |
279 |
// dispose(); |
// dispose(); |
280 |
cancel(); |
cancel(); |
281 |
} |
} |
282 |
}); |
}); |