use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class ShowAssetUsagesDisplayer method showAssetUsages.
/**
* Displays the usages for the asset identified by the resourceFQN using a specific message instead of the default message.
*
* @param headerMessage The message that will be shown instead of the default message
* @param path Path for the given asset
* @param resourceFQN Fully Qualified Name of the asset
* @param resourceType The type of asset.
* @param okCommand {@link Command} that is going to run when the user presses ok button. If there are no usages on the index the command will be automatically executed without opening the modal
* @param cancelCommand {@link Command} that is going to run when the user presses Cancel button.
*/
public void showAssetUsages(final String headerMessage, final Path path, final String resourceFQN, final ResourceType resourceType, final Command okCommand, final Command cancelCommand) {
PortablePreconditions.checkNotNull("headerMessage", headerMessage);
HTMLElement messageContainer = view.getDefaultMessageContainer();
messageContainer.setInnerHTML(headerMessage);
showAssetUsages(messageContainer, path, resourceFQN, resourceType, okCommand, cancelCommand);
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class CellEditorControlsViewImplTest method testShow.
@Test
public void testShow() {
final PopupEditorControls editor = mock(PopupEditorControls.class);
final int x = 10;
final int y = 20;
final HTMLElement element = mock(HTMLElement.class);
doReturn(element).when(view).getElement();
final CSSStyleDeclaration style = mock(CSSStyleDeclaration.class);
when(element.getStyle()).thenReturn(style);
view.show(editor, x, y);
verify(style).setProperty(LEFT, x + PX);
verify(style).setProperty(TOP, y + PX);
verify(view).setOnClosedByKeyboardCallback(editor);
verify(editor).show();
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class NewAssetHandlerWidget method init.
public void init(final String title, final IsWidget iconWidget, final Command onClick) {
text.setTextContent(title);
if (iconWidget != null) {
HTMLElement assetIconHtml = TemplateUtil.<HTMLElement>nativeCast(iconWidget.asWidget().getElement());
final Node clonedAssetIconHtml = assetIconHtml.cloneNode(true);
this.icon.appendChild(clonedAssetIconHtml);
}
if (onClick != null) {
button.setOnclick(e -> onClick.execute());
}
}
use of org.jboss.errai.common.client.dom.HTMLElement in project kie-wb-common by kiegroup.
the class AssigneeEditorWidgetViewImpl method add.
@Override
public void add(final AssigneeListItem listItem) {
HTMLElement tableRow = document.createElement("tr");
HTMLElement liveSearchTd = document.createElement("td");
listItem.getLiveSearchDropDown().asWidget().getElement().getStyle().setWidth(100, Style.Unit.PCT);
DOMUtil.appendWidgetToElement(liveSearchTd, listItem.getLiveSearchDropDown());
listItem.getLiveSearchDropDown().setEnabled(!readOnly);
HTMLElement actionTd = document.createElement("td");
Button button = (Button) document.createElement("button");
button.setClassName("btn btn-link fa fa-trash");
button.addEventListener("click", event -> {
listItem.notifyRemoval();
DOMUtil.removeFromParent(tableRow);
}, false);
button.setDisabled(readOnly);
actionTd.appendChild(button);
tableRow.appendChild(liveSearchTd);
tableRow.appendChild(actionTd);
assigneeRows.appendChild(tableRow);
assigneeRowsElements.add(new Pair<>(listItem.getLiveSearchDropDown(), button));
elements.put(listItem, tableRow);
}
use of org.jboss.errai.common.client.dom.HTMLElement in project drools-wb by kiegroup.
the class AbstractScenarioConfirmationPopupViewTest method getElement.
@Test
public void getElement() {
final HTMLElement retrieved = popupView.getElement();
assertNotNull(retrieved);
}
Aggregations