Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » CreatePartControl
CreatePartControl [message #314289] Fri, 06 April 2007 06:08 Go to next message
Eclipse UserFriend
Hi all,

I am writing an eclipse plugin creating its own view. I would like to know
if there is one way to get the size of the parent Composite give me as
parameter inside the create part control method. In fact i supposed that
once this method is finished the composite must be layed out .... ?

I really need to know the size inside the create part control method
itself and not after ....

Thanks in advance

Manuel Selva
Re: CreatePartControl [message #314296 is a reply to message #314289] Fri, 06 April 2007 07:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Manuel,

Does Control.getSize() help? (Doesn't your control need to respond to
resize changes by laying out properly?)


Manuel Selva wrote:
> Hi all,
>
> I am writing an eclipse plugin creating its own view. I would like to
> know if there is one way to get the size of the parent Composite give
> me as parameter inside the create part control method. In fact i
> supposed that once this method is finished the composite must be layed
> out .... ?
>
> I really need to know the size inside the create part control method
> itself and not after ....
>
> Thanks in advance
>
> Manuel Selva
>
>
Re: CreatePartControl [message #314297 is a reply to message #314296] Fri, 06 April 2007 08:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

My control need to know the available size to choose what will be
displayed. The getSize method is all i need but still return (0,00 inside
the createPartControl.

Manuel
Re: CreatePartControl [message #314298 is a reply to message #314297] Fri, 06 April 2007 08:14 Go to previous messageGo to next message
Eclipse UserFriend
Point s = Control#computeSize(SWT.DEFAULT,SWT.DEFAULT,true);

Manuel Selva schrieb:
> Hi,
>
> My control need to know the available size to choose what will be
> displayed. The getSize method is all i need but still return (0,00
> inside the createPartControl.
>
> Manuel
>


--
B e s t S o l u t i o n . a t EDV Systemhaus GmbH
----------------------------------------------------
tom schindl Eclipse JFace Committer
Re: CreatePartControl [message #314517 is a reply to message #314289] Mon, 16 April 2007 12:36 Go to previous message
Eclipse UserFriend
Manuel Selva wrote:
> Hi all,
>
> I am writing an eclipse plugin creating its own view. I would like to
> know if there is one way to get the size of the parent Composite give me
> as parameter inside the create part control method. In fact i supposed
> that once this method is finished the composite must be layed out .... ?

Eclipse doesn't really use that pattern ... sometime after
createPartControl(*) is called, the workbench will call parent.layout()
(any number of times, or resize of window, etc).

Normally, you create a child composite off of "parent" and then set the
appropriate layout manager on it, so you can respond to layout requests.
GridLayout and FormLayout are 2 of the most useful layouts for specific
positioning of controls.

2 other options that *might* work ... one is to create your view
composite as some kind of scrolled composite. Then you can set the size
of your view controls, and the scrolled composite can resize with the
view. The other is to attach a resize listener to the parent composite
.... and respond to resize events (which will be many).

Later,
PW
Previous Topic:Team Private & Synchronization
Next Topic:menuContribution for dynamic context menus
Goto Forum:
  


Current Time: Sun Nov 09 04:20:57 EST 2025

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

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

Back to the top