本文整理了Java中org.eclipse.swt.browser.Browser.getMenu()
方法的一些代码示例,展示了Browser.getMenu()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Browser.getMenu()
方法的具体详情如下:
包路径:org.eclipse.swt.browser.Browser
类名称:Browser
方法名:getMenu
暂无
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
long /*int*/ webView_contextMenuItemsForElement_defaultMenuItems(long /*int*/ sender, long /*int*/ element, long /*int*/ defaultMenuItems) {
Point pt = browser.getDisplay().getCursorLocation();
Event event = new Event();
event.x = pt.x;
event.y = pt.y;
browser.notifyListeners(SWT.MenuDetect, event);
Menu menu = browser.getMenu();
if (!event.doit) return 0;
if (menu != null && !menu.isDisposed()) {
if (event.x != pt.x || event.y != pt.y) {
menu.setLocation(event.x, event.y);
}
menu.setVisible(true);
return 0;
}
return defaultMenuItems;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
int /*long*/ webkit_context_menu (int /*long*/ web_view, int /*long*/ context_menu, int /*long*/ eventXXX, int /*long*/ hit_test_result) {
Point pt = browser.getDisplay ().getCursorLocation ();
Event event = new Event ();
event.x = pt.x;
event.y = pt.y;
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit) {
// Do not display the menu
return 1;
}
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
menu.setLocation (event.x, event.y);
}
menu.setVisible (true);
// Do not display the webkit menu
return 1;
}
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
int /*long*/ webkit_context_menu (int /*long*/ web_view, int /*long*/ context_menu, int /*long*/ eventXXX, int /*long*/ hit_test_result) {
Point pt = browser.getDisplay ().getCursorLocation ();
Event event = new Event ();
event.x = pt.x;
event.y = pt.y;
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit) {
// Do not display the menu
return 1;
}
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
menu.setLocation (event.x, event.y);
}
menu.setVisible (true);
// Do not display the webkit menu
return 1;
}
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
long /*int*/ webkit_context_menu (long /*int*/ web_view, long /*int*/ context_menu, long /*int*/ eventXXX, long /*int*/ hit_test_result) {
Point pt = browser.getDisplay ().getCursorLocation ();
Event event = new Event ();
event.x = pt.x;
event.y = pt.y;
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit) {
// Do not display the menu
return 1;
}
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
menu.setLocation (event.x, event.y);
}
menu.setVisible (true);
// Do not display the webkit menu
return 1;
}
return 0;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
int contextMenuItemsForElement (int /*long*/ sender, int /*long*/ element, int /*long*/ defaultItemsHMenu, int /*long*/ resultHMenu) {
Point pt = browser.getDisplay ().getCursorLocation ();
Event event = new Event ();
event.x = pt.x;
event.y = pt.y;
browser.notifyListeners (SWT.MenuDetect, event);
if (event.doit) {
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (event.x != pt.x || event.y != pt.y) {
menu.setLocation (event.x, event.y);
}
menu.setVisible (true);
} else {
OS.MoveMemory (resultHMenu, new int /*long*/[] {defaultItemsHMenu}, C.PTR_SIZEOF);
return COM.S_OK;
}
}
OS.MoveMemory (resultHMenu, new int /*long*/[] {0}, C.PTR_SIZEOF);
return COM.S_OK;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
int ShowContextMenu(int dwID, int /*long*/ ppt, int /*long*/ pcmdtReserved, int /*long*/ pdispReserved) {
Browser browser = (Browser)getParent().getParent();
Event event = new Event();
POINT pt = new POINT();
OS.MoveMemory(pt, ppt, POINT.sizeof);
pt.x = DPIUtil.autoScaleDown(pt.x); // To Points
pt.y = DPIUtil.autoScaleDown(pt.y); // To Points
event.x = pt.x;
event.y = pt.y;
browser.notifyListeners(SWT.MenuDetect, event);
if (!event.doit) return COM.S_OK;
Menu menu = browser.getMenu();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
menu.setLocation (event.x, event.y);
}
menu.setVisible (true);
return COM.S_OK;
}
/* Show default IE popup menu */
return COM.S_FALSE;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
int OnShowContextMenu (int aContextFlags, long /*int*/ aEvent, long /*int*/ aNode) {
nsIDOMEvent domEvent = new nsIDOMEvent (aEvent);
long /*int*/[] result = new long /*int*/[1];
int rc = domEvent.QueryInterface (IsPre_17 ? (IsPre_4 ? nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID : nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_10_IID) :nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_17_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
int[] aScreenX = new int[1], aScreenY = new int[1];
nsIDOMMouseEvent domMouseEvent = new nsIDOMMouseEvent (result[0]);
rc = domMouseEvent.GetScreenX (aScreenX);
if (rc != XPCOM.NS_OK) error (rc);
rc = domMouseEvent.GetScreenY (aScreenY);
if (rc != XPCOM.NS_OK) error (rc);
domMouseEvent.Release ();
Event event = new Event ();
event.x = aScreenX[0];
event.y = aScreenY[0];
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit || browser.isDisposed ()) return XPCOM.NS_OK;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (aScreenX[0] != event.x || aScreenY[0] != event.y) {
menu.setLocation (event.x, event.y);
}
menu.setVisible (true);
}
return XPCOM.NS_OK;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
return 0;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit || browser.isDisposed ()) return XPCOM.NS_OK;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (aScreenX[0] != event.x || aScreenY[0] != event.y) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
return 0;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
return 0;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (pt.x != event.x || pt.y != event.y) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit || browser.isDisposed ()) return XPCOM.NS_OK;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (aScreenX[0] != event.x || aScreenY[0] != event.y) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit || browser.isDisposed ()) return XPCOM.NS_OK;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (aScreenX[0] != event.x || aScreenY[0] != event.y) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
browser.notifyListeners (SWT.MenuDetect, event);
if (!event.doit || browser.isDisposed ()) return XPCOM.NS_OK;
Menu menu = browser.getMenu ();
if (menu != null && !menu.isDisposed ()) {
if (aScreenX[0] != event.x || aScreenY[0] != event.y) {
内容来源于网络,如有侵权,请联系作者删除!