Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Rendering of TreeViewer on SashForm
Rendering of TreeViewer on SashForm [message #123077] Thu, 26 February 2009 07:24 Go to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

This is a multi-part message in MIME format.
--------------070807060101000801020501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello everybody,
I have a SashForm with a TreeViewer on one side of the Sash. The
TreeViewer has SWT.BORDER set (see end of the post for a code snippet).

It seems that RAP renders the TreeViewer a little bit wider than it is
intendet, and therefore the TreeViewer's scroollbars are partly overlaid
by the Sash in both directions (vertically and horizontally).

The screenshot tv_on_sash.png shows how it should be rendered (and is
rendered with SWT), tv_on_sash_rap.png shows the (slightly wrong)
rendering by RWT.

This is not a critical problem since it can be solved by turning off
SWT.BORDER on the TreeViewer, but it is at least distracting for
single-sourcers. Also I could not reproduce this with an different
control than a TreeViewer (e.g. the text widget on the left side is
shown correctly, I also tried a TableViewer which does not show this
behaviour). My Target is 1.2 M5.

Regards,
Bj
Re: Rendering of TreeViewer on SashForm [message #123143 is a reply to message #123077] Thu, 26 February 2009 10:11 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Björn,

your snippet renders fine here. Which version do you use? Any custom themes?

Ralf

Björn Fischer wrote:
> Hello everybody,
> I have a SashForm with a TreeViewer on one side of the Sash. The
> TreeViewer has SWT.BORDER set (see end of the post for a code snippet).
>
> It seems that RAP renders the TreeViewer a little bit wider than it is
> intendet, and therefore the TreeViewer's scroollbars are partly overlaid
> by the Sash in both directions (vertically and horizontally).
>
> The screenshot tv_on_sash.png shows how it should be rendered (and is
> rendered with SWT), tv_on_sash_rap.png shows the (slightly wrong)
> rendering by RWT.
>
> This is not a critical problem since it can be solved by turning off
> SWT.BORDER on the TreeViewer, but it is at least distracting for
> single-sourcers. Also I could not reproduce this with an different
> control than a TreeViewer (e.g. the text widget on the left side is
> shown correctly, I also tried a TableViewer which does not show this
> behaviour). My Target is 1.2 M5.
>
> Regards,
> Björn
>
> P.S.: Here is the Snippet (move the contents of createUI to the
> constructor in order to run it standalone as Java app):
> ---------------------------------------
> import org.eclipse.jface.viewers.TreeViewer;
> import org.eclipse.rwt.lifecycle.IEntryPoint;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.custom.SashForm;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Text;
>
> public class SashFormExample implements IEntryPoint {
> Display display = new Display();
> Shell shell = new Shell(display);
>
> SashForm sashForm;
> SashForm sashForm2;
>
> public SashFormExample() {
> }
>
> public static void main(String[] args) {
> new SashFormExample();
> }
>
> @Override
> public int createUI() {
>
> shell.setLayout(new FillLayout());
>
> sashForm = new SashForm(shell, SWT.HORIZONTAL);
>
> TreeViewer text1 = new TreeViewer(sashForm, SWT.BORDER);
> text1.getTree().setItemCount(25);
>
> Text text2 = new Text(sashForm,
> SWT.CENTER|SWT.BORDER|SWT.MULTI|SWT.V_SCROLL);
> text2.setText("Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" +
> "Text in pane #2\n" );
>
> sashForm.setWeights(new int[]{1, 2});
>
> shell.setSize(450, 200);
> shell.open();
> //textUser.forceFocus();
>
> // Set up the event loop.
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) {
> // If no more entries in event queue
> display.sleep();
> }
> }
>
> display.dispose();
> return 0;
> }
> }
> -----------------------------
>
> ------------------------------------------------------------ ------------
>
>
> ------------------------------------------------------------ ------------
>
Re: Rendering of TreeViewer on SashForm [message #123155 is a reply to message #123143] Thu, 26 February 2009 10:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Hi Ralf,

I am using RAP Version 1.2.0-M5-20090210-1243. No custom Themes. What
else could I check?

Greetings,
Björn

Ralf Sternberg schrieb:
> Hi Björn,
>
> your snippet renders fine here. Which version do you use? Any custom themes?
>
> Ralf
Re: Rendering of TreeViewer on SashForm [message #123227 is a reply to message #123155] Thu, 26 February 2009 14:47 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

Björn Fischer wrote:
> I am using RAP Version 1.2.0-M5-20090210-1243. No custom Themes. What
> else could I check?

Could you check with latest CVS? As we cannot reproduce the problem here
chances are that this has been fixed by a change in the SashFolder past M5.

Regards, Ralf
Re: Rendering of TreeViewer on SashForm [message #123861 is a reply to message #123227] Fri, 06 March 2009 13:45 Go to previous message
Eclipse UserFriend
Originally posted by: bjoern.bjoernfischer.de

Ralf Sternberg schrieb:
> Hi,
>
> Björn Fischer wrote:
>> I am using RAP Version 1.2.0-M5-20090210-1243. No custom Themes. What
>> else could I check?
>
> Could you check with latest CVS? As we cannot reproduce the problem here
> chances are that this has been fixed by a change in the SashFolder past M5.
>
> Regards, Ralf

Hi Ralf,
I checked against current CVS version and this issue seems to be fixed.

Thanks for your advice!

Björn
Previous Topic:How to get onto GUI Event Thread from non UI thread...
Next Topic:Changing images for check box and radio button
Goto Forum:
  


Current Time: Thu Apr 25 00:35:13 GMT 2024

Powered by FUDForum. Page generated in 0.03045 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top