| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
package org.homeunix.thecave.buddi.view.menu.items; |
| 5 | |
|
| 6 | |
import java.awt.Toolkit; |
| 7 | |
import java.awt.event.ActionEvent; |
| 8 | |
import java.awt.event.KeyEvent; |
| 9 | |
|
| 10 | |
import javax.swing.KeyStroke; |
| 11 | |
|
| 12 | |
import org.homeunix.thecave.buddi.i18n.keys.MenuKeys; |
| 13 | |
import org.homeunix.thecave.buddi.model.Document; |
| 14 | |
import org.homeunix.thecave.buddi.model.prefs.PrefsModel; |
| 15 | |
import org.homeunix.thecave.buddi.view.MainFrame; |
| 16 | |
import org.homeunix.thecave.buddi.view.dialogs.AccountEditorDialog; |
| 17 | |
|
| 18 | |
import ca.digitalcave.moss.swing.MossMenuItem; |
| 19 | |
import ca.digitalcave.moss.swing.exception.WindowOpenException; |
| 20 | |
|
| 21 | |
public class EditNewAccount extends MossMenuItem { |
| 22 | |
public static final long serialVersionUID = 0; |
| 23 | |
|
| 24 | |
public EditNewAccount(MainFrame frame) { |
| 25 | 29974 | super(frame, PrefsModel.getInstance().getTranslator().get(MenuKeys.MENU_EDIT_NEW_ACCOUNT), |
| 26 | |
KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + KeyEvent.SHIFT_MASK)); |
| 27 | 29974 | } |
| 28 | |
|
| 29 | |
@Override |
| 30 | |
public void actionPerformed(ActionEvent e) { |
| 31 | 0 | AccountEditorDialog editor = new AccountEditorDialog((MainFrame) getFrame(), (Document) ((MainFrame) getFrame()).getDocument(), null); |
| 32 | |
try { |
| 33 | 0 | editor.openWindow(); |
| 34 | |
} |
| 35 | 0 | catch (WindowOpenException woe){} |
| 36 | |
|
| 37 | 0 | ((MainFrame) getFrame()).fireStructureChanged(); |
| 38 | 0 | ((MainFrame) getFrame()).updateContent(); |
| 39 | 0 | } |
| 40 | |
} |