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); } }); }
@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/"); }
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(); } } }); }
@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$ }