当前位置: 首页>>代码示例>>Java>>正文


Java LocationAdapter类代码示例

本文整理汇总了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);
			}
		});

	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:21,代码来源:SearchView.java

示例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/");
	
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:ODDBView.java

示例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();
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:oauth2-useragent,代码行数:40,代码来源:SwtInterceptingBrowser.java

示例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$
	
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:16,代码来源:KompendiumView.java


注:本文中的org.eclipse.swt.browser.LocationAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。