本文整理了Java中org.eclipse.swt.browser.Browser.getDisplay()
方法的一些代码示例,展示了Browser.getDisplay()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Browser.getDisplay()
方法的具体详情如下:
包路径:org.eclipse.swt.browser.Browser
类名称:Browser
方法名:getDisplay
暂无
代码示例来源:origin: pentaho/pentaho-kettle
@Override public void keyPressed( KeyEvent keyEvent ) {
int state = keyEvent.stateMask, key = keyEvent.keyCode;
boolean copyContent = state == SWT.CTRL && key == SWT.F6,
arrowNavigation = ( state == SWT.COMMAND || state == SWT.ALT )
&& ( key == SWT.ARROW_LEFT || key == SWT.ARROW_RIGHT ),
backslashNavigation = ( state == SWT.SHIFT && key == SWT.BS ),
reloadContent = state == SWT.CTRL && ( key == SWT.F5 || key == 114 /* r key */ ) || key == SWT.F5,
zoomContent = state == SWT.CTRL && ( key == SWT.KEYPAD_ADD || key == SWT.KEYPAD_SUBTRACT
|| key == 61 /* + key */ || key == 45 /* - key */ );
if ( copyContent ) {
Browser thisBrowser = (Browser) keyEvent.getSource();
Clipboard clipboard = new Clipboard( thisBrowser.getDisplay() );
clipboard.setContents( new String[] { lastNavigateURL }, new Transfer[] { TextTransfer.getInstance() } );
clipboard.dispose();
} else if ( arrowNavigation || backslashNavigation || reloadContent || zoomContent ) {
keyEvent.doit = false;
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public Display
getDisplay()
{
return( browser.getDisplay());
}
代码示例来源:origin: org.eclipse/org.eclipse.help.ui
public void run() {
BusyIndicator.showWhile(browser.getDisplay(), new Runnable() {
public void run() {
try {
parent.showExternalURL(BaseHelpSystem
.unresolve(new URL(url)));
} catch (MalformedURLException e) {
HelpUIPlugin.logError("Malformed URL: " + statusURL, e); //$NON-NLS-1$
}
}
});
}
};
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
private void fireProgressCompletedEvent(){
ProgressEvent progress = new ProgressEvent (browser);
progress.display = browser.getDisplay ();
progress.widget = browser;
progress.current = MAX_PROGRESS;
progress.total = MAX_PROGRESS;
for (int i = 0; i < progressListeners.length; i++) {
progressListeners[i].completed (progress);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
int OnProgressChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aCurSelfProgress, int aMaxSelfProgress, int aCurTotalProgress, int aMaxTotalProgress) {
if (progressListeners.length == 0) return XPCOM.NS_OK;
ProgressEvent event = new ProgressEvent (browser);
event.display = browser.getDisplay ();
event.widget = browser;
event.current = aCurTotalProgress;
event.total = aMaxTotalProgress;
for (int i = 0; i < progressListeners.length; i++) {
progressListeners[i].changed (event);
}
return XPCOM.NS_OK;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
int OnProgressChange (long /*int*/ aWebProgress, long /*int*/ aRequest, int aCurSelfProgress, int aMaxSelfProgress, int aCurTotalProgress, int aMaxTotalProgress) {
if (progressListeners.length == 0) return XPCOM.NS_OK;
ProgressEvent event = new ProgressEvent (browser);
event.display = browser.getDisplay ();
event.widget = browser;
event.current = aCurTotalProgress;
event.total = aMaxTotalProgress;
for (int i = 0; i < progressListeners.length; i++) {
progressListeners[i].changed (event);
}
return XPCOM.NS_OK;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
int OnProgressChange (long /*int*/ aWebProgress, long /*int*/ aRequest, int aCurSelfProgress, int aMaxSelfProgress, int aCurTotalProgress, int aMaxTotalProgress) {
if (progressListeners.length == 0) return XPCOM.NS_OK;
ProgressEvent event = new ProgressEvent (browser);
event.display = browser.getDisplay ();
event.widget = browser;
event.current = aCurTotalProgress;
event.total = aMaxTotalProgress;
for (int i = 0; i < progressListeners.length; i++) {
progressListeners[i].changed (event);
}
return XPCOM.NS_OK;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
private void fireNewTitleEvent(String title){
TitleEvent newEvent = new TitleEvent (browser);
newEvent.display = browser.getDisplay ();
newEvent.widget = browser;
newEvent.title = title;
for (int i = 0; i < titleListeners.length; i++) {
titleListeners[i].changed (newEvent);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
private void fireNewTitleEvent(String title){
TitleEvent newEvent = new TitleEvent (browser);
newEvent.display = browser.getDisplay ();
newEvent.widget = browser;
newEvent.title = title;
for (int i = 0; i < titleListeners.length; i++) {
titleListeners[i].changed (newEvent);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
private void fireNewTitleEvent(String title){
TitleEvent newEvent = new TitleEvent (browser);
newEvent.display = browser.getDisplay ();
newEvent.widget = browser;
newEvent.title = title;
for (int i = 0; i < titleListeners.length; i++) {
titleListeners[i].changed (newEvent);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
private void fireProgressCompletedEvent(){
ProgressEvent progress = new ProgressEvent (browser);
progress.display = browser.getDisplay ();
progress.widget = browser;
progress.current = MAX_PROGRESS;
progress.total = MAX_PROGRESS;
for (int i = 0; i < progressListeners.length; i++) {
progressListeners[i].completed (progress);
}
}
代码示例来源:origin: org.xworker/xworker_swt
public static void attach(Browser browser, ActionContext actionContext){
UtilBrowser ub = new UtilBrowser(browser.getDisplay(), actionContext);
ub.attach(browser);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void webView_setFrame(long /*int*/ sender, long /*int*/ frame) {
NSRect rect = new NSRect();
OS.memmove(rect, frame, NSRect.sizeof);
/* convert to SWT system coordinates */
Rectangle bounds = browser.getDisplay().getBounds();
location = new Point((int)rect.x, bounds.height - (int)rect.y - (int)rect.height);
size = new Point((int)rect.width, (int)rect.height);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
private void fireProgressCompletedEvent(){
ProgressEvent progress = new ProgressEvent (browser);
progress.display = browser.getDisplay ();
progress.widget = browser;
progress.current = MAX_PROGRESS;
progress.total = MAX_PROGRESS;
for (int i = 0; i < progressListeners.length; i++) {
progressListeners[i].completed (progress);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void handleMouseDown () {
int shellStyle = browser.getShell ().getStyle ();
if ((shellStyle & SWT.ON_TOP) != 0 && (((shellStyle & SWT.NO_FOCUS) == 0) || ((browser.getStyle () & SWT.NO_FOCUS) == 0))) {
browser.getDisplay ().asyncExec (new Runnable () {
@Override
public void run () {
if (browser == null || browser.isDisposed ()) return;
((Mozilla)browser.webBrowser).Activate ();
}
});
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
public void run () {
if (browser.isDisposed ()) return;
if (browser.getDisplay ().getFocusControl () == null) {
int traversal = (gdkEvent.state & OS.GDK_SHIFT_MASK) != 0 ? SWT.TRAVERSE_TAB_PREVIOUS : SWT.TRAVERSE_TAB_NEXT;
browser.traverse (traversal);
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
public void run () {
if (browser.isDisposed ()) return;
if (browser.getDisplay ().getFocusControl () == null) {
int traversal = (stateMask & SWT.SHIFT) != 0 ? SWT.TRAVERSE_TAB_PREVIOUS : SWT.TRAVERSE_TAB_NEXT;
browser.traverse (traversal);
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
int /*long*/ webkit_close_web_view (int /*long*/ web_view) {
WindowEvent newEvent = new WindowEvent (browser);
newEvent.display = browser.getDisplay ();
newEvent.widget = browser;
for (int i = 0; i < closeWindowListeners.length; i++) {
closeWindowListeners[i].close (newEvent);
}
browser.dispose ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
long /*int*/ webkit_close_web_view (long /*int*/ web_view) {
WindowEvent newEvent = new WindowEvent (browser);
newEvent.display = browser.getDisplay ();
newEvent.widget = browser;
for (int i = 0; i < closeWindowListeners.length; i++) {
closeWindowListeners[i].close (newEvent);
}
browser.dispose ();
return 0;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
int /*long*/ webkit_status_bar_text_changed (int /*long*/ web_view, int /*long*/ text) {
int length = OS.strlen (text);
byte[] bytes = new byte[length];
OS.memmove (bytes, text, length);
StatusTextEvent statusText = new StatusTextEvent (browser);
statusText.display = browser.getDisplay ();
statusText.widget = browser;
statusText.text = new String (Converter.mbcsToWcs (null, bytes));
for (int i = 0; i < statusTextListeners.length; i++) {
statusTextListeners[i].changed (statusText);
}
return 0;
}
内容来源于网络,如有侵权,请联系作者删除!