Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Size of ViewPart
Size of ViewPart [message #461328] Tue, 09 January 2007 06:23 Go to next message
Eclipse UserFriend
Hello,

is it possible to get the size of a specific ViewPart?

i want to create a ScrolledComposite inside this ViewPart,
so i have to set the ScrolledComposite's Size to enable the Scrollbars.

Any Ideas?
Kai
Re: Size of ViewPart [message #461344 is a reply to message #461328] Tue, 09 January 2007 10:00 Go to previous messageGo to next message
Eclipse UserFriend
If you save the parent Composite passed in createPartControl(*) you can
put a resize listener on it ... once the view is layed out, then you
will know your size.

PW
Re: Size of ViewPart [message #461356 is a reply to message #461344] Tue, 09 January 2007 13:18 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster schrieb:
> If you save the parent Composite passed in createPartControl(*) you can
> put a resize listener on it ... once the view is layed out, then you
> will know your size.

parent.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event e) {
System.out.println("resize: " + e);
}
});

only produces width=0 / height=0 ?

kai
Re: Size of ViewPart [message #461357 is a reply to message #461356] Tue, 09 January 2007 13:59 Go to previous messageGo to next message
Eclipse UserFriend
Kai Meder wrote:
>
> parent.addListener(SWT.Resize, new Listener() {
> public void handleEvent(Event e) {
> System.out.println("resize: " + e);
> }
> });
>

Does it still produce that if you grab one of the sashes and resize your
view? That won't help you with your original question, but tells us if
we're on the correct track.

Maybe by the time your view part setFocus() method is called, you would
be able to ask the parent for its size?

Later,
PW
Re: Size of ViewPart [message #461507 is a reply to message #461357] Wed, 10 January 2007 19:33 Go to previous message
Eclipse UserFriend
Paul Webster schrieb:
> Kai Meder wrote:
>>
>> parent.addListener(SWT.Resize, new Listener() {
>> public void handleEvent(Event e) {
>> System.out.println("resize: " + e);
>> }
>> });
>>
>
> Does it still produce that if you grab one of the sashes and resize your
> view? That won't help you with your original question, but tells us if
> we're on the correct track.
we were, thank you very much.

parent.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event e) {
System.out.println(parent.getSize());
}
});

just the event-object is messed up...

yours,
kai
Previous Topic:Setting -debug correctly in order to debug one plugin
Next Topic:How to remove WorkingSets actions from RCP application menu and toolbar
Goto Forum:
  


Current Time: Wed Mar 26 07:18:01 EDT 2025

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

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

Back to the top