Skip to content

Adding components to Node created by GraphicFactory #274

@deadpoll

Description

@deadpoll

Hi Tomas,

I'm creating a custom graphic factory much more complicated than your LineNumberFactory example, in that rather than just create a Label, it creates a Pane which contains Labels and HBoxes etc.

Throughout the life of the application, the user can perform certain actions on each line, and one of these actions requires the addition of new components into the Pane aforementioned above.

The scenario is: the user right clicks on a line and chooses an action from the displayed context menu. The action attempts to add a Label to the HBox within the Pane, however 50% of the time (possibly even less) the Label does not get rendered. What I found was that I needed to resize the height of the codearea so that it was compressed small enough so that the Pane in question was being hidden, and it was only when I then expanded it back out (making the Pane visible again) that the apply() method within the graphic factory was fired, and hence the Label was then properly rendered.

I must note that the action in question did not involve removing or adding new lines. I've tried calling requestLayout() and layout()/layoutChildren() after adding the Label but that doesn't seem to implicitly call the apply() method.

Could you please help me in this matter? I don't understand why most of the time the Label isn't displayed immediately. Any help would be greatly appreciated. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions