package com.ts3client.ui; import com.ts3client.net.ChannelNode; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; /** * The context menu for a channel, shared by the server tree and channel links * in the chat log. */ final class ChannelMenu { private ChannelMenu() { } static JPopupMenu build(ChannelNode channel, ServerTreePanel.Actions actions) { JPopupMenu menu = new JPopupMenu(); JMenuItem join = new JMenuItem("Join channel", Icons.of("CHANNEL_SWITCH")); join.addActionListener(a -> actions.joinChannel(channel.id)); menu.add(join); menu.addSeparator(); JMenuItem files = new JMenuItem("Browse files", Icons.of("FILETRANSFER")); files.addActionListener(a -> actions.browseFiles(channel)); menu.add(files); return menu; } }