use of com.frostwire.gui.theme.SkinMenuItem in project frostwire by frostwire.
the class PopupUtils method addMenuItem.
/**
* Adds a menu item defined by the ActionListener & String to the JPopupMenu, enabled or not at the given index.
*/
public static final void addMenuItem(String s, ActionListener l, JPopupMenu m, boolean enable, int idx) {
JMenuItem item = m instanceof SkinPopupMenu ? new SkinMenuItem(s) : new JMenuItem(s);
item.addActionListener(l);
item.setEnabled(enable);
m.add(item, idx);
}
use of com.frostwire.gui.theme.SkinMenuItem in project frostwire by frostwire.
the class SearchField method createPopup.
/**
* Creates the JPopupMenu that all LimeTextFields will share.
*/
private static JPopupMenu createPopup() {
if (POPUP != null) {
return POPUP;
}
// initialize the JPopupMenu with necessary stuff.
POPUP = new SkinPopupMenu() {
/**
*/
private static final long serialVersionUID = -6004124495511263059L;
public void show(Component invoker, int x, int y) {
((SearchField) invoker).updateActions();
super.show(invoker, x, y);
}
};
POPUP.add(new SkinMenuItem(UNDO_ACTION));
POPUP.addSeparator();
POPUP.add(new SkinMenuItem(CUT_ACTION));
POPUP.add(new SkinMenuItem(COPY_ACTION));
POPUP.add(new SkinMenuItem(PASTE_ACTION));
POPUP.add(new SkinMenuItem(DELETE_ACTION));
POPUP.addSeparator();
POPUP.add(new SkinMenuItem(SELECT_ALL_ACTION));
return POPUP;
}
use of com.frostwire.gui.theme.SkinMenuItem in project frostwire by frostwire.
the class LibraryPlaylistsTableMediator method createSearchSubMenu.
private JMenu createSearchSubMenu(LibraryPlaylistsTableDataLine dl) {
JMenu menu = new SkinMenu(I18n.tr("Search"));
if (dl != null) {
File f = dl.getFile();
String keywords = QueryUtils.createQueryString(f.getName());
if (keywords.length() > 0)
menu.add(new SkinMenuItem(new SearchAction(keywords)));
}
if (menu.getItemCount() == 0)
menu.setEnabled(false);
return menu;
}
use of com.frostwire.gui.theme.SkinMenuItem in project frostwire by frostwire.
the class LibraryPlaylistsTableMediator method createPopupMenu.
// inherit doc comment
protected JPopupMenu createPopupMenu() {
if (TABLE.getSelectionModel().isSelectionEmpty())
return null;
JPopupMenu menu = new SkinPopupMenu();
menu.add(new SkinMenuItem(LAUNCH_ACTION));
menu.add(new SkinMenuItem(LAUNCH_OS_ACTION));
if (hasExploreAction()) {
menu.add(new SkinMenuItem(OPEN_IN_FOLDER_ACTION));
}
menu.add(new SkinMenuItem(CREATE_TORRENT_ACTION));
menu.add(createAddToPlaylistSubMenu());
menu.add(new SkinMenuItem(SEND_TO_FRIEND_ACTION));
menu.add(new SkinMenuItem(SEND_TO_ITUNES_ACTION));
menu.addSeparator();
menu.add(new SkinMenuItem(COPY_PLAYLIST_FILES_TO_FOLDER_ACTION));
menu.addSeparator();
menu.add(new SkinMenuItem(DELETE_ACTION));
int[] rows = TABLE.getSelectedRows();
boolean dirSelected = false;
boolean fileSelected = false;
for (int row : rows) {
File f = DATA_MODEL.get(row).getFile();
if (f.isDirectory()) {
dirSelected = true;
// if (IncompleteFileManager.isTorrentFolder(f))
// torrentSelected = true;
} else
fileSelected = true;
if (dirSelected && fileSelected)
break;
}
if (dirSelected) {
DELETE_ACTION.setEnabled(true);
} else {
DELETE_ACTION.setEnabled(true);
}
menu.addSeparator();
menu.add(new SkinMenuItem(importToPlaylistAction));
menu.add(new SkinMenuItem(exportPlaylistAction));
menu.add(new SkinMenuItem(cleanupPlaylistAction));
menu.add(new SkinMenuItem(refreshID3TagsAction));
menu.addSeparator();
LibraryPlaylistsTableDataLine line = DATA_MODEL.get(rows[0]);
menu.add(createSearchSubMenu(line));
return menu;
}
use of com.frostwire.gui.theme.SkinMenuItem in project frostwire by frostwire.
the class LibraryPlaylists method getNewPlaylistPopupMenu.
private SkinPopupMenu getNewPlaylistPopupMenu() {
SkinPopupMenu popupMenu = new SkinPopupMenu();
popupMenu.add(new SkinMenuItem(actions[IMPORT_TO_NEW_PLAYLIST_ACTION]));
popupMenu.add(new SkinMenuItem(actions[CONFIGURE_OPTIONS_ACTION]));
return popupMenu;
}
Aggregations