本文整理汇总了Java中org.eclipse.swt.browser.LocationAdapter类的典型用法代码示例。如果您正苦于以下问题:Java LocationAdapter类的具体用法?Java LocationAdapter怎么用?Java LocationAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocationAdapter类属于org.eclipse.swt.browser包,在下文中一共展示了LocationAdapter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUI_10_SearchInternal
import org.eclipse.swt.browser.LocationAdapter; //导入依赖的package包/类
private void createUI_10_SearchInternal(final Composite parent) {
try {
_browser = new Browser(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(_browser);
} catch (final SWTError e) {
StatusUtil.showStatus("Could not instantiate Browser: " + e.getMessage(), e);//$NON-NLS-1$
return;
}
_browser.addLocationListener(new LocationAdapter() {
@Override
public void changing(final LocationEvent event) {
SearchMgr.onBrowserLocation(event);
}
});
}
示例2: createPartControl
import org.eclipse.swt.browser.LocationAdapter; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent){
browser = new Browser(parent, SWT.NONE);
browser.addLocationListener(new LocationAdapter() {
@Override
public void changed(LocationEvent arg0){
String text = getText(arg0.location);
System.out.println(text);
}
});
// browser.setUrl("http://ch.oddb.org");
browser.setUrl("http://santesuisse.oddb.org/");
}
示例3: SwtInterceptingBrowser
import org.eclipse.swt.browser.LocationAdapter; //导入依赖的package包/类
public SwtInterceptingBrowser(final Browser browser, final Display display, final Shell shell) {
this.browser = browser;
this.display = display;
this.browser.addLocationListener(new LocationAdapter() {
@Override
public void changing(LocationEvent locationEvent) {
super.changing(locationEvent);
final String newValue = locationEvent.location;
lock.lock();
try {
if (redirectUriString != null && newValue != null && newValue.startsWith(redirectUriString)) {
// Do not load this new location, as we are only interested in the authorization code
locationEvent.doit = false;
response = UserAgentImpl.extractResponseFromRedirectUri(newValue);
responseReceived.signal();
}
}
finally {
lock.unlock();
}
}
});
shell.addListener(SWT.Close, new Listener() {
@Override
public void handleEvent(Event event) {
lock.lock();
try {
response = "error=cancelled&error_description=The browser window was closed by the user.";
responseReceived.signal();
} finally {
lock.unlock();
}
}
});
}
示例4: createPartControl
import org.eclipse.swt.browser.LocationAdapter; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent){
browser = new Browser(parent, SWT.NONE);
browser.addLocationListener(new LocationAdapter() {
@Override
public void changed(LocationEvent arg0){
String text = browser.getText();
// System.out.println(text);
}
});
browser.setUrl("http://www.compendium.ch/search/de"); //$NON-NLS-1$
}