use of org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm.MainBox.SecondTemplateBox in project scout.rt by eclipse.
the class MoveFormFieldTest method testMultiTemplateUsageFormMoveTopStringFieldInFirstTemplateBoxUsingOverspecifiedClassIdentifier.
@Test
public void testMultiTemplateUsageFormMoveTopStringFieldInFirstTemplateBoxUsingOverspecifiedClassIdentifier() throws Exception {
BEANS.get(IExtensionRegistry.class).registerMove(new ClassIdentifier(MultiTemplateUsageForm.class, MultiTemplateUsageForm.MainBox.class, FirstTemplateBox.class, TopStringField.class), 30d);
MultiTemplateUsageForm form = new MultiTemplateUsageForm();
assertEquals(3, form.getMainBox().getFieldCount());
assertSame(form.getFirstTemplateBox(), form.getMainBox().getFields().get(0));
assertSame(form.getSecondTemplateBox(), form.getMainBox().getFields().get(1));
assertSame(form.getMainBoxStringField(), form.getMainBox().getFields().get(2));
// first template box
FirstTemplateBox firstTemplateBox = form.getFirstTemplateBox();
assertEquals(3, firstTemplateBox.getFieldCount());
assertSame(firstTemplateBox.getTopFieldsBox(), firstTemplateBox.getFields().get(0));
assertSame(form.getMiddleStringField(), firstTemplateBox.getFields().get(1));
assertSame(firstTemplateBox.getBottomFieldsBox(), firstTemplateBox.getFields().get(2));
// top fields box in first template box
assertAbstractTemplateFieldsBox(firstTemplateBox.getTopFieldsBox(), false);
assertAbstractTemplateFieldsBox(firstTemplateBox.getBottomFieldsBox(), false);
// second template box
SecondTemplateBox secondTemplateBox = form.getSecondTemplateBox();
assertEquals(2, secondTemplateBox.getFieldCount());
assertSame(secondTemplateBox.getTopFieldsBox(), secondTemplateBox.getFields().get(0));
assertSame(secondTemplateBox.getBottomFieldsBox(), secondTemplateBox.getFields().get(1));
// top fields box in first template box
assertAbstractTemplateFieldsBox(secondTemplateBox.getTopFieldsBox(), true);
assertAbstractTemplateFieldsBox(secondTemplateBox.getBottomFieldsBox(), true);
}
Aggregations