DetailsEditLayout extends CustomField<Collection<T>> implements NestedComponent, UseInViewMode { public Button getAddButton() { return addButton; } DetailsEditLayout(BaseService<ID, T> service, EntityModel<T> entityModel, AttributeModel attributeModel,
			boolean viewMode, FormOptions formOptions, Comparator<T> comparator); final void addAttributeEntityModel(String path, String reference); Button getAddButton(); Comparator<T> getComparator(); T getEntity(int index); EntityModel<T> getEntityModel(); Map<String, String> getFieldEntityModels(); Map<String, SerializablePredicate<?>> getFieldFilters(); ModelBasedEditForm<ID, T> getForm(int index); FormContainer getFormContainer(int index); Integer getFormCount(); FormOptions getFormOptions(); BiConsumer<AbstractEntity<?>, T> getRemoveEntityConsumer(); @Override Collection<T> getValue(); boolean isViewMode(); void setComparator(Comparator<T> comparator); void setCreateEntitySupplier(Function<AbstractEntity<?>, T> createEntitySupplier); void setDeleteEnabled(int index, boolean allowed); void setDeleteVisible(int index, boolean visible); void setEntity(int index, T entity); void setFieldEnabled(int index, String path, boolean enabled); void setFieldEntityModels(Map<String, String> fieldEntityModels); void setFieldFilters(Map<String, SerializablePredicate<?>> fieldFilters); void setFieldVisible(int index, String path, boolean visible); void setFormOptions(FormOptions formOptions); void setItems(Collection<T> items); void setRemoveEntityConsumer(BiConsumer<AbstractEntity<?>, T> removeEntityConsumer); void setService(BaseService<ID, T> service); boolean validateAllFields(); ModelBasedEditForm<?, ?> getEnclosingForm(); void setEnclosingForm(ModelBasedEditForm<?, ?> enclosingForm); void setClassName(String className);  }
@Test public void testReadOnly() { EntityModel<TestEntity> em = factory.getModel(TestEntity.class); DetailsEditLayout<Integer, TestEntity> layout = createLayout(em, em.getAttributeModel("testEntities"), true, new FormOptions().setDetailsGridSearchMode(true)); assertFalse(layout.getAddButton().isVisible()); }