@Test public void getPropertyFields() { String hashedPropertyName = "#" + TEST_PROPERTYNAME; propertyViewMapLocal.clear(); final LIElement retireved = propertyEditorPresenter.getPropertyFields(ITEM_ID, TEST_PROPERTYNAME, TEST_PROPERTYVALUE); assertNotNull(retireved); verify(propertyValueInputMock, times(1)).setAttribute(eq("placeholder"), eq(hashedPropertyName)); verify(propertyValueInputMock, times(1)).setAttribute(eq("data-field"), eq("propertyValue" + hashedPropertyName)); verify(propertyValueInputMock, times(1)).setDisabled(eq(true)); verify(styleMock, times(1)).setDisplay(eq(Style.Display.NONE)); verify(propertyFieldsMock, times(1)).setAttribute(eq("data-field"), eq("propertyFields" + hashedPropertyName)); assertTrue(propertyViewMapLocal.containsKey(ITEM_ID)); assertTrue(propertyViewMapLocal.get(ITEM_ID).contains(propertyViewMock)); }
@Override public LIElement getPropertyFields(String itemId, String propertyName, String propertyValue) { final PropertyView propertyEditorView = viewsProvider.getPropertyEditorView(); String hashedPropertyName = "#" + propertyName; final SpanElement propertyNameSpan = propertyEditorView.getPropertyName(); setSpanAttributeAttributes(propertyName, hashedPropertyName, "propertyName" + hashedPropertyName, propertyNameSpan); final SpanElement propertyValueSpan = propertyEditorView.getPropertyValueSpan(); setSpanAttributeAttributes(propertyName, propertyValue, "propertyValue" + hashedPropertyName, propertyValueSpan); propertySpanElementMap.put(propertyName, propertyValueSpan); final InputElement propertyValueInput = propertyEditorView.getPropertyValueInput(); propertyValueInput.setAttribute("placeholder", hashedPropertyName); propertyValueInput.setAttribute("data-field", "propertyValue" + hashedPropertyName); propertyValueInput.setDisabled(true); propertyValueInput.getStyle().setDisplay(Style.Display.NONE); final LIElement propertyFields = propertyEditorView.getPropertyFields(); propertyFields.setAttribute("data-field", "propertyFields" + hashedPropertyName); if (propertyViewMap.containsKey(itemId)) { propertyViewMap.get(itemId).add(propertyEditorView); } else { List<PropertyView> toPut = new ArrayList<>(); toPut.add(propertyEditorView); propertyViewMap.put(itemId, toPut); } return propertyFields; }
PropertyPresenter implements PropertyView.Presenter { @Override public LIElement getPropertyFields(String itemId, String propertyName, String propertyValue) { final PropertyView propertyEditorView = viewsProvider.getPropertyEditorView(); String hashedPropertyName = "#" + propertyName; final SpanElement propertyNameSpan = propertyEditorView.getPropertyName(); setSpanAttributeAttributes(propertyName, hashedPropertyName, "propertyName" + hashedPropertyName, propertyNameSpan); final SpanElement propertyValueSpan = propertyEditorView.getPropertyValueSpan(); setSpanAttributeAttributes(propertyName, propertyValue, "propertyValue" + hashedPropertyName, propertyValueSpan); propertySpanElementMap.put(propertyName, propertyValueSpan); final InputElement propertyValueInput = propertyEditorView.getPropertyValueInput(); propertyValueInput.setAttribute("placeholder", hashedPropertyName); propertyValueInput.setAttribute("data-field", "propertyValue" + hashedPropertyName); propertyValueInput.setDisabled(true); propertyValueInput.getStyle().setDisplay(Style.Display.NONE); final LIElement propertyFields = propertyEditorView.getPropertyFields(); propertyFields.setAttribute("data-field", "propertyFields" + hashedPropertyName); if (propertyViewMap.containsKey(itemId)) { propertyViewMap.get(itemId).add(propertyEditorView); } else { List<PropertyView> toPut = new ArrayList<>(); toPut.add(propertyEditorView); propertyViewMap.put(itemId, toPut); } return propertyFields; } }
PropertyPresenter implements PropertyView.Presenter { @Override public LIElement getPropertyFields(String itemId, String propertyName, String propertyValue) { final PropertyView propertyEditorView = viewsProvider.getPropertyEditorView(); String hashedPropertyName = "#" + propertyName; final SpanElement propertyNameSpan = propertyEditorView.getPropertyName(); setSpanAttributeAttributes(propertyName, hashedPropertyName, "propertyName" + hashedPropertyName, propertyNameSpan); final SpanElement propertyValueSpan = propertyEditorView.getPropertyValueSpan(); setSpanAttributeAttributes(propertyName, propertyValue, "propertyValue" + hashedPropertyName, propertyValueSpan); propertySpanElementMap.put(propertyName, propertyValueSpan); final InputElement propertyValueInput = propertyEditorView.getPropertyValueInput(); propertyValueInput.setAttribute("placeholder", hashedPropertyName); propertyValueInput.setAttribute("data-field", "propertyValue" + hashedPropertyName); propertyValueInput.setDisabled(true); propertyValueInput.getStyle().setDisplay(Style.Display.NONE); final LIElement propertyFields = propertyEditorView.getPropertyFields(); propertyFields.setAttribute("data-field", "propertyFields" + hashedPropertyName); if (propertyViewMap.containsKey(itemId)) { propertyViewMap.get(itemId).add(propertyEditorView); } else { List<PropertyView> toPut = new ArrayList<>(); toPut.add(propertyEditorView); propertyViewMap.put(itemId, toPut); } return propertyFields; }  }
PropertyPresenter implements PropertyView.Presenter { @Override public LIElement getPropertyFields(String itemId, String propertyName, String propertyValue) { final PropertyView propertyEditorView = viewsProvider.getPropertyEditorView(); String hashedPropertyName = "#" + propertyName; final SpanElement propertyNameSpan = propertyEditorView.getPropertyName(); setSpanAttributeAttributes(propertyName, hashedPropertyName, "propertyName" + hashedPropertyName, propertyNameSpan); final SpanElement propertyValueSpan = propertyEditorView.getPropertyValueSpan(); setSpanAttributeAttributes(propertyName, propertyValue, "propertyValue" + hashedPropertyName, propertyValueSpan); propertySpanElementMap.put(propertyName, propertyValueSpan); final InputElement propertyValueInput = propertyEditorView.getPropertyValueInput(); propertyValueInput.setAttribute("placeholder", hashedPropertyName); propertyValueInput.setAttribute("data-field", "propertyValue" + hashedPropertyName); propertyValueInput.setDisabled(true); propertyValueInput.getStyle().setDisplay(Style.Display.NONE); final LIElement propertyFields = propertyEditorView.getPropertyFields(); propertyFields.setAttribute("data-field", "propertyFields" + hashedPropertyName); if (propertyViewMap.containsKey(itemId)) { propertyViewMap.get(itemId).add(propertyEditorView); } else { List<PropertyView> toPut = new ArrayList<>(); toPut.add(propertyEditorView); propertyViewMap.put(itemId, toPut); } return propertyFields; }  @Override String getPropertyValue(String propertyName); @Override void editProperties(String itemId); @Override void stopEditProperties(String itemId); @Override Map<String, String> updateProperties(String itemId); @Override Map<String, String> getSimpleProperties(String itemId); @Override LIElement getPropertyFields(String itemId, String propertyName, String propertyValue); @Override LIElement getEditingPropertyFields(String itemId, String propertyName, String propertyValue); @Override void onToggleRowExpansion(String itemId, boolean isShown); @Override void deleteProperties(String itemId); }
PropertyPresenter implements PropertyView.Presenter { @Override public LIElement getPropertyFields(String itemId, String propertyName, String propertyValue) { final PropertyView propertyEditorView = viewsProvider.getPropertyEditorView(); String hashedPropertyName = "#" + propertyName; final SpanElement propertyNameSpan = propertyEditorView.getPropertyName(); setSpanAttributeAttributes(propertyName, hashedPropertyName, "propertyName" + hashedPropertyName, propertyNameSpan); final SpanElement propertyValueSpan = propertyEditorView.getPropertyValueSpan(); setSpanAttributeAttributes(propertyName, propertyValue, "propertyValue" + hashedPropertyName, propertyValueSpan); propertySpanElementMap.put(propertyName, propertyValueSpan); final InputElement propertyValueInput = propertyEditorView.getPropertyValueInput(); propertyValueInput.setAttribute("placeholder", hashedPropertyName); propertyValueInput.setAttribute("data-field", "propertyValue" + hashedPropertyName); propertyValueInput.setDisabled(true); propertyValueInput.getStyle().setDisplay(Style.Display.NONE); final LIElement propertyFields = propertyEditorView.getPropertyFields(); propertyFields.setAttribute("data-field", "propertyFields" + hashedPropertyName); if (propertyViewMap.containsKey(itemId)) { propertyViewMap.get(itemId).add(propertyEditorView); } else { List<PropertyView> toPut = new ArrayList<>(); toPut.add(propertyEditorView); propertyViewMap.put(itemId, toPut); } return propertyFields; }  @Override String getPropertyValue(String propertyName); @Override void editProperties(String itemId); @Override void stopEditProperties(String itemId); @Override Map<String, String> updateProperties(String itemId); @Override Map<String, String> getSimpleProperties(String itemId); @Override LIElement getPropertyFields(String itemId, String propertyName, String propertyValue); @Override LIElement getEditingPropertyFields(String itemId, String propertyName, String propertyValue); @Override void onToggleRowExpansion(String itemId, boolean isShown); @Override void deleteProperties(String itemId);  }