MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / click

Method click

src/main/java/org/htmlunit/html/HtmlAnchor.java:76–95  ·  view source on GitHub ↗

{@inheritDoc}

(final Event event,
            final boolean shiftKey, final boolean ctrlKey, final boolean altKey,
            final boolean ignoreVisibility)

Source from the content-addressed store, hash-verified

74 * {@inheritDoc}
75 */
76 @Override
77 @SuppressWarnings("unchecked")
78 public <P extends Page> P click(final Event event,
79 final boolean shiftKey, final boolean ctrlKey, final boolean altKey,
80 final boolean ignoreVisibility) throws IOException {
81 WebWindow oldWebWindow = null;
82 if (ctrlKey) {
83 oldWebWindow = ((HTMLElement) event.getSrcElement()).getDomNodeOrDie()
84 .getPage().getWebClient().getCurrentWindow();
85 }
86
87 P page = super.click(event, shiftKey, ctrlKey, altKey, ignoreVisibility);
88
89 if (ctrlKey) {
90 page.getEnclosingWindow().getWebClient().setCurrentWindow(oldWebWindow);
91 page = (P) oldWebWindow.getEnclosedPage();
92 }
93
94 return page;
95 }
96
97 /**
98 * Same as {@link #doClickStateUpdate(boolean, boolean)}, except that it accepts an {@code href} suffix,

Callers 15

setHashMethod · 0.95
reloadMethod · 0.95
openWindowMethod · 0.95
openWindow_baseMethod · 0.95
openWindow_blankMethod · 0.95
openWindow_selfMethod · 0.95
openWindow_topMethod · 0.95
openWindow_parentMethod · 0.95
openWindow_imageMethod · 0.95
openWindow_textMethod · 0.95

Calls 8

getEnclosedPageMethod · 0.95
getCurrentWindowMethod · 0.80
getSrcElementMethod · 0.80
setCurrentWindowMethod · 0.80
getWebClientMethod · 0.65
getPageMethod · 0.65
getEnclosingWindowMethod · 0.65
getDomNodeOrDieMethod · 0.45

Tested by 15

setHashMethod · 0.76
reloadMethod · 0.76
openWindowMethod · 0.76
openWindow_baseMethod · 0.76
openWindow_blankMethod · 0.76
openWindow_selfMethod · 0.76
openWindow_topMethod · 0.76
openWindow_parentMethod · 0.76
openWindow_imageMethod · 0.76
openWindow_textMethod · 0.76