public final class ContextMenuParams
extends java.lang.Object
Constructor and Description |
---|
ContextMenuParams(Browser browser, MediaType mediaType, int x, int y, java.lang.String linkURL, java.lang.String linkText, java.lang.String srcURL, boolean imageBlocked, java.lang.String pageURL, java.lang.String frameURL, long frameId, java.lang.String selectionText, java.lang.String misspelledWord, java.lang.String frameCharset, ContextMenu contextMenu, java.util.List<java.lang.String> dictionarySuggestions)
Constructs a new
ContextMenuParams instance.
|
Modifier and Type | Method and Description |
---|---|
Browser |
getBrowser()
Returns the browser instance the context menu is being invoked on.
返回正在调用上下文菜单的浏览器实例。 |
ContextMenu |
getContextMenu()
Returns presentation of default context menu.
返回默认上下文菜单的表示形式。 |
java.util.List<java.lang.String> |
getDictionarySuggestions()
Returns words suggestions for replacing misspelled word.
返回用于替换拼写错误的单词的单词建议。 |
java.lang.String |
getFrameCharset()
Returns the character encoding of the frame on which the menu is invoked.
返回在其上调用菜单的框架的字符编码。 |
long |
getFrameId()
Returns the ID of the subframe that the context menu was invoked on.
返回调用上下文菜单的子帧的ID。 |
java.lang.String |
getFrameURL()
Returns the URL of the subframe that the context menu was invoked on.
返回调用上下文菜单的子帧的URL。 |
java.lang.String |
getLinkText()
Returns the text associated with the link.
返回与链接关联的文本。 |
java.lang.String |
getLinkURL()
Returns the URL of the link that encloses the node the context menu was invoked on.
返回链接的URL,该URL包含调用上下文菜单的节点。 |
java.awt.Point |
getLocation()
Returns the coordinates of the mouse when the context menu was invoked.
返回调用上下文菜单时鼠标的坐标。 |
MediaType |
getMediaType()
Returns the type of media the context menu is being invoked on.
返回在其上调用上下文菜单的媒体类型。 |
java.lang.String |
getMisspelledWord()
Returns the misspelled word under the cursor, if any.
返回光标下的拼写错误的单词(如果有)。 |
java.lang.String |
getPageURL()
Returns the URL of the top level page that the context menu was invoked on.
返回调用上下文菜单的顶层页面的URL。 |
java.lang.String |
getSelectionText()
Returns the text of the selection that the context menu was invoked on.
返回调用上下文菜单的选择的文本。 |
java.lang.String |
getSrcURL()
This is the source URL for the element that the context menu was invoked on.
这是调用上下文菜单的元素的源URL。 |
boolean |
isImageBlocked()
Indicates whether the context menu was invoked on a blocked image.
指示是否在阻止的图像上调用上下文菜单。 |
java.lang.String |
toString() |
public ContextMenuParams(Browser browser, MediaType mediaType, int x, int y, java.lang.String linkURL, java.lang.String linkText, java.lang.String srcURL, boolean imageBlocked, java.lang.String pageURL, java.lang.String frameURL, long frameId, java.lang.String selectionText, java.lang.String misspelledWord, java.lang.String frameCharset, ContextMenu contextMenu, java.util.List<java.lang.String> dictionarySuggestions)
ContextMenuParams
instance.
browser
- the browser instance the context menu is being invoked on.
-调用上下文菜单的浏览器实例。
mediaType
- the type of media.
-媒体类型。
x
- the x coordinate of context menu. The coordinate value reflects the context menu x-position in points and is relative to the top-left corner of the browser view.
-上下文菜单的x坐标。坐标值以点为单位反映上下文菜单的x位置,并且相对于浏览器视图的左上角。
y
- the y coordinate of context menu. The coordinate value reflects the context menu y-position in points and is relative to the top-left corner of the browser view.
-上下文菜单的y坐标。坐标值以点为单位反映上下文菜单的y位置,并且相对于浏览器视图的左上角。
linkURL
- the URL of the link that encloses the node the context menu was invoked on.
-包含调用上下文菜单的节点的链接的URL。
linkText
- the text associated with the link.
-与链接关联的文本。
srcURL
- the source URL for the element that the context menu was invoked on.
-调用上下文菜单的元素的源URL。
imageBlocked
- indicates whether the context menu was invoked on a blocked image.
-指示是否在阻止的图像上调用上下文菜单。
pageURL
- the URL of the top level page.
-顶层页面的网址。
frameURL
- the URL of the subframe.
-子帧的URL。
frameId
- the ID of the subframe.
-子帧的ID。
selectionText
- the text of the selection that the context menu was invoked on.
-调用上下文菜单的选择的文本。
misspelledWord
- the misspelled word under the cursor.
-光标下方的拼写错误的单词。
frameCharset
- the character encoding of the frame.
-帧的字符编码。
contextMenu
- context menu items.
-上下文菜单项。
dictionarySuggestions
- suggestions for replacing misspelled word
-替换拼写错误的单词的建议
public Browser getBrowser()
public MediaType getMediaType()
MediaType
list of known media types.
已知媒体类型列表中的值。
public java.awt.Point getLocation()
Point
result reflects the coordinates value in points. In order to display the context menu at the correct position, this value should be properly translated to the coordinates value in pixels accoring to the current display DPI settings.
public java.lang.String getLinkURL()
public java.lang.String getLinkText()
public java.lang.String getSrcURL()
public boolean isImageBlocked()
true
if the context menu was invoked on a blocked image.
如果在被阻止的图像上调用了上下文菜单。
public java.lang.String getPageURL()
public java.lang.String getFrameURL()
public long getFrameId()
public java.lang.String getSelectionText()
public java.lang.String getMisspelledWord()
public java.lang.String getFrameCharset()
public ContextMenu getContextMenu()
public java.util.List<java.lang.String> getDictionarySuggestions()
public java.lang.String toString()
toString
in class
java.lang.Object