本文整理汇总了Java中chatty.gui.components.menus.StreamsContextMenu类的典型用法代码示例。如果您正苦于以下问题:Java StreamsContextMenu类的具体用法?Java StreamsContextMenu怎么用?Java StreamsContextMenu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StreamsContextMenu类属于chatty.gui.components.menus包,在下文中一共展示了StreamsContextMenu类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openContextMenu
import chatty.gui.components.menus.StreamsContextMenu; //导入依赖的package包/类
/**
* Open context menu for this user, if the event points at one.
*
* @param e
*/
private void openContextMenu(MouseEvent e) {
if (e.isPopupTrigger()) {
selectClicked(e, false);
List<RemovedListItem> selectedItems = list.getSelectedValuesList();
List<StreamInfo> selected = new ArrayList<>();
for (RemovedListItem item : selectedItems) {
selected.add(item.getStreamInfo());
}
StreamsContextMenu m = new StreamsContextMenu(selected, false);
for (ContextMenuListener cml : contextMenuListeners) {
m.addContextMenuListener(cml);
}
m.show(list, e.getX(), e.getY());
}
}
示例2: openContextMenu
import chatty.gui.components.menus.StreamsContextMenu; //导入依赖的package包/类
private void openContextMenu(MouseEvent e) {
if (e.isPopupTrigger()) {
int clickedRow = table.rowAtPoint(e.getPoint());
if (clickedRow != -1) {
if (!Helper.arrayContainsInt(table.getSelectedRows(), clickedRow)) {
table.setRowSelectionInterval(clickedRow, clickedRow);
}
}
if (table.getSelectedRow() != -1) {
Set<String> selected = getSelectedChannels();
ContextMenu m = new StreamsContextMenu(selected, contextMenuListener);
m.show(table, e.getX(), e.getY());
}
}
}
示例3: openContextMenu
import chatty.gui.components.menus.StreamsContextMenu; //导入依赖的package包/类
/**
* Open the context menu for the given MouseEvent if it is the popup trigger
* and rows are selected.
*
* @param e The MouseEvent
*/
private void openContextMenu(MouseEvent e) {
if (e.isPopupTrigger()) {
Collection<String> streams = new HashSet<>();
int[] selectedRows = table.getSelectedRows();
for (int selectedRow : selectedRows) {
Follower selected = followers.get(selectedRow);
streams.add(StringUtil.toLowerCase(selected.name));
}
if (!streams.isEmpty()) {
StreamsContextMenu m = new StreamsContextMenu(streams, contextMenuListener);
m.show(table, e.getX(), e.getY());
}
}
}
示例4: openContextMenu
import chatty.gui.components.menus.StreamsContextMenu; //导入依赖的package包/类
/**
* Open context menu for this user, if the event points at one.
*
* @param e
*/
private void openContextMenu(MouseEvent e) {
if (e.isPopupTrigger()) {
selectClicked(e, false);
List<StreamInfo> selected = getSelectedValuesList();
StreamsContextMenu m = new StreamsContextMenu(selected, true);
for (ContextMenuListener cml : contextMenuListeners) {
m.addContextMenuListener(cml);
}
lastContextMenu = m;
m.show(this, e.getX(), e.getY());
}
}