Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312994

Summary: browser.getHorizontalBar() and getVerticalBar() return null even when scrollbars are present
Product: [Eclipse Project] Platform Reporter: Misha Koshelev <misha680>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: grant_gayed
Version: 3.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Misha Koshelev CLA 2010-05-14 19:47:35 EDT
Thank you!

Misha

p.s. Tested on Windows as well :(
Comment 1 Grant Gayed CLA 2010-05-17 10:30:23 EDT
These scrollbars are part of the embedded native Browser, they're not available to us the way they are on other controls like Table, List, etc.  What do you want to do with them?  You may be able to achieve what you want via javascript.
Comment 2 Misha Koshelev CLA 2010-05-17 10:37:11 EDT
Ah I see. I would like to be notified when the user scrolls the browser. Is this possible?

Thank you
Misha
Comment 3 Grant Gayed CLA 2010-05-17 11:49:46 EDT
It looks like Javascript's window object offers an onscroll event, so you should be able to add a listener for this on every page load (detect this by ProgressListener.completed()) via Browser.execute(...).

If you want this notification to get out to your java code then you can define a BrowserFunction when your Browser is first instantiated, and have your javascript scroll listener invoke this function.  For a BrowserFunction example see http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java?view=co .
Comment 4 Misha Koshelev CLA 2010-05-17 13:55:21 EDT
Thank you. That is very helpful.

I have completely re-written my EPL-licensed Web Automation Framework so that we actually get a Java DOM representation of the page.

I hope that it will be useful, and I hope to release in next few days.

Thank you so much for all your help.

Misha