Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ve-dev] Codegen for GridBagConstraint

Hello,

We have ULCGridBagLayoutPane container.

When we add a component, say ULCLabel, to that container, we would like to
generate:

	In the getUlcGridBagLayoutPane() method:

	   GridBagConstraints gbc1 = new GridBagConstraints();
	   add(getUlcLabel(), gbc1);

I am able to generate (like you do when a comp is added to container in Bean
Tree):

 	add(getUlcLabel(), new GridBagLayoutConstraints());

But how do I generate (like you do when a comp is added to container in
canvas):

   GridBagConstraints gbc1 = new GridBagConstraints();
   add(getUlcLabel(), gbc1);


Both GridBagConstraints and ULCGridBagLayoutPane are beans in ULC.

Do I need to specify something special in GridBagConstraints.override to be
able to generate a local variable in method?

----------------

I looked up Eclipse VE for swing.

It seems that when adding to a container with GridbagLayout, you are
generating commands to create:

    GridBagConstraints gbc1 = new GridBagConstraints();

in VCEPreset command.

It gets the GridBagConstraints object from ConstraintsComponent and somehow
creates commands that makes the container getter method (getJPanel())
initialiser  of GridBagConstraints and makes GridBagConstraints the member
of that method.

Could you please explain what is it that triggers GridBagConstraint to be
generated as local variable?

I checked overrides for GridBagLayout and GridBagConstraints but could not
find anything special.


Prompt reply will be appreciated.

Thanks and regards,

Janak



Back to the top