1 package com.nilhcem.fakesmtp.gui;
2
3 import com.nilhcem.fakesmtp.core.I18n;
4 import com.nilhcem.fakesmtp.gui.listeners.AboutActionListener;
5 import com.nilhcem.fakesmtp.gui.listeners.ExitActionListener;
6 import java.awt.MenuItem;
7 import java.awt.PopupMenu;
8
9
10
11
12
13
14
15 public class TrayPopup {
16
17 private final I18n i18n = I18n.INSTANCE;
18 private final PopupMenu popup = new PopupMenu();
19
20
21
22
23
24
25 public TrayPopup(final MainFrame mainFrame) {
26
27 MenuItem aboutItem = new MenuItem(i18n.get("menubar.about"));
28 aboutItem.addActionListener(new AboutActionListener(null));
29
30 MenuItem exitItem = new MenuItem(i18n.get("menubar.exit"));
31 exitItem.addActionListener(new ExitActionListener(mainFrame));
32
33 popup.add(aboutItem);
34 popup.addSeparator();
35 popup.add(exitItem);
36 }
37
38
39
40
41
42
43 public PopupMenu get() {
44 return popup;
45 }
46 }