use of org.gwtbootstrap3.client.ui.ListItem in project kie-wb-common by kiegroup.
the class NavigatorBreadcrumbs method build.
public void build(final CustomDropdown... headers) {
breadcrumbs.clear();
for (final CustomDropdown header : headers) {
header.addStyleName(ProjectExplorerResources.INSTANCE.CSS().breadcrumbHeader());
breadcrumbs.add(new ListItem() {
{
add(header);
}
});
}
}
use of org.gwtbootstrap3.client.ui.ListItem in project ovirt-engine by oVirt.
the class OvirtBreadCrumbsView method buildCrumbs.
@Override
public void buildCrumbs(String modelTitle, String modelHref) {
// Clear the existing path.
container.clear();
breadCrumbs = new Breadcrumbs();
container.add(breadCrumbs);
// Add primary menu label.
String primaryLabel = menuDetailsProvider.getLabelFromHref(modelHref);
if (primaryLabel != null) {
breadCrumbs.add(new ListItem(primaryLabel));
}
menuDetailsProvider.setMenuActive(modelHref);
// Add main model name.
AnchorListItem mainModelAnchor = new AnchorListItem(modelTitle);
// $NON-NLS-1$
mainModelAnchor.setHref("#" + modelHref);
breadCrumbs.add(mainModelAnchor);
if (currentSelectedItemWidget != null && !hideSelectedWidget) {
breadCrumbs.add(currentSelectedItemWidget);
}
}
use of org.gwtbootstrap3.client.ui.ListItem in project ovirt-engine by oVirt.
the class AbstractMainWithDetailsTableView method setActiveTags.
public void setActiveTags(List<TagModel> tags) {
resultList.clear();
for (final TagModel tag : tags) {
ListItem tagItem = new ListItem();
Span label = new Span();
label.addStyleName(Styles.LABEL);
label.addStyleName(PatternflyConstants.PF_LABEL_INFO);
label.setText(tag.getName().getEntity());
Anchor deactivateAnchor = new Anchor();
Span closeIconSpan = new Span();
closeIconSpan.addStyleName(PatternflyIconType.PF_BASE.getCssName());
closeIconSpan.addStyleName(PatternflyIconType.PF_CLOSE.getCssName());
deactivateAnchor.add(closeIconSpan);
deactivateAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
tag.setSelection(false);
}
});
label.add(deactivateAnchor);
tagItem.add(label);
resultList.add(tagItem);
}
resultRow.setVisible(!tags.isEmpty());
}
use of org.gwtbootstrap3.client.ui.ListItem in project ovirt-engine by oVirt.
the class NotificationListWidget method setInternalRowData.
private void setInternalRowData(int start, List<? extends AuditLog> values) {
// Compare the new values with the ones currently displayed, if no changes, don't refresh.
if (values != null && !valuesEquals(values)) {
rowCount = values.size();
boolean collapsed = checkIfCollapsed();
currentValues = values;
content.clear();
eventPanelHeading = new PanelHeader();
Heading titleHeading = new Heading(HeadingSize.H4);
titleHeading.addStyleName(PatternflyConstants.PF_PANEL_TITLE);
titleAnchor = new Anchor(hashString(thisWidgetId));
titleAnchor.setDataParent(hashString(parentWidgetId));
titleAnchor.setDataTarget(hashString(thisWidgetId));
titleAnchor.setDataToggle(this.toggle);
titleAnchor.setText(this.title);
titleAnchor.addClickHandler(e -> e.preventDefault());
if (collapsed) {
titleAnchor.addStyleName(PatternflyConstants.COLLAPSED);
}
titleHeading.add(titleAnchor);
eventPanelHeading.add(titleHeading);
content.add(eventPanelHeading);
PanelCollapse eventCollapse = new PanelCollapse();
eventCollapse.setId(thisWidgetId);
eventPanelBody = new PanelBody();
if (this.containerHeight > 0) {
eventPanelBody.getElement().getStyle().setProperty(MAX_HEIGHT, containerHeight + Unit.PX.getType());
eventPanelBody.getElement().getStyle().setOverflowY(Overflow.AUTO);
}
eventCollapse.add(eventPanelBody);
if (collapsed) {
eventCollapse.getElement().setAttribute(ARIA_EXPANDED, String.valueOf(false));
eventCollapse.getElement().getStyle().setHeight(0, Unit.PX);
} else {
eventCollapse.getElement().setAttribute(ARIA_EXPANDED, String.valueOf(true));
eventCollapse.addStyleName(Styles.IN);
}
content.add(eventCollapse);
for (final AuditLog auditLog : values) {
DrawerNotification notification = new DrawerNotification(auditLog);
for (int i = 0; i < actionLabels.size(); i++) {
final int index = i;
ActionAnchorListItem listItem = new ActionAnchorListItem(actionLabels.get(index));
listItem.addClickHandler(e -> auditLogActions.get(index).executeCommand(actionCommand.get(index), auditLog));
notification.addActionButton(listItem);
}
eventPanelBody.add(notification);
}
if (clearAllActionLabel != null) {
actionPanel = new FlowPanel();
actionPanel.addStyleName(PatternflyConstants.PF_DRAWER_ACTION);
eventCollapse.add(actionPanel);
Button clearAllbutton = new Button(clearAllActionLabel);
clearAllbutton.addStyleName(BTN_LINK);
clearAllbutton.addStyleName(Styles.BTN_BLOCK);
clearAllbutton.removeStyleName(BTN_DEFAULT);
clearAllbutton.addClickHandler(event -> clearAllActionCallback.executeCommand(clearAllActionCommand, null));
actionPanel.add(clearAllbutton);
Button restoreAllbutton = new Button(restoreAllActionLabel);
restoreAllbutton.addStyleName(BTN_LINK);
restoreAllbutton.addStyleName(Styles.BTN_BLOCK);
restoreAllbutton.removeStyleName(BTN_DEFAULT);
restoreAllbutton.addClickHandler(event -> restoreAllActionCallback.executeCommand(restoreAllActionCommand, null));
actionPanel.add(restoreAllbutton);
}
}
}
Aggregations