use of elemental2.dom.HTMLLIElement in project domino-ui-demo by DominoKit.
the class ThemesViewImpl method applyTheme.
private void applyTheme(Theme theme) {
if (nonNull(activeTheme))
activeTheme.classList.remove("active");
HTMLLIElement themeElement = themesElements.get(theme.getKey());
this.activeTheme = themeElement;
themeElement.classList.add("active");
theme.apply();
if (nonNull(themeAppliedHandler)) {
themeAppliedHandler.onThemeApplied(theme.getKey());
}
}
use of elemental2.dom.HTMLLIElement in project kie-wb-common by kiegroup.
the class StructureTypesTooltipViewTest method testMakeFieldElement.
@Test
public void testMakeFieldElement() {
final DataType field = mock(DataType.class);
final String typeName = "tPerson";
final HTMLLIElement expectedHtmlLiElement = mock(HTMLLIElement.class);
final HTMLLIElement htmlTypeElement = mock(HTMLLIElement.class);
doReturn(expectedHtmlLiElement).when(view).makeHTMLLIElement();
doReturn(htmlTypeElement).when(view).makeTypeElement(field);
when(field.getName()).thenReturn(typeName);
final HTMLLIElement actualHtmlLiElement = view.makeFieldElement(field);
assertSame(expectedHtmlLiElement, actualHtmlLiElement);
assertEquals(typeName, expectedHtmlLiElement.textContent);
verify(expectedHtmlLiElement).appendChild(htmlTypeElement);
}
use of elemental2.dom.HTMLLIElement in project domino-ui-demo by DominoKit.
the class ThemesViewImpl method setLayout.
@Override
public void setLayout(final IsLayout layout) {
HTMLLIElement hideElement = makeIcon(Icons.HARDWARE_ICONS.keyboard_tab());
hideElement.addEventListener("click", e -> {
if (nonNull(Elements.label()))
layout.hideRightPanel();
});
card.getHeaderBar().appendChild(hideElement);
card.asElement().style.marginBottom = CSSProperties.MarginBottomUnionType.of(0);
card.getBody().style.padding = CSSProperties.PaddingUnionType.of(0);
card.getBody().appendChild(themesPanel.asElement());
HTMLElement actionItem = Js.cast(layout.addActionItem("style").get());
actionItem.addEventListener("click", e -> {
layout.setRightPanelContent(themesContent());
layout.showRightPanel();
});
}
use of elemental2.dom.HTMLLIElement in project domino-ui-demo by DominoKit.
the class ThemesViewImpl method addTheme.
private HTMLLIElement addTheme(Theme theme, boolean active) {
HTMLLIElement themeElement = Elements.li().add(Elements.div().css(theme.getThemeStyle().replace("theme-", ""))).add(Elements.span().textContent(theme.getName())).asElement();
themesElements.put(theme.getKey(), themeElement);
if (active) {
themeElement.classList.add("active");
activeTheme = themeElement;
applyTheme(theme);
}
themesPanel.themesContainer.appendChild(themeElement);
themeElement.addEventListener("click", evt -> {
applyTheme(theme);
});
return themeElement;
}
use of elemental2.dom.HTMLLIElement in project kie-wb-common by kiegroup.
the class StructureTypesTooltipView method makeFieldElement.
HTMLLIElement makeFieldElement(final DataType field) {
final HTMLLIElement htmlLiElement = makeHTMLLIElement();
final String name = field.getName();
final HTMLElement type = makeTypeElement(field);
htmlLiElement.textContent = name;
htmlLiElement.appendChild(type);
return htmlLiElement;
}
Aggregations