use of org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm in project scout.rt by eclipse.
the class MoveFormFieldTest method testMultiTemplateUsageFormSetup.
@Test
public void testMultiTemplateUsageFormSetup() throws Exception {
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(), true);
assertAbstractTemplateFieldsBox(firstTemplateBox.getBottomFieldsBox(), true);
// 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);
}
use of org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm in project scout.rt by eclipse.
the class MoveFormFieldTest method testMultiTemplateUsageFormMoveWithDeepLinkedTarget.
@Test
public void testMultiTemplateUsageFormMoveWithDeepLinkedTarget() throws Exception {
BEANS.get(IExtensionRegistry.class).registerMove(new ClassIdentifier(MainBoxStringField.class), 15d, new ClassIdentifier(SecondTemplateBox.class, TopFieldsBox.class));
MultiTemplateUsageForm form = new MultiTemplateUsageForm();
assertClasses(form.getMainBox().getFields(), FirstTemplateBox.class, SecondTemplateBox.class);
// first template box
FirstTemplateBox firstTemplateBox = form.getFirstTemplateBox();
assertClasses(firstTemplateBox.getFields(), TopFieldsBox.class, MiddleStringField.class, BottomFieldsBox.class);
assertClasses(firstTemplateBox.getTopFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
assertClasses(firstTemplateBox.getBottomFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
// second template box
SecondTemplateBox secondTemplateBox = form.getSecondTemplateBox();
assertClasses(secondTemplateBox.getFields(), TopFieldsBox.class, BottomFieldsBox.class);
assertClasses(secondTemplateBox.getTopFieldsBox().getFields(), TopStringField.class, MainBoxStringField.class, BottomStringField.class);
assertClasses(secondTemplateBox.getBottomFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
}
use of org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm in project scout.rt by eclipse.
the class MoveFormFieldTest method testMultiTemplateUsageFormMoveFirstBoxAndTopStringField.
@Test
public void testMultiTemplateUsageFormMoveFirstBoxAndTopStringField() throws Exception {
BEANS.get(IExtensionRegistry.class).registerMove(AbstractTemplateFieldsBox.TopStringField.class, 30d, null);
BEANS.get(IExtensionRegistry.class).registerMove(AbstractTemplateGroupsBox.TopFieldsBox.class, 30d, null);
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(form.getMiddleStringField(), firstTemplateBox.getFields().get(0));
assertSame(firstTemplateBox.getBottomFieldsBox(), firstTemplateBox.getFields().get(1));
assertSame(firstTemplateBox.getTopFieldsBox(), 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.getBottomFieldsBox(), secondTemplateBox.getFields().get(0));
assertSame(secondTemplateBox.getTopFieldsBox(), secondTemplateBox.getFields().get(1));
// top fields box in first template box
assertAbstractTemplateFieldsBox(secondTemplateBox.getTopFieldsBox(), false);
assertAbstractTemplateFieldsBox(secondTemplateBox.getBottomFieldsBox(), false);
}
use of org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm in project scout.rt by eclipse.
the class ExtendFormWithDeepLinkingTest method testSetup.
@Test
public void testSetup() throws Exception {
MultiTemplateUsageForm form = new MultiTemplateUsageForm();
assertTypes(form.getMainBox().getFields(), FirstTemplateBox.class, SecondTemplateBox.class, MainBoxStringField.class);
// first template box
FirstTemplateBox firstTemplateBox = form.getFirstTemplateBox();
assertTypes(firstTemplateBox.getFields(), TopFieldsBox.class, MiddleStringField.class, BottomFieldsBox.class);
assertTypes(firstTemplateBox.getTopFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
assertTypes(firstTemplateBox.getBottomFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
// second template box
SecondTemplateBox secondTemplateBox = form.getSecondTemplateBox();
assertTypes(secondTemplateBox.getFields(), TopFieldsBox.class, BottomFieldsBox.class);
assertTypes(secondTemplateBox.getTopFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
assertTypes(secondTemplateBox.getBottomFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
}
use of org.eclipse.scout.rt.client.extension.ui.form.fixture.MultiTemplateUsageForm in project scout.rt by eclipse.
the class ExtendFormWithDeepLinkingTest method testContributeOnlyToOneTemplateUsage.
@Test
public void testContributeOnlyToOneTemplateUsage() throws Exception {
BEANS.get(IExtensionRegistry.class).register(ContributedTestField.class, new ClassIdentifier(TopFieldsBox.class, AbstractTemplateFieldsBox.class), null);
MultiTemplateUsageForm form = new MultiTemplateUsageForm();
assertTypes(form.getMainBox().getFields(), FirstTemplateBox.class, SecondTemplateBox.class, MainBoxStringField.class);
// first template box
FirstTemplateBox firstTemplateBox = form.getFirstTemplateBox();
assertTypes(firstTemplateBox.getFields(), TopFieldsBox.class, MiddleStringField.class, BottomFieldsBox.class);
assertTypes(firstTemplateBox.getTopFieldsBox().getFields(), TopStringField.class, BottomStringField.class, ContributedTestField.class);
assertTypes(firstTemplateBox.getBottomFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
// second template box
SecondTemplateBox secondTemplateBox = form.getSecondTemplateBox();
assertTypes(secondTemplateBox.getFields(), TopFieldsBox.class, BottomFieldsBox.class);
assertTypes(secondTemplateBox.getTopFieldsBox().getFields(), TopStringField.class, BottomStringField.class, ContributedTestField.class);
assertTypes(secondTemplateBox.getBottomFieldsBox().getFields(), TopStringField.class, BottomStringField.class);
}
Aggregations