@Test public void testAddEnumerationItem() { final DataTypeConstraintEnumerationItem item = mock(DataTypeConstraintEnumerationItem.class); final List<DataTypeConstraintEnumerationItem> items = spy(new ArrayList<>()); final Element element = mock(Element.class); doReturn(items).when(constraintEnumeration).getEnumerationItems(); doReturn(item).when(constraintEnumeration).makeEnumerationItem(""); doReturn(element).when(constraintEnumeration).getElement(); doNothing().when(constraintEnumeration).refreshEnumerationItemsOrder(); constraintEnumeration.addEnumerationItem(); verify(items).add(item); verify(constraintEnumeration).refreshEnumerationItemsOrder(); verify(constraintEnumeration).render(); verify(constraintEnumeration).scrollToBottom(); verify(item).enableEditMode(); verify(item).setOrder(items.size() - 1); }
void addEnumerationItem() { final DataTypeConstraintEnumerationItem enumerationItem = makeEnumerationItem(""); enumerationItem.setOrder(getEnumerationItems().size()); refreshEnumerationItemsOrder(); getEnumerationItems().add(enumerationItem); render(); scrollToBottom(); enumerationItem.enableEditMode(); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void addEnumerationItem() { final DataTypeConstraintEnumerationItem enumerationItem = makeEnumerationItem(""); enumerationItem.setOrder(getEnumerationItems().size()); refreshEnumerationItemsOrder(); getEnumerationItems().add(enumerationItem); render(); scrollToBottom(); enumerationItem.enableEditMode(); } }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void addEnumerationItem() { final DataTypeConstraintEnumerationItem enumerationItem = makeEnumerationItem(""); enumerationItem.setOrder(getEnumerationItems().size()); refreshEnumerationItemsOrder(); getEnumerationItems().add(enumerationItem); render(); scrollToBottom(); enumerationItem.enableEditMode(); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void addEnumerationItem() { final DataTypeConstraintEnumerationItem enumerationItem = makeEnumerationItem(""); enumerationItem.setOrder(getEnumerationItems().size()); refreshEnumerationItemsOrder(); getEnumerationItems().add(enumerationItem); render(); scrollToBottom(); enumerationItem.enableEditMode(); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); @Override String getValue(); @Override void setValue(final String value); @Override void setConstraintValueType(final String type); void refreshView(); void refreshView(final Command onCompleteCallback); @Override Element getElement(); void render(); void scrollToPosition(final int position); List<DataTypeConstraintEnumerationItem> getEnumerationItems(); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { void addEnumerationItem() { final DataTypeConstraintEnumerationItem enumerationItem = makeEnumerationItem(""); enumerationItem.setOrder(getEnumerationItems().size()); refreshEnumerationItemsOrder(); getEnumerationItems().add(enumerationItem); render(); scrollToBottom(); enumerationItem.enableEditMode(); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); @Override String getValue(); @Override void setValue(final String value); @Override void setConstraintValueType(final String type); void refreshView(); void refreshView(final Command onCompleteCallback); @Override Element getElement(); void render(); void scrollToPosition(final int position); List<DataTypeConstraintEnumerationItem> getEnumerationItems();  }