@Test public void testIsDuplicateAttributeNullOrEmpty() { assertFalse(metaDataEditor.isDuplicateAttribute(null)); assertFalse(metaDataEditor.isDuplicateAttribute(" ")); }
@Override public boolean isDuplicateAttribute(final String attribute) { if (attribute == null || attribute.trim().isEmpty()) { return false; } List<MetaDataRow> as = view.getMetaDataRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; String currName = attribute.trim(); for (MetaDataRow row : as) { String rowName = row.getAttribute(); if (rowName != null && currName.compareTo(rowName.trim()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; }
MetaDataEditorFieldRenderer extends FieldRenderer<MetaDataEditorFieldDefinition, DefaultFormGroup> implements MetaDataEditorWidgetView.Presenter { @Override public boolean isDuplicateAttribute(final String attribute) { if (attribute == null || attribute.trim().isEmpty()) { return false; } List<MetaDataRow> as = view.getMetaDataRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; String currName = attribute.trim(); for (MetaDataRow row : as) { String rowName = row.getAttribute(); if (rowName != null && currName.compareTo(rowName.trim()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; } }
MetaDataEditorFieldRenderer extends FieldRenderer<MetaDataEditorFieldDefinition, DefaultFormGroup> implements MetaDataEditorWidgetView.Presenter { @Override public boolean isDuplicateAttribute(final String attribute) { if (attribute == null || attribute.trim().isEmpty()) { return false; } List<MetaDataRow> as = view.getMetaDataRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; String currName = attribute.trim(); for (MetaDataRow row : as) { String rowName = row.getAttribute(); if (rowName != null && currName.compareTo(rowName.trim()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; } @Inject  MetaDataEditorFieldRenderer(final MetaDataEditorWidgetView metaDataEditor,
                                       final SessionManager sessionManager,
                                       final ErrorPopupPresenter errorPopupPresenter,
                                       final Event<NotificationEvent> notification); }
MetaDataEditorFieldRenderer extends FieldRenderer<MetaDataEditorFieldDefinition, DefaultFormGroup> implements MetaDataEditorWidgetView.Presenter { @Override public boolean isDuplicateAttribute(final String attribute) { if (attribute == null || attribute.trim().isEmpty()) { return false; } List<MetaDataRow> as = view.getMetaDataRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; String currName = attribute.trim(); for (MetaDataRow row : as) { String rowName = row.getAttribute(); if (rowName != null && currName.compareTo(rowName.trim()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; } @Inject  MetaDataEditorFieldRenderer(final MetaDataEditorWidgetView metaDataEditor,
                                       final SessionManager sessionManager,
                                       final ErrorPopupPresenter errorPopupPresenter,
                                       final Event<NotificationEvent> notification); @Override String getName(); @Override void doSave(); @Override void addAttribute(); @Override void notifyModelChanged(); @Override List<MetaDataRow> deserializeMetaDataAttributes(final String s); @Override String serializeMetaDataAttributes(final List<MetaDataRow> metaDataRows); @Override boolean isDuplicateAttribute(final String attribute); @Override void removeMetaData(final MetaDataRow metaDataRow); @Override Path getDiagramPath(); @Override void showErrorMessage(String message); }
MetaDataEditorFieldRenderer extends FieldRenderer<MetaDataEditorFieldDefinition, DefaultFormGroup> implements MetaDataEditorWidgetView.Presenter { @Override public boolean isDuplicateAttribute(final String attribute) { if (attribute == null || attribute.trim().isEmpty()) { return false; } List<MetaDataRow> as = view.getMetaDataRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; String currName = attribute.trim(); for (MetaDataRow row : as) { String rowName = row.getAttribute(); if (rowName != null && currName.compareTo(rowName.trim()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; } @Inject  MetaDataEditorFieldRenderer(final MetaDataEditorWidgetView metaDataEditor,
                                       final SessionManager sessionManager,
                                       final ErrorPopupPresenter errorPopupPresenter,
                                       final Event<NotificationEvent> notification); @Override String getName(); @Override void doSave(); @Override void addAttribute(); @Override void notifyModelChanged(); @Override List<MetaDataRow> deserializeMetaDataAttributes(final String s); @Override String serializeMetaDataAttributes(final List<MetaDataRow> metaDataRows); @Override boolean isDuplicateAttribute(final String attribute); @Override void removeMetaData(final MetaDataRow metaDataRow); @Override Path getDiagramPath(); @Override void showErrorMessage(String message);  }