Search in sources :

Example 1 with CarEntity

use of org.eclipse.scout.rt.client.services.common.search.DefaultSearchFilterServiceTest.MyComposerField.CarEntity in project scout.rt by eclipse.

the class DefaultSearchFilterServiceTest method testComposerField.

@Test
public void testComposerField() {
    MyComposerField composer = new MyComposerField();
    composer.initField();
    runBasicAsserts(composer);
    CarEntity carEntity = composer.new CarEntity();
    ITreeNode carNode = composer.addEntityNode(composer.getTree().getRootNode(), carEntity, true, Collections.emptyList(), new ArrayList<String>());
    composer.addAttributeNode(carNode, carEntity.new ColorAttribute(), DataModelConstants.AGGREGATION_NONE, DataModelAttributeOp.create(DataModelConstants.OPERATOR_EQ), CollectionUtility.arrayList("blue key"), CollectionUtility.arrayList("blue value"));
    m_searchFilterService.applySearchDelegate(composer, m_searchFilter, false);
    StringBuilder result = new StringBuilder();
    new ComposerDisplayTextBuilder().build(composer.getTree().getRootNode(), result, "");
    Assert.assertEquals(result.toString().trim(), m_searchFilter.getDisplayTextsPlain());
}
Also used : CarEntity(org.eclipse.scout.rt.client.services.common.search.DefaultSearchFilterServiceTest.MyComposerField.CarEntity) ITreeNode(org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode) ComposerDisplayTextBuilder(org.eclipse.scout.rt.client.ui.form.fields.composer.internal.ComposerDisplayTextBuilder) Test(org.junit.Test)

Aggregations

CarEntity (org.eclipse.scout.rt.client.services.common.search.DefaultSearchFilterServiceTest.MyComposerField.CarEntity)1 ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)1 ComposerDisplayTextBuilder (org.eclipse.scout.rt.client.ui.form.fields.composer.internal.ComposerDisplayTextBuilder)1 Test (org.junit.Test)1