target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testCreateSection_SectionHasAddButtonInHeader() { TestTablePmo containerPmo = new TestTablePmo(); BindingContext bindingContext = new BindingContext(); PmoBasedSectionFactory factory = new PmoBasedSectionFactory(); AbstractSection tableSection = factory.createSection(containerPmo, bindingContext); ass...
@Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
@SuppressWarnings("deprecation") @Test public void testCreateSection_NoAnnotation() { NoAnnotationTablePmo containerPmo = new NoAnnotationTablePmo(); BindingContext bindingContext = new BindingContext(); PmoBasedSectionFactory factory = new PmoBasedSectionFactory(); AbstractSection tableSection = factory.createSection(...
@Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
@Test public void testCreateSectionHeader() { TestTablePmo containerPmo = new TestTablePmo(); BindingContext bindingContext = new BindingContext(); PmoBasedSectionFactory factory = new PmoBasedSectionFactory(); AbstractSection tableSection = factory.createSection(containerPmo, bindingContext); HorizontalLayout header =...
@Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
@Test public void testBackupListShouldBeClearedOnRemoveAllItems() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); container.setItems(Collections.singletonList(new TestItem())); assertThat(container.getItemIds(), hasSize(1)); container.setItems(Collections.emptyList()); assertThat(contai...
public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllItemIds().clear(); getAllItemIds().addAll(items); fireItemSetChange(); }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
@Test public void testEqualsOfWrapperShouldOnlyCheckReference() { TestItem testItem = new TestItem(42); LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); container.setItems(Collections.singletonList(testItem)); TestItem equalItem = new TestItem(42); assertThat(testItem, is(equalItem)); asse...
public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllItemIds().clear(); getAllItemIds().addAll(items); fireItemSetChange(); }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { public void setItems(Collection<? extends T> items) { requireNonNull(items, "items must not be null"); this.roots = new ArrayList<>(items); getAllI...
@Test public void testGetChildren_ofItemNotContained() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); assertThat(container.getChildren(new TestItem(42)), is(empty())); }
@Override @SuppressWarnings({ "unchecked" }) public Collection<T> getChildren(Object itemId) { List<T> newChildren = children.computeIfAbsent((T)itemId, this::getChildrenTypesafe); newChildren.forEach(c -> { if (!containsId(c)) { getAllItemIds().add(c); } }); return newChildren; }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override @SuppressWarnings({ "unchecked" }) public Collection<T> getChildren(Object itemId) { List<T> newChildren = children.computeIfAbsent((T)it...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override @SuppressWarnings({ "unchecked" }) public Collection<T> getChildren(Object itemId) { List<T> newChildren = children.computeIfAbsent((T)it...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override @SuppressWarnings({ "unchecked" }) public Collection<T> getChildren(Object itemId) { List<T> newChildren = children.computeIfAbsent((T)it...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override @SuppressWarnings({ "unchecked" }) public Collection<T> getChildren(Object itemId) { List<T> newChildren = children.computeIfAbsent((T)it...
@Test public void testGetParent_ofItemNotContained() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); assertThat(container.getParent(new TestItem(42)), is(nullValue())); }
@CheckForNull @Override public T getParent(Object itemId) { return parents.get(itemId); }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @CheckForNull @Override public T getParent(Object itemId) { return parents.get(itemId); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @CheckForNull @Override public T getParent(Object itemId) { return parents.get(itemId); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @CheckForNull @Override public T getParent(Object itemId) { return parents.get(itemId); } @Override Collection<?> getContainerPropertyIds(); void ...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @CheckForNull @Override public T getParent(Object itemId) { return parents.get(itemId); } @Override Collection<?> getContainerPropertyIds(); void ...
@Test public void testSetParent() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); HierarchicalTestItem testItem1 = new HierarchicalTestItem(23); HierarchicalTestItem testItem2 = new HierarchicalTestItem(42); assertThat(container.setParent(testItem1, testItem2), is(false)); }
@Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return false; }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return false; } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return false; } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return false; } @Override Collection<...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return false; } @Override Collection<...
@Test public void testAreChildrenAllowed_ofItemNotContained() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); assertThat(container.areChildrenAllowed(new TestItem(42)), is(false)); }
@Override public boolean areChildrenAllowed(Object itemId) { return hasChildren(itemId); }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean areChildrenAllowed(Object itemId) { return hasChildren(itemId); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean areChildrenAllowed(Object itemId) { return hasChildren(itemId); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean areChildrenAllowed(Object itemId) { return hasChildren(itemId); } @Override Collection<?> getContainerPropertyIds(); void...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean areChildrenAllowed(Object itemId) { return hasChildren(itemId); } @Override Collection<?> getContainerPropertyIds(); void...
@Test public void testSetChildrenAllowed() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); HierarchicalTestItem testItem = new HierarchicalTestItem(23); assertThat(container.setChildrenAllowed(testItem, true), is(false)); }
@Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return false; }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return false; } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return false; } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return false; } @Ove...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return false; } @Ove...
@Test void testFieldAccess() throws NoSuchFieldException, SecurityException { TestObject testObject = new TestObject(); Member fieldOrMethod = TestObject.class.getDeclaredField("field"); String result = MemberAccessors.getValue(testObject, fieldOrMethod); assertThat(result, is(testObject.field)); }
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testInstantiate_PrivateConstructor() { Assertions.assertThrows(IllegalArgumentException.class, () -> { Classes.instantiate(PrivateConstructor.class); }); }
public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.format("Canno...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
@Test public void testIsRoot_ofItemNotContained() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); assertThat(container.isRoot(new TestItem(42)), is(false)); }
@Override public boolean isRoot(Object itemId) { return roots.contains(itemId); }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean isRoot(Object itemId) { return roots.contains(itemId); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean isRoot(Object itemId) { return roots.contains(itemId); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean isRoot(Object itemId) { return roots.contains(itemId); } @Override Collection<?> getContainerPropertyIds(); void setItems...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean isRoot(Object itemId) { return roots.contains(itemId); } @Override Collection<?> getContainerPropertyIds(); void setItems...
@Test public void testHasChildren_ofItemNotContained() { LinkkiInMemoryContainer<TestItem> container = new LinkkiInMemoryContainer<>(); assertThat(container.hasChildren(new TestItem(42)), is(false)); }
@Override public boolean hasChildren(Object itemId) { return getHierarchicalItem(itemId) .map(HierarchicalRowPmo::hasChildRows) .orElse(false); }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean hasChildren(Object itemId) { return getHierarchicalItem(itemId) .map(HierarchicalRowPmo::hasChildRows) .orElse(false); } }
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean hasChildren(Object itemId) { return getHierarchicalItem(itemId) .map(HierarchicalRowPmo::hasChildRows) .orElse(false); } ...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean hasChildren(Object itemId) { return getHierarchicalItem(itemId) .map(HierarchicalRowPmo::hasChildRows) .orElse(false); } ...
LinkkiInMemoryContainer extends com.vaadin.v7.data.util.AbstractInMemoryContainer<T, Object, com.vaadin.v7.data.Item> implements com.vaadin.v7.data.Container.Hierarchical { @Override public boolean hasChildren(Object itemId) { return getHierarchicalItem(itemId) .map(HierarchicalRowPmo::hasChildRows) .orElse(false); } ...
@Test public void testPageLength() { TestTablePmo tablePmo = new TestTablePmo(15); com.vaadin.v7.ui.Table table = new PmoBasedTableFactory(tablePmo, bindingContext).createTable(); com.vaadin.v7.data.Container.ItemSetChangeListener itemSetChangedListener = addItemSetChangeListener(bindingContext); assertThat(table.getPa...
@SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
@Test public void testItems_AfterConstruction() { TestRowPmo rowPmo1 = new TestRowPmo(); TestRowPmo rowPmo2 = new TestRowPmo(); TestTablePmo tablePmo = new TestTablePmo(rowPmo1, rowPmo2); com.vaadin.v7.ui.Table table = new PmoBasedTableFactory(tablePmo, bindingContext).createTable(); assertThat(tablePmo.getItems(), con...
@SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
@Test public void testItems_UponUpdate_AddItems() { TestTablePmo tablePmo = new TestTablePmo(); com.vaadin.v7.ui.Table table = new PmoBasedTableFactory(tablePmo, bindingContext).createTable(); com.vaadin.v7.data.Container.ItemSetChangeListener itemSetChangedListener = addItemSetChangeListener(bindingContext); assertTha...
@SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
@Test public void testItems_UponUpdate_RemoveItems() { TestRowPmo row1 = new TestRowPmo(); TestRowPmo row2 = new TestRowPmo(); TestTablePmo tablePmo = new TestTablePmo(row1, row2); com.vaadin.v7.ui.Table table = new PmoBasedTableFactory(tablePmo, bindingContext).createTable(); com.vaadin.v7.data.Container.ItemSetChange...
@SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
@Test public void testDataSourceSet() { TestTablePmo tablePmo = new TestTablePmo(); com.vaadin.v7.ui.Table table = new PmoBasedTableFactory(tablePmo, bindingContext).createTable(); assertThat(getTableContainer(bindingContext), is(table.getContainerDataSource())); }
@SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
@Test public void testFooterUpdateAfterConstruction() { TableFooterPmo footerPmo = property -> property; TestTablePmo tablePmo = new TestTablePmo(footerPmo); com.vaadin.v7.ui.Table table = new PmoBasedTableFactory(tablePmo, bindingContext).createTable(); com.vaadin.v7.data.Container.ItemSetChangeListener itemSetChanged...
@SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); }
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
PmoBasedTableFactory { @SuppressWarnings("deprecation") public com.vaadin.v7.ui.Table createTable() { return (com.vaadin.v7.ui.Table)CONTAINER_COMPONENT_FACTORY.createContainerComponent(containerPmo, bindingContext); } PmoBasedTableFactory(ContainerPmo<?> containerPmo, BindingContext bindingContext); @SuppressWarnings(...
@Test public void testSetSectionId() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SCCPmoWithID(), bindingContext); assertThat(section.getId(), is("test-ID")); }
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@Test public void testSetSectionDefaultId() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SCCPmoWithoutID(), bindingContext); assertThat(section.getId(), is("SCCPmoWithoutID")); }
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@Test void testFieldAccess_NativeType() throws NoSuchFieldException, SecurityException { TestObject testObject = new TestObject(); Member fieldOrMethod = TestObject.class.getDeclaredField("intField"); int result = MemberAccessors.getValue(testObject, fieldOrMethod); assertThat(result, is(testObject.intField)); }
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testSetComponentId() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SCCPmoWithID(), bindingContext); @SuppressWarnings("deprecation") GridLayout gridLayout = TestUiUtil .getContentGrid((org.linkki.core.vaadin.component.section.FormSection)section); Component textField = gr...
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@SuppressWarnings("deprecation") @Test public void testSectionWithDefaultLayout_shouldCreateFormSection() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SCCPmoWithoutID(), bindingContext); assertThat(section, is(instanceOf(org.linkki.core.vaadin.component.section.FormSection.class))); }
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@Test public void testSectionWithHorizontalLayout_shouldCreateHorizontalSection() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SectionWithHorizontalLayout(), bindingContext); assertThat(section, is(instanceOf(HorizontalSection.class))); }
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@Test public void testSectionWithCustomLayout_shouldCreateCustomLayoutSection() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SectionWithCustomLayout(), bindingContext); assertThat(section, is(instanceOf(CustomLayoutSection.class))); }
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@SuppressWarnings("deprecation") @Test public void testSectionWithoutAnnotation_usesDefaultValues() { AbstractSection section = PmoBasedSectionFactory.createAndBindSection(new SectionWithoutAnnotation(), bindingContext); assertThat(section, is(instanceOf(org.linkki.core.vaadin.component.section.FormSection.class))); as...
public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentDefinition = ComponentAnno...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
PmoBasedSectionFactory { public static AbstractSection createAndBindSection(Object pmo, BindingContext bindingContext) { requireNonNull(pmo, "pmo must not be null"); requireNonNull(bindingContext, "bindingContext must not be null"); Class<? extends Object> pmoClass = pmo.getClass(); LinkkiComponentDefinition componentD...
@Test public void testCreateSectionHeader() { SCCPmoWithID containerPmo = new SCCPmoWithID(); PmoBasedSectionFactory factory = new PmoBasedSectionFactory(); AbstractSection tableSection = factory.createSection(containerPmo, bindingContext); HorizontalLayout header = (HorizontalLayout)tableSection.getComponent(0); asser...
public AbstractSection createSection(Object pmo, BindingContext bindingContext) { return createAndBindSection(pmo, bindingContext); }
PmoBasedSectionFactory { public AbstractSection createSection(Object pmo, BindingContext bindingContext) { return createAndBindSection(pmo, bindingContext); } }
PmoBasedSectionFactory { public AbstractSection createSection(Object pmo, BindingContext bindingContext) { return createAndBindSection(pmo, bindingContext); } }
PmoBasedSectionFactory { public AbstractSection createSection(Object pmo, BindingContext bindingContext) { return createAndBindSection(pmo, bindingContext); } AbstractSection createSection(Object pmo, BindingContext bindingContext); BaseSection createBaseSection(Object pmo, BindingContext bindingContext); TableSection...
PmoBasedSectionFactory { public AbstractSection createSection(Object pmo, BindingContext bindingContext) { return createAndBindSection(pmo, bindingContext); } AbstractSection createSection(Object pmo, BindingContext bindingContext); BaseSection createBaseSection(Object pmo, BindingContext bindingContext); TableSection...
@Test public void testSetSectionId() { BaseSection section = createContext(new SCCPmoWithID()).createSection(); assertThat(section.getId(), is("test-ID")); }
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@Test public void testSetSectionDefaultId() { BaseSection section = createContext(new SCCPmoWithoutID()).createSection(); assertThat(section.getId(), is("SCCPmoWithoutID")); }
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@Test public void testSetComponentId() { BaseSection section = createContext(new SCCPmoWithID()).createSection(); assertThat(section.getComponentCount(), is(2)); assertThat(section.getComponent(0).isVisible(), is(false)); GridLayout gridLayout = TestUiUtil.getContentGrid((FormSection)section); @NonNull Component textFi...
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@Test public void testSectionWithDefaultLayout_shouldCreateFormLayout() { BaseSection section = createContext(new SCCPmoWithoutID()).createSection(); assertThat(section, is(instanceOf(FormSection.class))); }
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@Test void testGetValue() throws NoSuchMethodException, SecurityException { TestObject testObject = new TestObject(); Member fieldOrMethod = TestObject.class.getDeclaredMethod("getValue"); String result = MemberAccessors.getValue(testObject, fieldOrMethod); assertThat(result, is(testObject.getValue())); }
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testSectionWithHorizontalLayout_shouldCreateHorizontalSection() { BaseSection section = createContext(new SectionWithHorizontalLayout()).createSection(); assertThat(section, is(instanceOf(HorizontalSection.class))); }
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@Test public void testSectionWithCustomLayout_shouldCreateCustomLayoutSection() { BaseSection section = createContext(new SectionWithCustomLayout()).createSection(); assertThat(section, is(instanceOf(CustomLayoutSection.class))); }
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@Test public void testSectionWithoutAnnotation_usesDefaultValues() { BaseSection section = createContext(new SectionWithoutAnnotation()).createSection(); assertThat(section, is(instanceOf(FormSection.class))); assertThat(section.getId(), is(SectionWithoutAnnotation.class.getSimpleName())); assertThat(section.getCaption...
@Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
SectionCreationContext { @Deprecated public BaseSection createSection() { return (BaseSection)PmoBasedSectionFactory.createAndBindSection(pmo, bindingContext); } @Deprecated SectionCreationContext(Object pmo, BindingContext bindingContext); @Deprecated BaseSection createSection(); }
@SuppressWarnings("deprecation") @Test public void testCreateComponent() { TestPmo pmo = new TestPmo(); BindingContext bindingContext = new BindingContext(); Component component = VaadinUiCreator.createComponent(pmo, bindingContext); assertThat(component, instanceOf(org.linkki.core.vaadin.component.section.FormSection....
public static Component createComponent(Object pmo, BindingContext bindingContext) { ComponentWrapper wrapper = UiCreator.createComponent(pmo, bindingContext); return (Component)wrapper.getComponent(); }
VaadinUiCreator { public static Component createComponent(Object pmo, BindingContext bindingContext) { ComponentWrapper wrapper = UiCreator.createComponent(pmo, bindingContext); return (Component)wrapper.getComponent(); } }
VaadinUiCreator { public static Component createComponent(Object pmo, BindingContext bindingContext) { ComponentWrapper wrapper = UiCreator.createComponent(pmo, bindingContext); return (Component)wrapper.getComponent(); } private VaadinUiCreator(); }
VaadinUiCreator { public static Component createComponent(Object pmo, BindingContext bindingContext) { ComponentWrapper wrapper = UiCreator.createComponent(pmo, bindingContext); return (Component)wrapper.getComponent(); } private VaadinUiCreator(); static Component createComponent(Object pmo, BindingContext bindingCon...
VaadinUiCreator { public static Component createComponent(Object pmo, BindingContext bindingContext) { ComponentWrapper wrapper = UiCreator.createComponent(pmo, bindingContext); return (Component)wrapper.getComponent(); } private VaadinUiCreator(); static Component createComponent(Object pmo, BindingContext bindingCon...
@Test public void testGetUiLocale() { assertThat(UI.getCurrent(), is(nullValue())); assertThat(UiFramework.getLocale(), is(Locale.GERMAN)); UI ui = MockUi.mockUi(); when(ui.getLocale()).thenReturn(Locale.ITALIAN); assertThat(UiFramework.getLocale(), is(Locale.ITALIAN)); }
@Override public Locale getLocale() { UI ui = UI.getCurrent(); if (ui != null) { Locale locale = ui.getLocale(); if (locale != null) { return locale; } } return Locale.GERMAN; }
Vaadin8 implements UiFrameworkExtension { @Override public Locale getLocale() { UI ui = UI.getCurrent(); if (ui != null) { Locale locale = ui.getLocale(); if (locale != null) { return locale; } } return Locale.GERMAN; } }
Vaadin8 implements UiFrameworkExtension { @Override public Locale getLocale() { UI ui = UI.getCurrent(); if (ui != null) { Locale locale = ui.getLocale(); if (locale != null) { return locale; } } return Locale.GERMAN; } }
Vaadin8 implements UiFrameworkExtension { @Override public Locale getLocale() { UI ui = UI.getCurrent(); if (ui != null) { Locale locale = ui.getLocale(); if (locale != null) { return locale; } } return Locale.GERMAN; } @Override Locale getLocale(); @Override ComponentWrapperFactory getComponentWrapperFactory(); @Over...
Vaadin8 implements UiFrameworkExtension { @Override public Locale getLocale() { UI ui = UI.getCurrent(); if (ui != null) { Locale locale = ui.getLocale(); if (locale != null) { return locale; } } return Locale.GERMAN; } @Override Locale getLocale(); @Override ComponentWrapperFactory getComponentWrapperFactory(); @Over...
@Test public void testGetChildComponents() { Component component1 = new Label("first label"); Component component2 = new Label("second label"); HasComponents componentWithChildren = new VerticalLayout(component1, component2); Component[] arr = { component1, component2 }; assertThat(UiFramework.get().getChildComponents(...
@Override public Stream<?> getChildComponents(Object uiComponent) { if (uiComponent instanceof HasComponents) { return StreamUtil.stream((HasComponents)uiComponent); } return Stream.empty(); }
Vaadin8 implements UiFrameworkExtension { @Override public Stream<?> getChildComponents(Object uiComponent) { if (uiComponent instanceof HasComponents) { return StreamUtil.stream((HasComponents)uiComponent); } return Stream.empty(); } }
Vaadin8 implements UiFrameworkExtension { @Override public Stream<?> getChildComponents(Object uiComponent) { if (uiComponent instanceof HasComponents) { return StreamUtil.stream((HasComponents)uiComponent); } return Stream.empty(); } }
Vaadin8 implements UiFrameworkExtension { @Override public Stream<?> getChildComponents(Object uiComponent) { if (uiComponent instanceof HasComponents) { return StreamUtil.stream((HasComponents)uiComponent); } return Stream.empty(); } @Override Locale getLocale(); @Override ComponentWrapperFactory getComponentWrapperF...
Vaadin8 implements UiFrameworkExtension { @Override public Stream<?> getChildComponents(Object uiComponent) { if (uiComponent instanceof HasComponents) { return StreamUtil.stream((HasComponents)uiComponent); } return Stream.empty(); } @Override Locale getLocale(); @Override ComponentWrapperFactory getComponentWrapperF...
@Test public void testNewComponent_DefaultAnnotations() { ButtonBindingDefinition adapter = new ButtonBindingDefinition(defaultAnnotation()); Component component = adapter.newComponent(); assertThat(component, is(instanceOf(Button.class))); Button button = (Button)component; assertThat(button.getIcon(), is(nullValue())...
@Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickS...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
@Test public void testNewComponent_CustomAnnotationsAreUsed() { ButtonBindingDefinition adapter = new ButtonBindingDefinition(customAnnotation()); Component component = adapter.newComponent(); assertThat(component, is(instanceOf(Button.class))); Button button = (Button)component; assertThat(button.getIcon(), is(VaadinI...
@Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickS...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
@SuppressWarnings("deprecation") @Test public void testNewComponent_UseShortcutKeyCode() { Button button = new ButtonBindingDefinition(shortcutButton()).newComponent(); assertThat(button, not(nullValue())); Button buttonSpy = spy(button); buttonSpy.setClickShortcut(KeyCode.ENTER); verify(buttonSpy).removeShortcutListen...
@Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (buttonAnnotation.shortcutKeyCode() != -1) { button.setClickS...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
ButtonBindingDefinition implements BindingDefinition { @Override public Button newComponent() { Button button = ComponentFactory.newButton(); if (buttonAnnotation.showIcon()) { button.setIcon(buttonAnnotation.icon()); } for (String styleName : buttonAnnotation.styleNames()) { button.addStyleName(styleName); } if (butto...
@Test public void testNewComponent_DefaultDateFormatIsUsed() { assertThat(UiFramework.getLocale(), is(Locale.GERMAN)); DateFieldBindingDefinition adapter = new DateFieldBindingDefinition(defaultAnnotation()); Component component = adapter.newComponent(); assertThat(component, is(instanceOf(DateField.class))); DateField...
@Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } retur...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
@Test void testGetValue_Void() throws NoSuchMethodException, SecurityException { TestObject testObject = new TestObject(); Member fieldOrMethod = TestObject.class.getDeclaredMethod("getVoid"); Assertions.assertThrows(IllegalArgumentException.class, () -> MemberAccessors.getValue(testObject, fieldOrMethod)); }
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testNewComponent_CustomDateFormatIsUsed() { DateFieldBindingDefinition adapter = new DateFieldBindingDefinition(customAnnotation()); Component component = adapter.newComponent(); assertThat(component, is(instanceOf(DateField.class))); DateField dateField = (DateField)component; assertThat(dateField.ge...
@Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateField.setDateFormat(DateFormats.getPattern(locale)); } retur...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
DateFieldBindingDefinition implements BindingDefinition { @Override public Component newComponent() { DateField dateField = ComponentFactory.newDateField(); if (StringUtils.isNotBlank(uiDateField.dateFormat())) { dateField.setDateFormat(uiDateField.dateFormat()); } else { Locale locale = UiFramework.getLocale(); dateFi...
@Test public void testPostUpdate_AddsRequiredIndicatorToLabelIfFieldIsRequired() { LabelComponentWrapper wrapper = new LabelComponentWrapper(label, field); field.setRequiredIndicatorVisible(true); wrapper.postUpdate(); assertThat(label.getStyleName(), containsString(LinkkiTheme.REQUIRED_LABEL_COMPONENT_WRAPPER)); }
@Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); }
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } }
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
@Test public void testPostUpdate_DoesNotAddRequiredIndicatorToLabelIfFieldIsNotRequired() { LabelComponentWrapper wrapper = new LabelComponentWrapper(label, field); field.setRequiredIndicatorVisible(false); wrapper.postUpdate(); assertThat(label.getStyleName(), not(containsString(LinkkiTheme.REQUIRED_LABEL_COMPONENT_WR...
@Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); }
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } }
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
@Test public void testPostUpdate_DoesNotAddRequiredIndicatorToLabelIfFieldIsReadOnly() { LabelComponentWrapper wrapper = new LabelComponentWrapper(label, field); field.setRequiredIndicatorVisible(true); field.setReadOnly(true); wrapper.postUpdate(); assertThat(label.getStyleName(), not(containsString(LinkkiTheme.REQUIR...
@Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); }
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } }
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(...
@Test public void testSetLabel() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setLabel("testLabel"); verify(component).setCaption("testLabel"); }
@Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); }
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } }
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, Wrap...
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, Wrap...
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, Wrap...
@Test public void testSetLabel_EmptyString() { Component component = new TextField(); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setLabel(""); assertThat(component.getCaption(), is(nullValue())); }
@Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); }
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } }
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, Wrap...
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, Wrap...
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, Wrap...
@Test public void testConvertToModelWithoutSeparators() { assertThat(converter.convertToModel("17385,89", new ValueContext(Locale.GERMAN)) .getOrThrow(s -> new AssertionError(s)), is(Decimal.valueOf(17385.89))); }
@Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } FormattedDecimalFieldToStringConverter(String format); }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } FormattedDecimalFieldToStringConverter(String format); @Override Result<Decimal> convertToModel(@CheckForNull String value,...
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } FormattedDecimalFieldToStringConverter(String format); @Override Result<Decimal> convertToModel(@CheckForNull String value,...
@Test public void testConvertToModelWithNull() { assertThat(converter.convertToModel(null, new ValueContext()) .getOrThrow(s -> new AssertionError(s)), is(Decimal.NULL)); }
@Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } FormattedDecimalFieldToStringConverter(String format); }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } FormattedDecimalFieldToStringConverter(String format); @Override Result<Decimal> convertToModel(@CheckForNull String value,...
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override protected Decimal convertToModel(Number value) { return Decimal.valueOf(value.doubleValue()); } FormattedDecimalFieldToStringConverter(String format); @Override Result<Decimal> convertToModel(@CheckForNull String value,...
@Test public void testConvertToPresentationWithNull() { assertThat(converter.convertToPresentation(null, new ValueContext()), is("")); }
@Override public String convertToPresentation(@CheckForNull Decimal value, ValueContext context) { if (value == null || value.isNull()) { return ""; } else { return super.convertToPresentation(value, context); } }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override public String convertToPresentation(@CheckForNull Decimal value, ValueContext context) { if (value == null || value.isNull()) { return ""; } else { return super.convertToPresentation(value, context); } } }
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override public String convertToPresentation(@CheckForNull Decimal value, ValueContext context) { if (value == null || value.isNull()) { return ""; } else { return super.convertToPresentation(value, context); } } FormattedDecima...
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override public String convertToPresentation(@CheckForNull Decimal value, ValueContext context) { if (value == null || value.isNull()) { return ""; } else { return super.convertToPresentation(value, context); } } FormattedDecima...
FormattedDecimalFieldToStringConverter extends FormattedNumberToStringConverter<Decimal> { @Override public String convertToPresentation(@CheckForNull Decimal value, ValueContext context) { if (value == null || value.isNull()) { return ""; } else { return super.convertToPresentation(value, context); } } FormattedDecima...
@Test public void testConvertMessage() { org.faktorips.runtime.Message ipsMessage = new org.faktorips.runtime.Message.Builder("the text", org.faktorips.runtime.Severity.ERROR) .markers(new TestMarker()) .invalidObject(new org.faktorips.runtime.ObjectProperty("TheObject", "theProperty")) .replacements(new org.faktorips....
public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
@Test void testGetValue_NativeReturnType() throws NoSuchMethodException, SecurityException { TestObject testObject = new TestObject(); Member fieldOrMethod = TestObject.class.getDeclaredMethod("getInt"); int result = MemberAccessors.getValue(testObject, fieldOrMethod); assertThat(result, is(testObject.getInt())); }
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testConvertMessage_textNull_shouldConvertToEmptyString() { org.faktorips.runtime.Message ipsMessage = new org.faktorips.runtime.Message(null, org.faktorips.runtime.Severity.INFO); Message message = MessageConverter.convert(ipsMessage); assertThat(message.getText(), is(emptyString())); }
public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
@Test public void testConvertMessage_severityNull_shouldConvertToInfo() { org.faktorips.runtime.Message ipsMessage = new org.faktorips.runtime.Message("text", null); Message message = MessageConverter.convert(ipsMessage); assertThat(message.getSeverity(), is(Severity.INFO)); }
public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
@Test public void testConvertMessage_severityNone_shouldConvertToInfo() { org.faktorips.runtime.Message ipsMessage = new org.faktorips.runtime.Message("text", org.faktorips.runtime.Severity.NONE); Message message = MessageConverter.convert(ipsMessage); assertThat(message.getSeverity(), is(Severity.INFO)); }
public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
@Test public void testConvertMessageList() { org.faktorips.runtime.MessageList ipsList = new org.faktorips.runtime.MessageList(); ipsList.add(new org.faktorips.runtime.Message.Builder("message1", org.faktorips.runtime.Severity.WARNING) .code("code").create()); ipsList.add(new org.faktorips.runtime.Message.Builder("mess...
public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); }
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
MessageConverter { public static MessageList convert(org.faktorips.runtime.MessageList ipsMessages) { if (ipsMessages == null) { return new MessageList(); } return StreamUtil.stream(ipsMessages) .map(MessageConverter::convert) .collect(toMessageList()); } private MessageConverter(); static MessageList convert(org.fakt...
@Test public void testIdAndNameCaptionProvider_AnonymousClass() { ItemCaptionProvider<Object> provider = new IdAndNameCaptionProvider(); assertThat(provider.getCaption(TestEnum.VALUE1), is("name1 [id1]")); }
@Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } @Override String getCaption(Object o); }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } @Override String getCaption(Object o); }
@Test public void testIdAndNameCaptionProvider_AllMethods() { ItemCaptionProvider<Object> provider = new IdAndNameCaptionProvider(); assertThat(provider.getCaption(AllMethodsEnum.VALUE), is("getName(Locale) [id]")); }
@Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } @Override String getCaption(Object o); }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } @Override String getCaption(Object o); }
@Test public void testIdAndNameCaptionProvider_MissingGetIdMethod() { ItemCaptionProvider<Object> provider = new IdAndNameCaptionProvider(); Assertions.assertThrows(IllegalStateException.class, () -> { provider.getCaption(UnnamedEnum.VALUE); }); }
@Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } @Override String getCaption(Object o); }
IdAndNameCaptionProvider implements ItemCaptionProvider<Object> { @Override public String getCaption(Object o) { return getName(o) + " [" + getId(o) + "]"; } @Override String getCaption(Object o); }
@Test public void testPull() { MockUi.setLocale(Locale.GERMANY); IpsPropertyDispatcher ipsPropertyDispatcher = new IpsPropertyDispatcher( pmo::getIpsObject, TestIpsObject.PROPERTY_FOO, standardDispatcherChain(TestIpsObject.PROPERTY_FOO)); String string = ipsPropertyDispatcher.pull(Aspect.of("", LinkkiAspectDefinition.D...
@Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(this::getLabel) .orElseGet(() -> (String)super.pull(aspect)); return l...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
@Test public void testPull_ModelAttribute() { MockUi.setLocale(Locale.GERMANY); IpsPropertyDispatcher ipsPropertyDispatcher = new IpsPropertyDispatcher( pmo::getIpsObject, TestIpsObject.PROPERTY_FOO, propertyDispatcherFactory.createDispatcherChain(pmo, BoundProperty.of("bar") .withModelAttribute(TestIpsObject.PROPERTY_...
@Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(this::getLabel) .orElseGet(() -> (String)super.pull(aspect)); return l...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
@Test public void testPull_DefaultLocale() { MockUi.setLocale(Locale.ITALY); IpsPropertyDispatcher ipsPropertyDispatcher = new IpsPropertyDispatcher( pmo::getIpsObject, TestIpsObject.PROPERTY_FOO, standardDispatcherChain(TestIpsObject.PROPERTY_FOO)); String string = ipsPropertyDispatcher.pull(Aspect.of("", LinkkiAspect...
@Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(this::getLabel) .orElseGet(() -> (String)super.pull(aspect)); return l...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
@Test void testGetValue_MethodThrowsException() throws NoSuchMethodException, SecurityException { TestObject testObject = new TestObject(); Member fieldOrMethod = TestObject.class.getDeclaredMethod("getThrowException"); assertThrows(RuntimeException.class, () -> MemberAccessors.getValue(testObject, fieldOrMethod)); }
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testPull_Class() { MockUi.setLocale(Locale.GERMANY); IpsPropertyDispatcher ipsPropertyDispatcher = new IpsPropertyDispatcher( pmo::getIpsObject, "", standardDispatcherChain("")); String string = ipsPropertyDispatcher.pull(Aspect.of("", LinkkiAspectDefinition.DERIVED_BY_LINKKI)); assertThat(string, is(...
@Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(this::getLabel) .orElseGet(() -> (String)super.pull(aspect)); return l...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
@Test public void testPull_Class_OverwritingModelObjectClass() { MockUi.setLocale(Locale.ENGLISH); pmo.setIpsObject(new TestIpsObject2()); IpsPropertyDispatcher ipsPropertyDispatcher = new IpsPropertyDispatcher( pmo::getIpsObject, "", standardDispatcherChain("")); String string = ipsPropertyDispatcher.pull(Aspect.of(""...
@Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(this::getLabel) .orElseGet(() -> (String)super.pull(aspect)); return l...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
IpsPropertyDispatcher extends AbstractPropertyDispatcherDecorator { @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); if (LinkkiAspectDefinition.DERIVED_BY_LINKKI.equals(staticValue)) { @SuppressWarnings("unchecked") T label = (T)findModelElement() .map(th...
@Test public void testGetCurrentView() { setUpApplicationLayout(); View view = mock(View.class, withSettings().extraInterfaces(Component.class)); applicationLayout.showView(view); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(view)); }
protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testShowView() { setUpApplicationLayout(); assertThat(applicationLayout.getComponentCount(), is(3)); assertThat(applicationLayout.getComponent(1), is(instanceOf(EmptyView.class))); View view = mock(View.class, withSettings().extraInterfaces(Component.class)); applicationLayout.showView(view); assertTh...
@Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } ApplicationLayout(ApplicationHeader header, @CheckForNull App...
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } ApplicationLayout(ApplicationHeader header, @CheckForNull App...
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } ApplicationLayout(ApplicationHeader header, @CheckForNull App...
@Test public void testShowView_NoFooter() { applicationLayout = new ApplicationLayout(header, null); assertThat(applicationLayout.getComponentCount(), is(2)); assertThat(applicationLayout.getComponent(1), is(instanceOf(EmptyView.class))); View view = mock(View.class, withSettings().extraInterfaces(Component.class)); ap...
@Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } ApplicationLayout(ApplicationHeader header, @CheckForNull App...
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } ApplicationLayout(ApplicationHeader header, @CheckForNull App...
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { if (view instanceof Component) { setMainArea((Component)view); } else { throw new IllegalArgumentException( "View is not a component: " + view); } } ApplicationLayout(ApplicationHeader header, @CheckForNull App...
@Test public void testInit() { initUi(); assertThat(UI.getCurrent().getContent(), is(linkkiUi.getApplicationLayout())); }
@Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before any other methods to set applicationConfig and applicationLayout"); setErrorHandler(createErrorHandler()); VaadinSession vaadinSession = VaadinSession.getCurrent(); if (vaadinSession != null) { vaad...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before any other methods to set applicationConfig and applicationLayout"); setErrorHandler(createErrorHandler()); VaadinSession vaadinSession = VaadinSession.getCurrent(); if (vaadinS...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before any other methods to set applicationConfig and applicationLayout"); setErrorHandler(createErrorHandler()); VaadinSession vaadinSession = VaadinSession.getCurrent(); if (vaadinS...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before any other methods to set applicationConfig and applicationLayout"); setErrorHandler(createErrorHandler()); VaadinSession vaadinSession = VaadinSession.getCurrent(); if (vaadinS...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before any other methods to set applicationConfig and applicationLayout"); setErrorHandler(createErrorHandler()); VaadinSession vaadinSession = VaadinSession.getCurrent(); if (vaadinS...
@Test public void testUnselect_checkVisibilitySetToFalse() { HorizontalLayout content = new HorizontalLayout(); SidebarSheet sheet = createSideBarSheet(content); sheet.unselect(); assertThat(content.isVisible(), is(false)); }
protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); }
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } }
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, Strin...
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, Strin...
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, Strin...
@Test public void testSelect_checkVisibilitySetToTrue() { HorizontalLayout content = new HorizontalLayout(); SidebarSheet sheet = createSideBarSheet(content); sheet.select(); assertThat(content.isVisible(), is(true)); }
protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); }
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } }
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
@Test public void testSelect_CheckObserver() { HorizontalLayout content = new HorizontalLayout(); SidebarSheet sidebarSheet = new SidebarSheet(FontAwesome.STAR_HALF_FULL, "Test SidebarSheet", content, () -> triggered = true); sidebarSheet.select(); assertThat(triggered, is(true)); }
protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); }
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } }
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
@Test void testGetValue_UnsupportedMemberType() throws NoSuchMethodException, SecurityException { TestObject testObject = new TestObject(); Constructor<? extends TestObject> constructor = testObject.getClass().getDeclaredConstructor(); assertThrows(IllegalArgumentException.class, () -> MemberAccessors.getValue(testObje...
@SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fieldOrMethod, key ->...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
MemberAccessors { @SuppressWarnings("unchecked") public static <T> T getValue(Object object, Member fieldOrMethod) { if (fieldOrMethod instanceof Field) { return (T)getFieldValue(object, fieldOrMethod); } else if (fieldOrMethod instanceof Method) { Function<Object, Object> accessor = ACCESSOR_CACHE .computeIfAbsent(fie...
@Test public void testToString() { SidebarSheet sheet = new SidebarSheet(FontAwesome.ADJUST, "Foo", new TextField()); assertThat(sheet.toString(), is("Foo")); }
@Override public String toString() { return name; }
SidebarSheet { @Override public String toString() { return name; } }
SidebarSheet { @Override public String toString() { return name; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Res...
SidebarSheet { @Override public String toString() { return name; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Res...
SidebarSheet { @Override public String toString() { return name; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Res...
@Test public void testSelect_NotRegistered() { SidebarLayout sidebarLayout = new SidebarLayout(); SidebarSheet sheet1 = new SidebarSheet(ANY_ICON, ANY_STRING, createNewContent()); Assertions.assertThrows(IllegalArgumentException.class, () -> { sidebarLayout.select(sheet1); }); }
public void select(SidebarSheet sheet) { if (!sidebarSheets.contains(sheet)) { throw new IllegalArgumentException("The sheet " + sheet + " is not part of this SidebarLayout"); } if (selected == sheet) { return; } Component content = sheet.getContent(); if (content.getParent() == null) { contentArea.addComponent(content...
SidebarLayout extends CssLayout { public void select(SidebarSheet sheet) { if (!sidebarSheets.contains(sheet)) { throw new IllegalArgumentException("The sheet " + sheet + " is not part of this SidebarLayout"); } if (selected == sheet) { return; } Component content = sheet.getContent(); if (content.getParent() == null) ...
SidebarLayout extends CssLayout { public void select(SidebarSheet sheet) { if (!sidebarSheets.contains(sheet)) { throw new IllegalArgumentException("The sheet " + sheet + " is not part of this SidebarLayout"); } if (selected == sheet) { return; } Component content = sheet.getContent(); if (content.getParent() == null) ...
SidebarLayout extends CssLayout { public void select(SidebarSheet sheet) { if (!sidebarSheets.contains(sheet)) { throw new IllegalArgumentException("The sheet " + sheet + " is not part of this SidebarLayout"); } if (selected == sheet) { return; } Component content = sheet.getContent(); if (content.getParent() == null) ...
SidebarLayout extends CssLayout { public void select(SidebarSheet sheet) { if (!sidebarSheets.contains(sheet)) { throw new IllegalArgumentException("The sheet " + sheet + " is not part of this SidebarLayout"); } if (selected == sheet) { return; } Component content = sheet.getContent(); if (content.getParent() == null) ...
@Test public void testSetContent() { OkCancelDialog dialog = OkCancelDialog.builder("").build(); assertThat(DialogTestUtil.getContents(dialog).size(), is(0)); dialog.setContent(new Label()); assertThat(DialogTestUtil.getContents(dialog), hasSize(1)); assertThat(dialog, is(showingEnabledOkButton())); }
@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponent(content); } }
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
@Test public void testOk() { Handler okHandler = mock(Handler.class); Handler cancelHandler = mock(Handler.class); OkCancelDialog dialog = OkCancelDialog.builder("") .okHandler(okHandler) .cancelHandler(cancelHandler) .build(); dialog.open(); assertThat(UI.getCurrent().getWindows(), hasSize(1)); DialogTestUtil.clickOkB...
protected void ok() { okHandler.apply(); }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Deprecated OkCancelDialog(String caption, ...
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Deprecated OkCancelDialog(String caption, ...
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Deprecated OkCancelDialog(String caption, ...
@Test public void testContent() { Label content1 = new Label("1"); Label content2 = new Label("2"); OkCancelDialog dialog = OkCancelDialog.builder("caption") .content(content1, content2) .build(); assertThat(DialogTestUtil.getContents(dialog), contains(content1, content2)); }
public static Builder builder(String caption) { return new Builder(caption); }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
@Test public void testButtonOption() { OkCancelDialog dialog = OkCancelDialog.builder("").buttonOption(ButtonOption.OK_ONLY).build(); assertThat(DialogTestUtil.getButtons(dialog), hasSize(1)); }
public static Builder builder(String caption) { return new Builder(caption); }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
@Test public void testIsPresentOn() { assertThat(MetaAnnotation.of(MetaMarkerAnnotation.class).isPresentOn(annotatedAnnotation)); }
public boolean isPresentOn(@CheckForNull Annotation annotation) { if (annotation != null) { return repeatable ? annotation.annotationType().getAnnotationsByType(metaAnnotationClass).length > 0 : annotation.annotationType().isAnnotationPresent(metaAnnotationClass); } else { return false; } }
MetaAnnotation { public boolean isPresentOn(@CheckForNull Annotation annotation) { if (annotation != null) { return repeatable ? annotation.annotationType().getAnnotationsByType(metaAnnotationClass).length > 0 : annotation.annotationType().isAnnotationPresent(metaAnnotationClass); } else { return false; } } }
MetaAnnotation { public boolean isPresentOn(@CheckForNull Annotation annotation) { if (annotation != null) { return repeatable ? annotation.annotationType().getAnnotationsByType(metaAnnotationClass).length > 0 : annotation.annotationType().isAnnotationPresent(metaAnnotationClass); } else { return false; } } private Me...
MetaAnnotation { public boolean isPresentOn(@CheckForNull Annotation annotation) { if (annotation != null) { return repeatable ? annotation.annotationType().getAnnotationsByType(metaAnnotationClass).length > 0 : annotation.annotationType().isAnnotationPresent(metaAnnotationClass); } else { return false; } } private Me...
MetaAnnotation { public boolean isPresentOn(@CheckForNull Annotation annotation) { if (annotation != null) { return repeatable ? annotation.annotationType().getAnnotationsByType(metaAnnotationClass).length > 0 : annotation.annotationType().isAnnotationPresent(metaAnnotationClass); } else { return false; } } private Me...
@Test public void testSetId() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); verify(component).setId("testID"); wrapper.setId("anotherId"); verify(component).setId("anotherId"); }
@Override public void setId(String id) { component.setId(id); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setId(String id) { component.setId(id); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setId(String id) { component.setId(id); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setId(String id) { component.setId(id); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String id); @Override void ...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setId(String id) { component.setId(id); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String id); @Override void ...
@Test public void testSetLabel() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setLabel("testLabel"); verify(component).setCaption("testLabel"); }
@Override public void setLabel(String labelText) { component.setCaption(labelText); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setLabel(String labelText) { component.setCaption(labelText); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setLabel(String labelText) { component.setCaption(labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setLabel(String labelText) { component.setCaption(labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(Strin...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setLabel(String labelText) { component.setCaption(labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(Strin...
@Test public void testSetEnabled() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setEnabled(true); verify(component).setEnabled(true); wrapper.setEnabled(false); verify(component).setEnabled(false); }
@Override public void setEnabled(boolean enabled) { component.setEnabled(enabled); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setEnabled(boolean enabled) { component.setEnabled(enabled); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setEnabled(boolean enabled) { component.setEnabled(enabled); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setEnabled(boolean enabled) { component.setEnabled(enabled); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setEnabled(boolean enabled) { component.setEnabled(enabled); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String...
@Test public void testSetVisible() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setVisible(true); verify(component).setVisible(true); wrapper.setVisible(false); verify(component).setVisible(false); }
@Override public void setVisible(boolean visible) { component.setVisible(visible); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setVisible(boolean visible) { component.setVisible(visible); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setVisible(boolean visible) { component.setVisible(visible); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setVisible(boolean visible) { component.setVisible(visible); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setVisible(boolean visible) { component.setVisible(visible); } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String...
@Test public void testSetTooltip() { AbstractComponent component = mock(AbstractComponent.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setTooltip("testTip"); verify(component).setDescription("testTip"); }
@Override public void setTooltip(String text) { if (component instanceof AbstractComponent) { ((AbstractComponent)component).setDescription(text); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setTooltip(String text) { if (component instanceof AbstractComponent) { ((AbstractComponent)component).setDescription(text); } } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setTooltip(String text) { if (component instanceof AbstractComponent) { ((AbstractComponent)component).setDescription(text); } } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Componen...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setTooltip(String text) { if (component instanceof AbstractComponent) { ((AbstractComponent)component).setDescription(text); } } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Componen...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setTooltip(String text) { if (component instanceof AbstractComponent) { ((AbstractComponent)component).setDescription(text); } } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Componen...
@Test public void testGetComponent() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); assertThat(wrapper.getComponent(), is(sameInstance(component))); }
@Override public Component getComponent() { return component; }
CaptionComponentWrapper implements ComponentWrapper { @Override public Component getComponent() { return component; } }
CaptionComponentWrapper implements ComponentWrapper { @Override public Component getComponent() { return component; } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); }
CaptionComponentWrapper implements ComponentWrapper { @Override public Component getComponent() { return component; } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String id); @Override void ...
CaptionComponentWrapper implements ComponentWrapper { @Override public Component getComponent() { return component; } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String id); @Override void ...
@Test public void testSetValidationMessages() { AbstractComponent component = mock(AbstractComponent.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); ArgumentCaptor<ErrorMessage> errorMessageCaptor = ArgumentCaptor.forClass(ErrorMessage.class); MessageList m...
@Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } CaptionComponentWr...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } CaptionComponentWr...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } CaptionComponentWr...
@Test public void testSetValidationMessages_Empty() { AbstractComponent component = mock(AbstractComponent.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); MessageList messages = new MessageList(); wrapper.setValidationMessages(messages); verify(component).s...
@Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } }
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } CaptionComponentWr...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } CaptionComponentWr...
CaptionComponentWrapper implements ComponentWrapper { @Override public void setValidationMessages(MessageList messagesForProperty) { if (component instanceof AbstractComponent) { AbstractComponent field = (AbstractComponent)component; field.setComponentError(getErrorHandler(messagesForProperty)); } } CaptionComponentWr...
@Test public void testGetType() { Component component = mock(Component.class); assertThat(new CaptionComponentWrapper("testID", component, WrapperType.FIELD).getType(), is(WrapperType.FIELD)); assertThat(new CaptionComponentWrapper("testID", component, WrapperType.LAYOUT).getType(), is(WrapperType.LAYOUT)); }
@Override public WrapperType getType() { return wrapperType; }
CaptionComponentWrapper implements ComponentWrapper { @Override public WrapperType getType() { return wrapperType; } }
CaptionComponentWrapper implements ComponentWrapper { @Override public WrapperType getType() { return wrapperType; } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); }
CaptionComponentWrapper implements ComponentWrapper { @Override public WrapperType getType() { return wrapperType; } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String id); @Override void s...
CaptionComponentWrapper implements ComponentWrapper { @Override public WrapperType getType() { return wrapperType; } CaptionComponentWrapper(Component component, WrapperType wrapperType); CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setId(String id); @Override void s...
@Test public void testFindOn() { Optional<MetaMarkerAnnotation> metaMarkerAnnotation = MetaAnnotation.of(MetaMarkerAnnotation.class) .findOn(annotatedAnnotation); assertThat(metaMarkerAnnotation.isPresent()); assertThat(metaMarkerAnnotation.get().value(), is("foo")); }
public Optional<META> findOn(Annotation annotation) { return repeatable ? findAllOn(annotation).reduce((a1, a2) -> { throw new IllegalArgumentException(annotation.annotationType() + " has multiple @" + metaAnnotationClass.getSimpleName() + " annotations. Please use " + MetaAnnotation.class.getSimpleName() + "#findAllOn...
MetaAnnotation { public Optional<META> findOn(Annotation annotation) { return repeatable ? findAllOn(annotation).reduce((a1, a2) -> { throw new IllegalArgumentException(annotation.annotationType() + " has multiple @" + metaAnnotationClass.getSimpleName() + " annotations. Please use " + MetaAnnotation.class.getSimpleNam...
MetaAnnotation { public Optional<META> findOn(Annotation annotation) { return repeatable ? findAllOn(annotation).reduce((a1, a2) -> { throw new IllegalArgumentException(annotation.annotationType() + " has multiple @" + metaAnnotationClass.getSimpleName() + " annotations. Please use " + MetaAnnotation.class.getSimpleNam...
MetaAnnotation { public Optional<META> findOn(Annotation annotation) { return repeatable ? findAllOn(annotation).reduce((a1, a2) -> { throw new IllegalArgumentException(annotation.annotationType() + " has multiple @" + metaAnnotationClass.getSimpleName() + " annotations. Please use " + MetaAnnotation.class.getSimpleNam...
MetaAnnotation { public Optional<META> findOn(Annotation annotation) { return repeatable ? findAllOn(annotation).reduce((a1, a2) -> { throw new IllegalArgumentException(annotation.annotationType() + " has multiple @" + metaAnnotationClass.getSimpleName() + " annotations. Please use " + MetaAnnotation.class.getSimpleNam...
@Test public void testFindConverter_noneRegistered() { LinkkiConverterFactory linkkiConverterFactory = new LinkkiConverterFactory(() -> Sequence.empty()); assertThat(linkkiConverterFactory.findConverter(String.class, Date.class), is(instanceOf(StringToDateConverter.class))); assertThat(linkkiConverterFactory.findConver...
@Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, MODEL> converter = converterFinder.get().stream() .filter...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
@Test public void testFindConverter_allRegistered() { LinkkiConverterFactory linkkiConverterFactory = new LinkkiConverterFactory( () -> Sequence.of(new JodaLocalDateToStringConverter(), new JodaLocalDateTimeToStringConverter(), new JodaLocalDateToDateConverter(), new LocalDateToStringConverter(), new LocalDateTimeToStr...
@Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, MODEL> converter = converterFinder.get().stream() .filter...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
@Test public void testFindConverter_overrideDefault() { LinkkiConverterFactory linkkiConverterFactory = new LinkkiConverterFactory( () -> Sequence.of(new MyStringToDateConverter())); assertThat(linkkiConverterFactory.findConverter(String.class, Date.class), is(instanceOf(MyStringToDateConverter.class))); }
@Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, MODEL> converter = converterFinder.get().stream() .filter...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, ...
@Test public void testConvertToModel() { Assertions.assertThrows(UnsupportedOperationException.class, () -> { new JodaLocalDateToStringConverter().convertToModel(null, null, null); }); }
@CheckForNull @Override public LocalDate convertToModel(@CheckForNull String value, @CheckForNull Class<? extends LocalDate> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { throw new UnsupportedOperationException(getClass().getName() + " only supports convertToPresentation"); }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public LocalDate convertToModel(@CheckForNull String value, @CheckForNull Class<? extends LocalDate> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { throw new UnsupportedOperationException(ge...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public LocalDate convertToModel(@CheckForNull String value, @CheckForNull Class<? extends LocalDate> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { throw new UnsupportedOperationException(ge...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public LocalDate convertToModel(@CheckForNull String value, @CheckForNull Class<? extends LocalDate> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { throw new UnsupportedOperationException(ge...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public LocalDate convertToModel(@CheckForNull String value, @CheckForNull Class<? extends LocalDate> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { throw new UnsupportedOperationException(ge...
@Test public void testConvertToPresentation_null_shouldReturnEmptyString() { String presentation = new JodaLocalDateToStringConverter().convertToPresentation(null, String.class, null); assertNotNull(presentation); assertThat(presentation, is("")); }
@CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
@Test public void testConvertToPresentation() { LocalDate date = LocalDate.now(); String presentation = new JodaLocalDateToStringConverter().convertToPresentation(date, null, Locale.GERMANY); assertNotNull(presentation); assertThat(presentation, is(date.toString(DateFormats.PATTERN_DE))); }
@CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } return getFormat(getNullsafeLocale(locale)).print(value); }
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...
JodaLocalDateToStringConverter implements Converter<String, LocalDate> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDate value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws Converter.ConversionException { if (value == null) { return ""; } retu...