Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Layout managers
Layout managers [message #166993] Fri, 04 February 2005 12:35 Go to next message
Eclipse UserFriend
Originally posted by: bartgolsteijn.hotmail.com

I am creating an editor in which areas can be drawn in which widgets or
other areas can be placed. Each area should have its own layout manager.
At the moment, these sub areas are Figures. I want an item in the
Properties view that allows me to choose a layout manager for each area.
Now I have 2 questions:

(1) Is their a way to query GEF / Draw2D for all installed layoutmanagers
and use the result as input for a property editor?
(2) How can I change the layout manager of an Figure that accepts
components to be placed in it and supports dragging of its children? (Only
calling setLayoutManager(...) is not enough. I have looked at the Shapes
example, but that approach seems only to work for Freeform/XY layout).

Any help is appreciated.

Bart Golsteijn
Re: Layout managers [message #167145 is a reply to message #166993] Sun, 06 February 2005 07:05 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
"Bart Golsteijn" <bartgolsteijn@hotmail.com> wrote in message
news:ctvq6d$mm8$1@www.eclipse.org...
> I am creating an editor in which areas can be drawn in which widgets or
> other areas can be placed. Each area should have its own layout manager.
> At the moment, these sub areas are Figures. I want an item in the
> Properties view that allows me to choose a layout manager for each area.
> Now I have 2 questions:
>
> (1) Is their a way to query GEF / Draw2D for all installed layoutmanagers
> and use the result as input for a property editor?

Sure. JDT does it for its heirarchy view. Just look for concrete
implementors of the LayoutManager interface. Of course, this will also find
layouts that are anonymouse inner classes, or specific to certain things
(scrollbar layout, ruler layout, etc.). So, you'll have to do some
filtering. Maybe you can just restrict the search to the org.eclipse.draw2d
package. Or perhaps you can just pre-define the list of generic layouts -
stack, toolbar, border, flow, etc.

> (2) How can I change the layout manager of an Figure that accepts
> components to be placed in it and supports dragging of its children? (Only
> calling setLayoutManager(...) is not enough. I have looked at the Shapes
> example, but that approach seems only to work for Freeform/XY layout).

You'll have to update the child constraints, if there are any, to be
meaningful for the new layout. You might have to switch (or add/remove) an
editpolicy too, or just use the state pattern for the edit policy that shows
the drag target feedback. Take a look at the feedback that a FlowContainer
in the logic example shows when you drags its children. Of course, dragging
doesn't make sense for all layouts (such as stack), so you'll have to act
accordingly.

>
> Any help is appreciated.
>
> Bart Golsteijn
>
>
>
Previous Topic:where is the code that put presentation properties in the flow example
Next Topic:ContentPane and layout problems/questions
Goto Forum:
  


Current Time: Thu Apr 25 10:33:10 GMT 2024

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

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

Back to the top