@Test public void testSetupShortcutsTooltips() { final Element editButton = mock(Element.class); final Element saveButton = mock(Element.class); final Element addDataTypeRow = mock(Element.class); final Element closeButton = mock(Element.class); final Element removeButton = mock(Element.class); final Element arrow = mock(Element.class); final String arrowKeysTooltip = "arrowKeysTooltip"; final String dataTypeListItemViewEditKey = "Edit (Ctrl + E)"; final String dataTypeListItemViewSaveKey = "Save (Ctrl + S)"; final String dataTypeListItemViewAddRowBelowKey = "Add row below (Ctrl + B)"; final String dataTypeListItemViewRemoveKey = "Remove (Ctrl + Backspace)"; final String dataTypeListItemViewCancelKey = "Cancel (Esc)"; doReturn(editButton).when(view).getEditButton(); doReturn(saveButton).when(view).getSaveButton(); doReturn(addDataTypeRow).when(view).getAddDataTypeRowButton(); doReturn(closeButton).when(view).getCloseButton(); doReturn(removeButton).when(view).getRemoveButton(); doReturn(arrow).when(view).getArrow(); when(translationService.format(DataTypeListItemView_ArrowKeysTooltip)).thenReturn(arrowKeysTooltip); when(translationService.format(DataTypeListItemView_Edit)).thenReturn(dataTypeListItemViewEditKey); when(translationService.format(DataTypeListItemView_Save)).thenReturn(dataTypeListItemViewSaveKey); when(translationService.format(DataTypeListItemView_AddRowBelow)).thenReturn(dataTypeListItemViewAddRowBelowKey); when(translationService.format(DataTypeListItemView_Remove)).thenReturn(dataTypeListItemViewRemoveKey); when(translationService.format(DataTypeListItemView_Cancel)).thenReturn(dataTypeListItemViewCancelKey); view.setupShortcutsTooltips(); verify(editButton).setAttribute("data-title", dataTypeListItemViewEditKey); verify(saveButton).setAttribute("data-title", dataTypeListItemViewSaveKey); verify(addDataTypeRow).setAttribute("data-title", dataTypeListItemViewAddRowBelowKey); verify(removeButton).setAttribute("data-title", dataTypeListItemViewRemoveKey); verify(closeButton).setAttribute("data-title", dataTypeListItemViewCancelKey); verify(arrow).setAttribute("data-title", arrowKeysTooltip); verify(view).setupTooltips(); }
void setupShortcutsTooltips() { final String arrowKeysTooltip = translationService.format(DataTypeListItemView_ArrowKeysTooltip); setTitleAttribute(getEditButton(), translationService.format(DataTypeListItemView_Edit)); setTitleAttribute(getSaveButton(), translationService.format(DataTypeListItemView_Save)); setTitleAttribute(getAddDataTypeRowButton(), translationService.format(DataTypeListItemView_AddRowBelow)); setTitleAttribute(getRemoveButton(), translationService.format(DataTypeListItemView_Remove)); setTitleAttribute(getCloseButton(), translationService.format(DataTypeListItemView_Cancel)); setTitleAttribute(getArrow(), arrowKeysTooltip); setupTooltips(); }
DataTypeListItemView implements DataTypeListItem.View { void setupShortcutsTooltips() { final String arrowKeysTooltip = translationService.format(DataTypeListItemView_ArrowKeysTooltip); setTitleAttribute(getEditButton(), translationService.format(DataTypeListItemView_Edit)); setTitleAttribute(getSaveButton(), translationService.format(DataTypeListItemView_Save)); setTitleAttribute(getAddDataTypeRowButton(), translationService.format(DataTypeListItemView_AddRowBelow)); setTitleAttribute(getRemoveButton(), translationService.format(DataTypeListItemView_Remove)); setTitleAttribute(getCloseButton(), translationService.format(DataTypeListItemView_Cancel)); setTitleAttribute(getArrow(), arrowKeysTooltip); setupTooltips(); } }
DataTypeListItemView implements DataTypeListItem.View { void setupShortcutsTooltips() { final String arrowKeysTooltip = translationService.format(DataTypeListItemView_ArrowKeysTooltip); setTitleAttribute(getEditButton(), translationService.format(DataTypeListItemView_Edit)); setTitleAttribute(getSaveButton(), translationService.format(DataTypeListItemView_Save)); setTitleAttribute(getAddDataTypeRowButton(), translationService.format(DataTypeListItemView_AddRowBelow)); setTitleAttribute(getRemoveButton(), translationService.format(DataTypeListItemView_Remove)); setTitleAttribute(getCloseButton(), translationService.format(DataTypeListItemView_Cancel)); setTitleAttribute(getArrow(), arrowKeysTooltip); setupTooltips(); } @Inject  DataTypeListItemView(final HTMLDivElement view,
                                final TranslationService translationService,
                                final @DMNEditor ReadOnlyProvider readOnlyProvider); }
DataTypeListItemView implements DataTypeListItem.View { void setupShortcutsTooltips() { final String arrowKeysTooltip = translationService.format(DataTypeListItemView_ArrowKeysTooltip); setTitleAttribute(getEditButton(), translationService.format(DataTypeListItemView_Edit)); setTitleAttribute(getSaveButton(), translationService.format(DataTypeListItemView_Save)); setTitleAttribute(getAddDataTypeRowButton(), translationService.format(DataTypeListItemView_AddRowBelow)); setTitleAttribute(getRemoveButton(), translationService.format(DataTypeListItemView_Remove)); setTitleAttribute(getCloseButton(), translationService.format(DataTypeListItemView_Cancel)); setTitleAttribute(getArrow(), arrowKeysTooltip); setupTooltips(); } @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 { void setupShortcutsTooltips() { final String arrowKeysTooltip = translationService.format(DataTypeListItemView_ArrowKeysTooltip); setTitleAttribute(getEditButton(), translationService.format(DataTypeListItemView_Edit)); setTitleAttribute(getSaveButton(), translationService.format(DataTypeListItemView_Save)); setTitleAttribute(getAddDataTypeRowButton(), translationService.format(DataTypeListItemView_AddRowBelow)); setTitleAttribute(getRemoveButton(), translationService.format(DataTypeListItemView_Remove)); setTitleAttribute(getCloseButton(), translationService.format(DataTypeListItemView_Cancel)); setTitleAttribute(getArrow(), arrowKeysTooltip); setupTooltips(); } @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; }