@Test public void testIsDuplicateName() { assertFalse(widget.isDuplicateName(null)); assertFalse(widget.isDuplicateName("")); assertTrue(widget.isDuplicateName(" aBc")); assertTrue(widget.isDuplicateName("aBc ")); assertTrue(widget.isDuplicateName(" aBc ")); assertTrue(widget.isDuplicateName(" aBc")); assertFalse(widget.isDuplicateName(" ")); assertTrue(widget.isDuplicateName("aBc")); assertFalse(widget.isDuplicateName("def")); assertFalse(widget.isDuplicateName("q")); }
public boolean isDuplicateName(final String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { if (name.trim().compareTo(row.getName()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; }
ActivityDataIOEditorWidget implements ActivityDataIOEditorWidgetView.Presenter { public boolean isDuplicateName(final String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { if (name.trim().compareTo(row.getName()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; } }
ActivityDataIOEditorWidget implements ActivityDataIOEditorWidgetView.Presenter { public boolean isDuplicateName(final String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { if (name.trim().compareTo(row.getName()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; }  }
ActivityDataIOEditorWidget implements ActivityDataIOEditorWidgetView.Presenter { public boolean isDuplicateName(final String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { if (name.trim().compareTo(row.getName()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; }  @PostConstruct void init(); @Override void handleAddClick(); void setIsSingleVar(final boolean isSingleVar); void setVariableType(final VariableType variableType); void setAllowDuplicateNames(final boolean allowDuplicateNames,
                                       final String duplicateNameErrorMessage); void removeAssignment(final AssignmentRow assignmentRow); void setData(final List<AssignmentRow> assignmentRows); List<AssignmentRow> getData(); VariableType getVariableType(); void setDataTypes(final ListBoxValues dataTypeListBoxValues); void setProcessVariables(final ListBoxValues processVarListBoxValues); void setDisallowedNames(final Set<String> disallowedNames,
                                   final String disallowedNameErrorMessage); boolean isDuplicateName(final String name); boolean isMultipleInstanceVariable(final String name); void setIsVisible(final boolean visible); Widget getWidget(); void setReadOnly(final boolean readOnly); }
ActivityDataIOEditorWidget implements ActivityDataIOEditorWidgetView.Presenter { public boolean isDuplicateName(final String name) { if (name == null || name.trim().isEmpty()) { return false; } List<AssignmentRow> as = view.getAssignmentRows(); if (as != null && !as.isEmpty()) { int nameCount = 0; for (AssignmentRow row : as) { if (name.trim().compareTo(row.getName()) == 0) { nameCount++; if (nameCount > 1) { return true; } } } } return false; }  @PostConstruct void init(); @Override void handleAddClick(); void setIsSingleVar(final boolean isSingleVar); void setVariableType(final VariableType variableType); void setAllowDuplicateNames(final boolean allowDuplicateNames,
                                       final String duplicateNameErrorMessage); void removeAssignment(final AssignmentRow assignmentRow); void setData(final List<AssignmentRow> assignmentRows); List<AssignmentRow> getData(); VariableType getVariableType(); void setDataTypes(final ListBoxValues dataTypeListBoxValues); void setProcessVariables(final ListBoxValues processVarListBoxValues); void setDisallowedNames(final Set<String> disallowedNames,
                                   final String disallowedNameErrorMessage); boolean isDuplicateName(final String name); boolean isMultipleInstanceVariable(final String name); void setIsVisible(final boolean visible); Widget getWidget(); void setReadOnly(final boolean readOnly);  }