use of org.linkki.core.ui.section.descriptor.ElementDescriptor in project linkki by linkki-framework.
the class FieldDescriptorTest method getLabelText_addSuffixOnlyIfNecessary.
@Test
public void getLabelText_addSuffixOnlyIfNecessary() {
ElementDescriptor fieldDescriptor = new ElementDescriptor(adapter, "Test:", Void.class, new ArrayList<>());
assertEquals("Test:", fieldDescriptor.getLabelText());
}
use of org.linkki.core.ui.section.descriptor.ElementDescriptor in project linkki by linkki-framework.
the class FieldDescriptorTest method getPropertyName_byMethodName.
@Test
public void getPropertyName_byMethodName() {
ElementDescriptor fieldDescriptor = new ElementDescriptor(adapter, "Test", Void.class, new ArrayList<>());
assertEquals("Test", fieldDescriptor.getModelPropertyName());
}
use of org.linkki.core.ui.section.descriptor.ElementDescriptor in project linkki by linkki-framework.
the class FieldDescriptorTest method getPropertyName_favorModelAttribute.
@Test
public void getPropertyName_favorModelAttribute() {
when(adapter.modelAttribute()).thenReturn("xyz");
ElementDescriptor fieldDescriptor = new ElementDescriptor(adapter, "Test", Void.class, new ArrayList<>());
assertEquals("xyz", fieldDescriptor.getModelPropertyName());
}
use of org.linkki.core.ui.section.descriptor.ElementDescriptor in project linkki by linkki-framework.
the class BindingContextTest method testBind_BoundComponentsAreMadeImmediate.
@Test
public void testBind_BoundComponentsAreMadeImmediate() {
setUpPmo();
TextField field = new TextField();
BindingDefinition fieldDefintion = mock(BindingDefinition.class);
when(fieldDefintion.required()).thenReturn(RequiredType.REQUIRED);
when(fieldDefintion.enabled()).thenReturn(EnabledType.ENABLED);
when(fieldDefintion.visible()).thenReturn(VisibleType.VISIBLE);
ElementDescriptor fieldDescriptor = new ElementDescriptor(fieldDefintion, "value", Void.class, new ArrayList<>());
// Precondition
assertThat(field.isImmediate(), is(false));
context.bind(pmo, fieldDescriptor, new LabelComponentWrapper(field));
assertThat(field.isImmediate(), is(true));
}
use of org.linkki.core.ui.section.descriptor.ElementDescriptor in project linkki by linkki-framework.
the class FieldDescriptorTest method getLabelText_deriveFromLabel.
@Test
public void getLabelText_deriveFromLabel() {
when(adapter.label()).thenReturn("blablub");
ElementDescriptor fieldDescriptor = new ElementDescriptor(adapter, "xyz", Void.class, new ArrayList<>());
assertEquals("blablub", fieldDescriptor.getLabelText());
}
Aggregations