[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] visibility of controls tied to focus?

Guys,

I've built a custom layout manager that is actually quite simple. It lays
out its children in one column stacked one on top of the other. However,
using custom layout data objects, you can specify an order in which these
controls will be shown (regardless of the order in which they were added).
This layout manager is used on the Composite I use in my EditorPart...

Whilst building this layout manager, I decided to go one step further and
correct a deficiency that I had observed in the GridLayout manager. Namely
the fact that regardless of the visibility of a Control, the grid layout
will include the control in its computeSize method, and will setBounds on it
in the layout method.

So, in my custom layout manager, I decided to test for the visibility of the
children, and if they were invisible, I would just skip over them, excluding
them from being counted when computing size, and excluding them from being
laid out... they are invisible after all!!

Anyway, to my dismay, I've found that Controls can be invisible VERY
OFTEN,... especially when I'm not expecting it, ie: in the Outline view in
the workbench for my custom editor, I double click on a selection, and
create the editor page, this involves creating multiple layers of my own
subclasses of Composite.... what I am finding is that these composites are
being constructed initially with isVisible() returning FALSE! I gather that
is because the parent of the Composite is not visible.... so, it would seem
that since I'm double clicking in the Outline view, the Outline view has
focus, not the editor page, and therefore the editor page is set to be
invisible??

Somehow that just doesn't make sense to me..... if someone could explain the
semantics of the visible flag, I would greatly appreciate it..... perhaps
I'm approaching this from the wrong direction.

Thank you,

G