contextmenu

Cell: how to activate a contextMenu by keyboard?

末鹿安然 提交于 2019-12-01 20:11:56
问题 A cell contextMenu can't be activated by keyboard: it's underlying reason being that the contextMenuEvent is dispatched to the focused node - which is the containing table, not the cell. The bug evaluation by Jonathan has an outline of how solve it: The 'proper' way to do this is to probably override the buildEventDispatchChain in TableView and include the TableViewSkin (if it implements EventDispatcher), and to keep forwarding this down to the cells in the table row. Tried to follow that

Cell: how to activate a contextMenu by keyboard?

前提是你 提交于 2019-12-01 19:26:24
A cell contextMenu can't be activated by keyboard : it's underlying reason being that the contextMenuEvent is dispatched to the focused node - which is the containing table, not the cell. The bug evaluation by Jonathan has an outline of how solve it: The 'proper' way to do this is to probably override the buildEventDispatchChain in TableView and include the TableViewSkin (if it implements EventDispatcher), and to keep forwarding this down to the cells in the table row. Tried to follow that path (below is an example for ListView, simply because there's only one level of skins to implement vs.

jQuery context menu - finding what element triggered it off

痴心易碎 提交于 2019-12-01 17:13:34
I am trying to write a context menu option for a page of mine. Basically a div is right-clicked, an options menu pops up which can be used to perform tasks. My problem is trying to find the original element which triggered everything (ie the div that was right-clicked). My jQuery code is more or lesS: //this is what displays the context menu $('.outfeedPosition').bind("contextmenu", function (e) { $('#contextMenu').css({ top: e.pageY + 'px', left: e.pageX + 'px' }).show(); //'this' is the element which was clicked by the user. alert($(this).attr('id')); return false; }); //this is the

jQuery context menu - finding what element triggered it off

♀尐吖头ヾ 提交于 2019-12-01 15:07:50
问题 I am trying to write a context menu option for a page of mine. Basically a div is right-clicked, an options menu pops up which can be used to perform tasks. My problem is trying to find the original element which triggered everything (ie the div that was right-clicked). My jQuery code is more or lesS: //this is what displays the context menu $('.outfeedPosition').bind("contextmenu", function (e) { $('#contextMenu').css({ top: e.pageY + 'px', left: e.pageX + 'px' }).show(); //'this' is the

What event should be used on a p:tree to select a tree node and have a context menu?

。_饼干妹妹 提交于 2019-12-01 13:28:08
I'm creating a PrimeFaces (5.3) tree with a context menu. Selected nodes should be stored in #{myBean.selectedNode} . When I select a node using the left mouse button the correct node is set. But, when I try to run an action on a node from a context menu, without selecting it first , the correct node isn't set (the setter in my bean is not called). I'm following the example in the PrimeFaces showcase . As you can see, in the PrimeFaces showcase you are able to immediately right click a node, click "View", and the growl will display the correct node. Here is my setup: Bean It is ViewScoped and

how to add icon to context menu in c# windows form application

懵懂的女人 提交于 2019-12-01 13:26:25
问题 I am having a tree view in which if i right click any node context menu is displayed,Now i want to add icons corresponding to items in the context menu. 回答1: If you're talking about ContextMenuStrip control, you can do that either it in the designer, by clicking on the item and selecting "Set image..." , or programmatically by changing the Image property of the ToolStripMenuItem . 来源: https://stackoverflow.com/questions/6555691/how-to-add-icon-to-context-menu-in-c-sharp-windows-form

JTable right-click copy/paste menu to copy cell data on one click

拜拜、爱过 提交于 2019-12-01 12:20:56
I created my JPopupMenu . It appears on my JTable when I right click on a cell. However, I cannot copy the data in the cell unless I first double click and then highlight the data, and then right click anywhere but this current cell to show my popup menu and copy option. I would like to copy the data in a cell without having to double click on a cell and enter into cell edit mode where I then need to select the data. How can I do this? popup = new JPopupMenu(); popup.setName("popupMenu"); menuItemCopy = new JMenuItem(new DefaultEditorKit.CopyAction()); menuItemCopy.setText("Copy");

.NET Multiple ToolStripButtons in a single ContextMenuItem

谁说我不能喝 提交于 2019-12-01 12:04:08
I'm trying to create a ContextMenu where some items in the menu contain more than a single item. You could see it as trying to combine a ToolStrip and ContextMenuItem. I've tried using a ToolStripControlHost, but this creates problems with the focus. It basically requires you to click everything in the ToolStrip twice.. ContextMenuStrip m = new ContextMenuStrip(); ToolStrip tStrip = new ToolStrip(new ToolStripDropDownButton(), new ToolStripButton()); ToolStripControlHost tsHost = new ToolStripControlHost(tStrip); m.Items.Add(tsHost); Any thoughts on how to achieve this? A ContextMenuStrip is

WebBrowser ContextMenu run action of menu item

自作多情 提交于 2019-12-01 11:46:21
I have an application with a WebBrowser Control. I load a page to it with a button click. Then I want to run a "Convert to Adobe PDF" action from the context menu of the web browser but... when I try to access the context menu by: foreach (MenuItem vMenuItem in WebBrowser.ContextMenu.MenuItems) { if (vMenuItem.Text.Contains("onwert") && vMenuItem.Text.Contains("PDF")) { vMenuItem.PerformClick(); } } The IDE displays an error "Object reference not set to an instance of an object" on line with foreach (MenuItem vMenuItem in WebBrowser.ContextMenu.MenuItems) I didn't create my own context menu, I

What event should be used on a p:tree to select a tree node and have a context menu?

冷暖自知 提交于 2019-12-01 11:18:41
问题 I'm creating a PrimeFaces (5.3) tree with a context menu. Selected nodes should be stored in #{myBean.selectedNode} . When I select a node using the left mouse button the correct node is set. But, when I try to run an action on a node from a context menu, without selecting it first , the correct node isn't set (the setter in my bean is not called). I'm following the example in the PrimeFaces showcase. As you can see, in the PrimeFaces showcase you are able to immediately right click a node,