@Test public void testScrollToPosition() { final HTMLElement element = mock(HTMLElement.class); final HTMLElement itemElement = mock(HTMLElement.class); when(constraintEnumeration.getElement()).thenReturn(element); when(element.querySelector("[data-position=\"2\"")).thenReturn(itemElement); constraintEnumeration.scrollToPosition(2); verify(scrollHelper).scrollTo(itemElement, element); }
public void scrollToPosition(final int position) { getElementByPosition(position).ifPresent(element -> scrollHelper.scrollTo(element, getElement())); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { public void scrollToPosition(final int position) { getElementByPosition(position).ifPresent(element -> scrollHelper.scrollTo(element, getElement())); } }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { public void scrollToPosition(final int position) { getElementByPosition(position).ifPresent(element -> scrollHelper.scrollTo(element, getElement())); } @Inject  DataTypeConstraintEnumeration(final View view,
                                         final DMNClientServicesProxy clientServicesProxy,
                                         final ScrollHelper scrollHelper,
                                         final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent,
                                         final ManagedInstance<DataTypeConstraintEnumerationItem> enumerationItemInstances); }
DataTypeConstraintEnumeration implements DataTypeConstraintComponent { public void scrollToPosition(final int position) { getElementByPosition(position).ifPresent(element -> scrollHelper.scrollTo(element, getElement())); } @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 { public void scrollToPosition(final int position) { getElementByPosition(position).ifPresent(element -> scrollHelper.scrollTo(element, getElement())); } @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();  }