Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] Help with generating complex constraint objects


Hi,

Sorry, but the current code parsing doesn't understand method calls to anything other than  getControl().getName() for the constraint argument in the add call. It only understands the getName() against a component and field references and literals like String and numbers and new class creation calls.

So if you change to instead of your format to (Note: This is in VE 1.2. I don't know if this works in VE 1.1, we made many changes since then):

jPanel.add(getJButton1(), new CellConstraint(1,1))

we would be able to parse and understand this, assuming the FormLayout you created would take a "CellConstraint" as a constraint.

You can open an enhancement request against VE to allow method calls there instead.

Rich


Gerald Rosenberg <gerald@xxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

05/31/2006 02:48 AM

Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>

To
ve-dev@xxxxxxxxxxx
cc
Subject
[ve-dev] Help with generating complex constraint objects





Working on implementing

protected
IJavaObjectInstance convertConstraint(Object constraint) {

in FormLayoutPolicyHelper.  Given that the "constraint" parameter is of type CellConstraints, and is a singleton, how do I specify the further qualification of the constraint

1) to use a particular method, in this case ".xy(int col, int row)",
2) with assigned method parameters of my choice, and
3) yield an IJavaObjectsInstance.  

None of the existing layouts provide a reasonably close example.  

An example of the desired form of the jPanel.add(Component c, Constraint cc) statements to be generated by VE:

private JPanel getJPanel() {
if (jPanel == null) {
String colSpec = "...";
String rowSpec = "...";
FormLayout formLayout = new FormLayout(colSpec, rowSpec);
CellConstraints cc = new CellConstraints();
jPanel = new JPanel();
jPanel.setLayout(formLayout);
jPanel.add(getJButton1(), cc.xy(1,1)); // add at col 1, row 1
jPanel.add(getJButton2(), cc.xy(2,1)); // add at col 2, row 1
}
return jPanel;
}

Thanks,
Gerald

----
Gerald B. Rosenberg
Certiv Analytics

www.certiv.net_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top