use of elemental2.dom.HTMLTableCellElement in project Charba-Showcase-J2CL by pepstock-org.
the class GradientLineCase method configCheckBox.
private void configCheckBox(HTMLTableCellElement actionsCol, HTMLInputElement checkBox, String label, String prefixId) {
String checkBoxId = prefixId + (int) (Math.random() * 1000D);
HTMLLabelElement labelForCheckBox = (HTMLLabelElement) DomGlobal.document.createElement("label");
labelForCheckBox.htmlFor = checkBoxId;
labelForCheckBox.appendChild(DomGlobal.document.createTextNode(label));
actionsCol.appendChild(labelForCheckBox);
checkBox.id = checkBoxId;
checkBox.type = "checkbox";
checkBox.className = "gwt-CheckBox";
checkBox.checked = true;
checkBox.style.marginRight = MarginRightUnionType.of("5px");
actionsCol.appendChild(checkBox);
}
use of elemental2.dom.HTMLTableCellElement in project Charba-Showcase-J2CL by pepstock-org.
the class TilesPointStylesCase method configListBox.
private void configListBox(HTMLTableCellElement actionsCol, HTMLSelectElement listBox, String label, String prefixId) {
String listId = prefixId + (int) (Math.random() * 1000D);
HTMLLabelElement labelForListBox = (HTMLLabelElement) DomGlobal.document.createElement("label");
labelForListBox.htmlFor = listId;
labelForListBox.appendChild(DomGlobal.document.createTextNode(label));
actionsCol.appendChild(labelForListBox);
listBox.id = listId;
listBox.onchange = (p0) -> {
handleShapes();
return null;
};
listBox.className = "gwt-ListBox";
listBox.style.marginRight = MarginRightUnionType.of("5px");
actionsCol.appendChild(listBox);
}
use of elemental2.dom.HTMLTableCellElement in project Charba-Showcase-J2CL by pepstock-org.
the class MainView method loadMenu.
private void loadMenu(HTMLTableCellElement menu) {
HTMLElement title = (HTMLElement) DomGlobal.document.createElement("div");
title.style.width = WidthUnionType.of("250px");
title.style.textAlign = "center";
title.innerHTML = " J2CL showcase";
title.className = "myTitle";
title.onclick = (p0) -> {
handleHome(p0);
return null;
};
menu.appendChild(title);
HTMLDivElement parent = (HTMLDivElement) DomGlobal.document.createElement("div");
parent.style.width = WidthUnionType.of("250px");
parent.style.lineHeight = LineHeightUnionType.of("64px");
menu.appendChild(parent);
for (MenuItem item : MenuItem.values()) {
HTMLDivElement row = (HTMLDivElement) DomGlobal.document.createElement("div");
row.style.width = WidthUnionType.of("250px");
row.style.borderWidth = BorderWidthUnionType.of("3px");
row.style.borderColor = "rgba(0,0,0,0)";
row.style.borderStyle = "dashed";
row.style.verticalAlign = "middle";
row.className = "myItem";
parent.appendChild(row);
HTMLImageElement img = (HTMLImageElement) DomGlobal.document.createElement("img");
img.src = item.getImgSrc();
img.width = 36;
img.height = 36;
img.className = "myImgItem";
img.style.display = "inline-block";
img.style.verticalAlign = "middle";
img.style.width = WidthUnionType.of("36px");
row.appendChild(img);
img.onclick = (p0) -> {
handleEvent(p0, item);
return null;
};
HTMLDivElement label = (HTMLDivElement) DomGlobal.document.createElement("div");
label.innerHTML = item.getLabel();
label.className = "myLabelItem";
label.style.verticalAlign = "middle";
label.style.display = "inline-block";
label.onclick = (p0) -> {
handleEvent(p0, item);
return null;
};
row.appendChild(label);
}
}
use of elemental2.dom.HTMLTableCellElement in project console by hal.
the class TopologyPreview method serverGroupElement.
private HTMLElement serverGroupElement(ServerGroup serverGroup) {
HTMLElement dropdown;
HTMLTableCellElement element = th().on(click, event -> serverGroupDetails(serverGroup)).data("serverGroup", // NON-NLS
serverGroup.getName()).add(div().css(serverGroupContainer).add(dropdown = div().css(CSS.dropdown).element())).element();
if (!serverGroupActions.isPending(serverGroup) && isAllowed(serverGroup)) {
String serverGroupDropDownId = Ids.serverGroup(serverGroup.getName());
dropdown.appendChild(a().id(serverGroupDropDownId).css(clickable, dropdownToggle, name).data(UIConstants.TOGGLE, UIConstants.DROPDOWN).aria(UIConstants.HAS_POPUP, UIConstants.TRUE).title(serverGroup.getName()).textContent(serverGroup.getName()).element());
dropdown.appendChild(ul().css(dropdownMenu).attr(UIConstants.ROLE, UIConstants.MENU).aria(UIConstants.LABELLED_BY, serverGroupDropDownId).addAll(serverGroupActions(serverGroup)).element());
} else {
dropdown.appendChild(span().css(name).title(serverGroup.getName()).textContent(serverGroup.getName()).element());
}
return element;
}
use of elemental2.dom.HTMLTableCellElement in project domino-ui-demo by DominoKit.
the class DataTableViewImpl method treeGridFullParentSpan.
@SampleMethod
private void treeGridFullParentSpan() {
TableConfig<Contact> tableConfig = new TableConfig<>();
tableConfig.addColumn(ColumnConfig.<Contact>create("id", "#").textAlign("right").asHeader().setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))).addColumn(ColumnConfig.<Contact>create("status", "Status").textAlign("center").setCellRenderer(cell -> {
if (cell.getTableRow().getRecord().isActive()) {
return Style.of(Icons.ALL.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element();
} else {
return Style.of(Icons.ALL.highlight_off()).setColor(Color.RED_DARKEN_3.getHex()).element();
}
})).addColumn(ColumnConfig.<Contact>create("gender", "Gender").setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())).textAlign("center")).addColumn(ColumnConfig.<Contact>create("eyeColor", "Eye color").setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())).textAlign("center")).addColumn(ColumnConfig.<Contact>create("balance", "Balance").setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))).addColumn(ColumnConfig.<Contact>create("email", "Email").setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))).addColumn(ColumnConfig.<Contact>create("phone", "Phone").setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))).addColumn(ColumnConfig.<Contact>create("badges", "Badges").setCellRenderer(cell -> {
if (cell.getTableRow().getRecord().getAge() < 35) {
return Badge.create("Young").setBackground(ColorScheme.GREEN.color()).element();
}
return TextNode.of("");
})).onUtilityColumn(utilityColumn -> {
utilityColumn.setTitle("First name").setSortable(true, "id");
}).setMultiSelect(true).addPlugin(new SortPlugin<>()).addPlugin(new SelectionPlugin<>()).addPlugin(new RecordDetailsPlugin<>(cell -> new ContactDetails(cell).element())).addPlugin(new RowMarkerPlugin<>(tableCellInfo -> ContactUiUtils.getBalanceColor(tableCellInfo.getRecord()))).addPlugin(new TreeGridPlugin<Contact>((parent, itemsConsumer) -> {
itemsConsumer.accept(Optional.ofNullable(parent.getFriends()));
}).setIndentColumnElementSupplier(tableRow -> Paragraph.create(tableRow.getRecord().getName()).setMarginBottom("0").element()).setParentRowCellsSupplier((dataTable, tableRow) -> {
HTMLTableCellElement cellElement = DominoElement.of(td()).setAttribute("colspan", "8").element();
RowCell<Contact> rowCell = new RowCell<>(new CellRenderer.CellInfo<>(tableRow, cellElement), dataTable.getTableConfig().getColumnByName("id"));
return Collections.singletonList(rowCell);
}).setIndent(60));
LocalListDataStore<Contact> localListDataStore = new LocalListDataStore<>();
DataTable<Contact> table = new DataTable<>(tableConfig, localListDataStore);
element.appendChild(Card.create("TREE GRID PLUGIN - Full PARENT SPAN", "Render records in tree style with expand and collapse features").setCollapsible().appendChild(new TableStyleActions(table)).appendChild(table).element());
contactListParseHandlers.add(contacts -> {
localListDataStore.setData(contacts.subList(0, 25));
table.load();
});
}
Aggregations