Java Code Examples for java.awt.event.InputEvent#getID()

The following examples show how to use java.awt.event.InputEvent#getID() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HTMLView.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void invokeDefaultAction(URL url, InputEvent e) {
    HeapViewerNode node = nodeForURL(url, context);
    if (node == null) return;

    HeapViewerNodeAction.Actions nodeActions = HeapViewerNodeAction.Actions.forNode(node, actionProviders, context, actions);
    ActionEvent ae = e == null ? new ActionEvent(htmlComponent, ActionEvent.ACTION_PERFORMED, "link"): // NO18N
                                 new ActionEvent(e.getSource(), e.getID(), "link", e.getWhen(), e.getModifiers()); // NO18N
    nodeActions.performDefaultAction(ae);
}
 
Example 2
Source File: HTMLView.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void invokeMiddleButtonAction(URL url, InputEvent e) {
    HeapViewerNode node = nodeForURL(url, context);
    if (node == null) return;

    HeapViewerNodeAction.Actions nodeActions = HeapViewerNodeAction.Actions.forNode(node, actionProviders, context, actions);
    ActionEvent ae = new ActionEvent(e.getSource(), e.getID(), "middle button", e.getWhen(), e.getModifiers()); // NO18N
    nodeActions.performMiddleButtonAction(ae);
}