import be.nikiroo.fanfix.library.MetaResultList;
import be.nikiroo.fanfix_swing.gui.BooksPanelActions;
import be.nikiroo.fanfix_swing.gui.BooksPanelActions.ChangeAction;
+import be.nikiroo.fanfix_swing.gui.MainFrame;
import be.nikiroo.fanfix_swing.gui.utils.UiHelper;
public class BookPopup extends JPopupMenu {
* @return the item
*/
private JMenuItem createMenuItemExport() {
- JMenuItem export = new JMenuItem(trans(StringIdGui.MENU_FILE_EXPORT),
- KeyEvent.VK_S);
+ JMenuItem export = new JMenuItem(
+ MainFrame.trans(StringIdGui.MENU_FILE_EXPORT), KeyEvent.VK_S);
export.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
*/
private JMenuItem createMenuItemClearCache() {
JMenuItem refresh = new JMenuItem(
- trans(StringIdGui.MENU_EDIT_CLEAR_CACHE), KeyEvent.VK_C);
+ MainFrame.trans(StringIdGui.MENU_EDIT_CLEAR_CACHE),
+ KeyEvent.VK_C);
refresh.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
groupedSources = new HashMap<String, List<String>>();
}
- JMenu changeTo = new JMenu(trans(StringIdGui.MENU_FILE_MOVE_TO));
+ JMenu changeTo = new JMenu(
+ MainFrame.trans(StringIdGui.MENU_FILE_MOVE_TO));
changeTo.setMnemonic(KeyEvent.VK_M);
JMenuItem item = new JMenuItem(
- trans(StringIdGui.MENU_FILE_MOVE_TO_NEW_TYPE));
+ MainFrame.trans(StringIdGui.MENU_FILE_MOVE_TO_NEW_TYPE));
item.addActionListener(createMoveAction(ChangeAction.SOURCE, null));
changeTo.add(item);
changeTo.addSeparator();
groupedAuthors = new HashMap<String, List<String>>();
}
- JMenu changeTo = new JMenu(trans(StringIdGui.MENU_FILE_SET_AUTHOR));
+ JMenu changeTo = new JMenu(
+ MainFrame.trans(StringIdGui.MENU_FILE_SET_AUTHOR));
changeTo.setMnemonic(KeyEvent.VK_A);
// New author
JMenuItem newItem = new JMenuItem(
- trans(StringIdGui.MENU_FILE_MOVE_TO_NEW_AUTHOR));
+ MainFrame.trans(StringIdGui.MENU_FILE_MOVE_TO_NEW_AUTHOR));
changeTo.add(newItem);
changeTo.addSeparator();
newItem.addActionListener(createMoveAction(ChangeAction.AUTHOR, null));
JMenu group = new JMenu(key);
for (String value : groupedAuthors.get(key)) {
JMenuItem item = new JMenuItem(value.isEmpty()
- ? trans(StringIdGui.MENU_AUTHORS_UNKNOWN)
+ ? MainFrame.trans(StringIdGui.MENU_AUTHORS_UNKNOWN)
: value);
item.addActionListener(
createMoveAction(ChangeAction.AUTHOR, value));
} else if (groupedAuthors.size() == 1) {
for (String value : groupedAuthors.values().iterator().next()) {
JMenuItem item = new JMenuItem(value.isEmpty()
- ? trans(StringIdGui.MENU_AUTHORS_UNKNOWN)
+ ? MainFrame.trans(StringIdGui.MENU_AUTHORS_UNKNOWN)
: value);
item.addActionListener(
createMoveAction(ChangeAction.AUTHOR, value));
* @return the item
*/
private JMenuItem createMenuItemRename() {
- JMenuItem changeTo = new JMenuItem(trans(StringIdGui.MENU_FILE_RENAME));
+ JMenuItem changeTo = new JMenuItem(
+ MainFrame.trans(StringIdGui.MENU_FILE_RENAME));
changeTo.setMnemonic(KeyEvent.VK_R);
changeTo.addActionListener(createMoveAction(ChangeAction.TITLE, null));
return changeTo;
*/
private JMenuItem createMenuItemRedownload() {
JMenuItem refresh = new JMenuItem(
- trans(StringIdGui.MENU_EDIT_REDOWNLOAD), KeyEvent.VK_R);
+ MainFrame.trans(StringIdGui.MENU_EDIT_REDOWNLOAD),
+ KeyEvent.VK_R);
refresh.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
*/
private JMenuItem createMenuItemDownloadToCache() {
JMenuItem refresh = new JMenuItem(
- trans(StringIdGui.MENU_EDIT_DOWNLOAD_TO_CACHE), KeyEvent.VK_T);
+ MainFrame.trans(StringIdGui.MENU_EDIT_DOWNLOAD_TO_CACHE),
+ KeyEvent.VK_T);
refresh.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
* @return the item
*/
private JMenuItem createMenuItemDelete() {
- JMenuItem delete = new JMenuItem(trans(StringIdGui.MENU_EDIT_DELETE),
- KeyEvent.VK_D);
+ JMenuItem delete = new JMenuItem(
+ MainFrame.trans(StringIdGui.MENU_EDIT_DELETE), KeyEvent.VK_D);
delete.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
*/
private JMenuItem createMenuItemProperties() {
JMenuItem delete = new JMenuItem(
- trans(StringIdGui.MENU_FILE_PROPERTIES), KeyEvent.VK_P);
+ MainFrame.trans(StringIdGui.MENU_FILE_PROPERTIES),
+ KeyEvent.VK_P);
delete.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
* @return the item
*/
public JMenuItem createMenuItemOpenBook() {
- JMenuItem open = new JMenuItem(trans(StringIdGui.MENU_FILE_OPEN),
- KeyEvent.VK_O);
+ JMenuItem open = new JMenuItem(
+ MainFrame.trans(StringIdGui.MENU_FILE_OPEN), KeyEvent.VK_O);
open.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
*/
private JMenuItem createMenuItemSetCoverForSource() {
JMenuItem open = new JMenuItem(
- trans(StringIdGui.MENU_EDIT_SET_COVER_FOR_SOURCE),
+ MainFrame.trans(StringIdGui.MENU_EDIT_SET_COVER_FOR_SOURCE),
KeyEvent.VK_C);
open.addActionListener(new ActionListener() {
@Override
*/
private JMenuItem createMenuItemSetCoverForAuthor() {
JMenuItem open = new JMenuItem(
- trans(StringIdGui.MENU_EDIT_SET_COVER_FOR_AUTHOR),
+ MainFrame.trans(StringIdGui.MENU_EDIT_SET_COVER_FOR_AUTHOR),
KeyEvent.VK_A);
open.addActionListener(new ActionListener() {
@Override
return open;
}
-
- static private String trans(StringIdGui id, Object... values) {
- return Instance.getInstance().getTransGui().getString(id, values);
- }
}