Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JBrowser Source Code Files
JBrowser Source Code Files are provided in the source package file.
You can download JBrowser source package as described in the previous tutorial and go to the "src" sub-folder to view Source Code files.
You can also browse JBrowser Source Code files below:
✍: FYIcenter
⏎ ru/atomation/jbrowser/impl/ContextMenuObject.java
package ru.atomation.jbrowser.impl; import java.net.MalformedURLException; import java.net.URL; import org.mozilla.interfaces.nsIDOMEvent; import org.mozilla.interfaces.nsIDOMMouseEvent; import org.mozilla.interfaces.nsIDOMNamedNodeMap; import org.mozilla.interfaces.nsIDOMNode; import ru.atomation.jbrowser.interfaces.BrowserClipboardManager; import ru.atomation.jbrowser.interfaces.ContextMenuFlags.ContextMenuFlag; public class ContextMenuObject { private final ContextMenuFlag contextMenuFlag; private final JBrowserComponent<?> browser; private final BrowserClipboardManager browserClipboardManager; private boolean link; private String linkUrl; private int absoluteX; private int absoluteY; public ContextMenuObject(JBrowserComponent<?> browser, ContextMenuFlag contextMenuFlag, BrowserClipboardManager browserClipboardManager, nsIDOMEvent aEvent, nsIDOMNode aNode) { super(); this.browser = browser; this.contextMenuFlag = contextMenuFlag; this.browserClipboardManager = browserClipboardManager; getXY(aEvent); checkForLink(aNode); } private void getXY(nsIDOMEvent aEvent) { nsIDOMMouseEvent domMouseEvent = (nsIDOMMouseEvent) aEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID); if (domMouseEvent != null) { absoluteX = domMouseEvent.getScreenX(); absoluteY = domMouseEvent.getScreenY(); } else { absoluteX = -1; absoluteY = -1; } } private void checkForLink(nsIDOMNode aNode) { linkUrl = null; link = aNode != null && aNode.getNodeName().toLowerCase().equals("a") && (contextMenuFlag.equals(ContextMenuFlag.LINK) || contextMenuFlag.equals(ContextMenuFlag.IMAGE_LINK)); if (link) { nsIDOMNamedNodeMap attributes = aNode.getAttributes(); if (attributes != null) { for (int i=0; i<attributes.getLength(); i++) { nsIDOMNode item = attributes.item(i); if ("href".equals(item.getNodeName().toLowerCase())) { try { linkUrl = new URL(new URL(browser.getUrl()), item.getNodeValue()).toString(); } catch (MalformedURLException e) { link = false; linkUrl = null; } return; } } } link = false; } } public boolean canCopyImageContents() { if (contextMenuFlag.equals(ContextMenuFlag.IMAGE) || contextMenuFlag.equals(ContextMenuFlag.IMAGE_LINK)) { return browserClipboardManager.canCopyImageContents(); } return false; } public void copyImageContents() { browserClipboardManager.copyImageContents(); } public boolean canCopyImageLocation() { if (contextMenuFlag.equals(ContextMenuFlag.IMAGE) || contextMenuFlag.equals(ContextMenuFlag.IMAGE_LINK)) { return browserClipboardManager.canCopyImageLocation(); } return false; } public void copyImageLocation() { browserClipboardManager.copyImageLocation(); } public boolean canCopyLinkLocation() { if (contextMenuFlag.equals(ContextMenuFlag.LINK) || contextMenuFlag.equals(ContextMenuFlag.IMAGE_LINK)) { return browserClipboardManager.canCopyLinkLocation(); } return false; } public void copyLinkLocation() { browserClipboardManager.copyLinkLocation(); } public boolean canCopySelection() { return browserClipboardManager.canCopySelection(); } public void copySelection() { browserClipboardManager.copySelection(); } public boolean canCutSelection() { return browserClipboardManager.canCutSelection(); } public void cutSelection() { browserClipboardManager.cutSelection(); } public boolean canPaste() { return browserClipboardManager.canPaste(); } public void paste() { browserClipboardManager.paste(); } @Override public String toString() { return "canCopyImageContents#" + canCopyImageContents()+ "\ncanCopyImageLocation#"+ canCopyImageLocation()+ "\ncanCopyLinkLocation#"+ canCopyLinkLocation()+ "\ncanCopySelection#"+ canCopySelection()+ "\ncanCutSelection()#"+ canCutSelection()+ "\ncanPaste#"+ canPaste(); } public ContextMenuFlag getContextMenuFlag() { return contextMenuFlag; } public boolean hasLink() { return link; } public String getLinkUrl() { return linkUrl; } public int getAbsoluteX() { return absoluteX; } public int getAbsoluteY() { return absoluteY; } }
⏎ ru/atomation/jbrowser/impl/ContextMenuObject.java
Or download all of them as a single archive file:
File name: jbrowser-1.9-fyi.zip File size: 625318 bytes Release date: 2022-11-10 Download
⇐ Download and Install JBrowser Source Package
2017-07-17, 8517👍, 1💬
Popular Posts:
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...
What is the jaxp\SourceValidator.jav aprovided in the Apache Xerces package? I have Apache Xerces 2....
Where to find answers to frequently asked questions on Downloading and Installing Connector/J - JDBC...
How to download and install JDK (Java Development Kit) 8? If you want to write Java applications, yo...
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper ut...