@Test public void testEnableFocusMode() { final DataType parentDataType = mock(DataType.class); final String parentDataTypeUUID = "parentDataTypeUUID"; final Element parentElement = mock(Element.class); final Element child1 = makeChildElement("child1UUID"); final Element child2 = makeChildElement("child2UUID"); final NodeList<Element> children = spy(new NodeList<>()); when(parentDataType.getUUID()).thenReturn(parentDataTypeUUID); when(parentElement.getAttribute("data-row-uuid")).thenReturn(parentDataTypeUUID); doReturn(parentDataType).when(view).getDataType(); doReturn(child1).when(children).getAt(0); doReturn(child2).when(children).getAt(1); doReturn(nameInput).when(view).getNameInput(); mockDOMElementByUUID(parentDataTypeUUID, parentElement); mockDOMElementsByParentUUID(parentDataTypeUUID, children); children.length = 2; parentElement.classList = mock(DOMTokenList.class); view.enableFocusMode(); verify(parentElement.classList).add(FOCUSED_CSS_CLASS); verify(child1.classList).add(FOCUSED_CSS_CLASS); verify(child2.classList).add(FOCUSED_CSS_CLASS); verify(nameInput).select(); }
@Override public void enableFocusMode() { final Element rowElement = getRowElement(getDataType()); asFocusedDataType(rowElement); forEachChildElement(rowElement, ListItemViewCssHelper::asFocusedDataType); getNameInput().select(); }
DataTypeListItemView implements DataTypeListItem.View { @Override public void enableFocusMode() { final Element rowElement = getRowElement(getDataType()); asFocusedDataType(rowElement); forEachChildElement(rowElement, ListItemViewCssHelper::asFocusedDataType); getNameInput().select(); } }
DataTypeListItemView implements DataTypeListItem.View { @Override public void enableFocusMode() { final Element rowElement = getRowElement(getDataType()); asFocusedDataType(rowElement); forEachChildElement(rowElement, ListItemViewCssHelper::asFocusedDataType); getNameInput().select(); } @Inject  DataTypeListItemView(final HTMLDivElement view,
                                final TranslationService translationService,
                                final @DMNEditor ReadOnlyProvider readOnlyProvider); }
DataTypeListItemView implements DataTypeListItem.View { @Override public void enableFocusMode() { final Element rowElement = getRowElement(getDataType()); asFocusedDataType(rowElement); forEachChildElement(rowElement, ListItemViewCssHelper::asFocusedDataType); getNameInput().select(); } @Inject  DataTypeListItemView(final HTMLDivElement view,
                                final TranslationService translationService,
                                final @DMNEditor ReadOnlyProvider readOnlyProvider); @Override void init(final DataTypeListItem presenter); @Override HTMLElement getElement(); @Override void toggleArrow(final boolean show); @Override void expand(); @Override void collapse(); @Override void showEditButton(); @Override void showSaveButton(); @Override void enableFocusMode(); @Override void disableFocusMode(); @Override boolean isOnFocusMode(); @Override String getName(); @Override void setName(final String name); @Override void showDataTypeNameInput(); @Override void hideDataTypeNameInput(); @Override void setupSelectComponent(final DataTypeSelect typeSelect); @Override void setupConstraintComponent(final DataTypeConstraint dataTypeConstraintComponent); @Override void setupListComponent(final SmallSwitchComponent dataTypeListComponent); @Override void showListContainer(); @Override void hideListContainer(); @Override void showListYesLabel(); @Override void hideListYesLabel(); @Override boolean isCollapsed(); @Override void setDataType(final DataType dataType); }
DataTypeListItemView implements DataTypeListItem.View { @Override public void enableFocusMode() { final Element rowElement = getRowElement(getDataType()); asFocusedDataType(rowElement); forEachChildElement(rowElement, ListItemViewCssHelper::asFocusedDataType); getNameInput().select(); } @Inject  DataTypeListItemView(final HTMLDivElement view,
                                final TranslationService translationService,
                                final @DMNEditor ReadOnlyProvider readOnlyProvider); @Override void init(final DataTypeListItem presenter); @Override HTMLElement getElement(); @Override void toggleArrow(final boolean show); @Override void expand(); @Override void collapse(); @Override void showEditButton(); @Override void showSaveButton(); @Override void enableFocusMode(); @Override void disableFocusMode(); @Override boolean isOnFocusMode(); @Override String getName(); @Override void setName(final String name); @Override void showDataTypeNameInput(); @Override void hideDataTypeNameInput(); @Override void setupSelectComponent(final DataTypeSelect typeSelect); @Override void setupConstraintComponent(final DataTypeConstraint dataTypeConstraintComponent); @Override void setupListComponent(final SmallSwitchComponent dataTypeListComponent); @Override void showListContainer(); @Override void hideListContainer(); @Override void showListYesLabel(); @Override void hideListYesLabel(); @Override boolean isCollapsed(); @Override void setDataType(final DataType dataType); static final String UUID_ATTR; static final String NAME_DATA_FIELD; static final String PARENT_UUID_ATTR; }