Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Scrollbars in Composite?
Scrollbars in Composite? [message #79519] Thu, 27 March 2008 17:16 Go to next message
Mike Wrighton is currently offline Mike WrightonFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,

I'm trying to implement a console view where text can be appended, but
the Composite.getVerticalBar() method seems to be missing from RAP. Any
ideas?

Thanks,
Mike
Re: Scrollbars in Composite? [message #79595 is a reply to message #79519] Fri, 28 March 2008 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi Mike,

sorry to say so, but the getVerticalBar/getHorizontalBar methods are
not yet implemented in RAP.
Depending on what and how exactly you want to achieve, the
ScrolledComposite widget might help. In case you plan to implement a
custom widget, you could do the scrolling by yourself.

Cheers,
Rüdiger

Mike Wrighton wrote:
> Hi,
>
> I'm trying to implement a console view where text can be appended, but
> the Composite.getVerticalBar() method seems to be missing from RAP. Any
> ideas?
>
> Thanks,
> Mike
Re: Scrollbars in Composite? [message #79654 is a reply to message #79519] Fri, 28 March 2008 09:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

unfortunately this is not available from the current Composite
implementation. Feel free to file a feature request. One thing I could
think of is to use the ScrolledComposite since this implements
getVerticalBar() but I don't know whether this fits your needs, though.


Ciao
Frank


-----Ursprüngliche Nachricht-----
Von: Mike Wrighton [mailto:mike.wrighton@googlemail.com]
Bereitgestellt: Donnerstag, 27. März 2008 18:17
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Scrollbars in Composite?
Betreff: Scrollbars in Composite?


Hi,

I'm trying to implement a console view where text can be appended, but
the Composite.getVerticalBar() method seems to be missing from RAP. Any
ideas?

Thanks,
Mike
Re: Scrollbars in Composite? [message #80214 is a reply to message #79654] Mon, 31 March 2008 09:46 Go to previous messageGo to next message
Mike Wrighton is currently offline Mike WrightonFriend
Messages: 19
Registered: July 2009
Junior Member
Thanks, I've tried to wrap the Text widget in a ScrolledComposite and it
looks fine but I have no control over the scroll bars e.g.
scroller.getVerticalBar().setOrigin() has no effect. My code for setting
it up is as follows:

public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
scroller = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
console = new Text(scroller, SWT.WRAP);
scroller.setContent(console);
scroller.setExpandHorizontal(true);
scroller.setExpandVertical(true);
}



Frank Appel wrote:
> Hi,
>
> unfortunately this is not available from the current Composite
> implementation. Feel free to file a feature request. One thing I could
> think of is to use the ScrolledComposite since this implements
> getVerticalBar() but I don't know whether this fits your needs, though.
>
>
> Ciao
> Frank
>
>
> -----Ursprüngliche Nachricht-----
> Von: Mike Wrighton [mailto:mike.wrighton@googlemail.com]
> Bereitgestellt: Donnerstag, 27. März 2008 18:17
> Bereitgestellt in: eclipse.technology.rap
> Unterhaltung: Scrollbars in Composite?
> Betreff: Scrollbars in Composite?
>
>
> Hi,
>
> I'm trying to implement a console view where text can be appended, but
> the Composite.getVerticalBar() method seems to be missing from RAP. Any
> ideas?
>
> Thanks,
> Mike
>
Re: Scrollbars in Composite? [message #80257 is a reply to message #80214] Mon, 31 March 2008 11:21 Go to previous message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi Mike,

the getVerticalBar#setOrigin method isn't implemented yet. I guess
you tried ScrolledComposite#setOrigin(x,y).
I did some investigations with code, based your snippet, but also
couldn't get it to do what I wanted to.

parent.setLayout( new FillLayout() );
scroller = new ScrolledComposite( parent, SWT.H_SCROLL
| SWT.V_SCROLL );
scroller.addControlListener( new ControlAdapter() {
public void controlResized( ControlEvent e ) {
Rectangle parentBounds = scroller.getClientArea();
scroller.setMinSize( parent.computeSize( parentBounds.width,
SWT.DEFAULT ) );
}
} );
console = new Text( scroller, SWT.WRAP );
String text = "";
for( int i = 0; i < 400; i++ ) {
text += "line" + i + "\n";
}
console.setText( text );
scroller.setContent( console );
scroller.setExpandHorizontal( true );
scroller.setExpandVertical( true );
scroller.setOrigin( 0, 200 );

The setOrigin() call seems to be ignored at all, and the text widget
starts to scroll by itself from time to time, but I haven't had the
time to dig deeper into this.
I you have a snippet that works properly on SWT, but doesn't do its
job in RAP, feel free to file a bug.

Cheers,
Rüdiger


Mike Wrighton wrote:
> Thanks, I've tried to wrap the Text widget in a ScrolledComposite and it
> looks fine but I have no control over the scroll bars e.g.
> scroller.getVerticalBar().setOrigin() has no effect. My code for setting
> it up is as follows:
>
> public void createPartControl(Composite parent) {
> parent.setLayout(new FillLayout());
> scroller = new ScrolledComposite(parent, SWT.H_SCROLL |
> SWT.V_SCROLL);
> console = new Text(scroller, SWT.WRAP);
> scroller.setContent(console);
> scroller.setExpandHorizontal(true);
> scroller.setExpandVertical(true);
> }
>
>
>
> Frank Appel wrote:
>> Hi,
>>
>> unfortunately this is not available from the current Composite
>> implementation. Feel free to file a feature request. One thing I could
>> think of is to use the ScrolledComposite since this implements
>> getVerticalBar() but I don't know whether this fits your needs, though.
>>
>>
>> Ciao
>> Frank
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Mike Wrighton [mailto:mike.wrighton@googlemail.com]
>> Bereitgestellt: Donnerstag, 27. März 2008 18:17
>> Bereitgestellt in: eclipse.technology.rap
>> Unterhaltung: Scrollbars in Composite?
>> Betreff: Scrollbars in Composite?
>>
>>
>> Hi,
>>
>> I'm trying to implement a console view where text can be appended, but
>> the Composite.getVerticalBar() method seems to be missing from RAP. Any
>> ideas?
>>
>> Thanks,
>> Mike
>>
Previous Topic:Tomcat Deployment problem
Next Topic:Webinar - Getting Started with RAP - April 2nd 2008
Goto Forum:
  


Current Time: Fri Apr 26 09:38:34 GMT 2024

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

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

Back to the top