Java 类org.eclipse.swt.browser.LocationAdapter 实例源码

项目:mytourbook    文件:SearchView.java   
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);
            }
        });

    }
项目:elexis-3-core    文件:ODDBView.java   
@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/");

}
项目:oauth2-useragent    文件:SwtInterceptingBrowser.java   
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();
            }
        }
    });
}
项目:elexis-3-core    文件:KompendiumView.java   
@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$

}