use of org.gwtbootstrap3.client.ui.ListGroupItem in project ovirt-engine by oVirt.
the class MenuView method setMenuActive.
@Override
public void setMenuActive(String href) {
ListGroupItem group = hrefToGroupLabelMap.get(href);
if (group != null) {
for (int i = 0; i < menuListGroup.getWidgetCount(); i++) {
menuListGroup.getWidget(i).removeStyleName(Styles.ACTIVE);
}
group.addStyleName(Styles.ACTIVE);
clearActiveFromAnchors();
activateAnchorFromHref(href);
}
}
use of org.gwtbootstrap3.client.ui.ListGroupItem in project ovirt-engine by oVirt.
the class MenuView method createSecondaryMenuItem.
private IsWidget createSecondaryMenuItem(String label, String href) {
ListGroup listGroup = new ListGroup();
ListGroupItem item = new ListGroupItem();
listGroup.add(item);
Anchor secondaryMenuItemAnchor = new Anchor(hashifyString(href));
Span labelSpan = new Span();
labelSpan.getElement().setInnerSafeHtml(SafeHtmlUtils.fromString(label));
labelSpan.addStyleName(PatternflyStyles.LIST_GROUP_ITEM_VALUE);
secondaryMenuItemAnchor.add(labelSpan);
item.add(secondaryMenuItemAnchor);
return listGroup;
}
use of org.gwtbootstrap3.client.ui.ListGroupItem in project ovirt-engine by oVirt.
the class MenuView method addPrimaryMenuItemContainer.
public int addPrimaryMenuItemContainer(int index, String label, String iconCssName) {
ListGroupItem newMenuItem = new ListGroupItem();
Anchor menuAnchor = new Anchor(JAVASCRIPT);
if (index < 0) {
index = 0;
}
Span iconSpan = new Span();
if (iconCssName != null) {
iconSpan.addStyleName(determineCssIconBase(iconCssName));
iconSpan.addStyleName(iconCssName);
newMenuItem.addStyleName(Styles.ACTIVE);
}
menuAnchor.add(iconSpan);
Span labelSpan = new Span();
labelSpan.setText(label);
labelSpan.addStyleName(PatternflyStyles.LIST_GROUP_ITEM_VALUE);
menuAnchor.add(labelSpan);
newMenuItem.add(menuAnchor);
createSecondaryMenuHeader(newMenuItem);
newMenuItem.addStyleName(PatternflyStyles.SECONDARY_NAV_ITEM);
if (index > menuListGroup.getWidgetCount()) {
menuListGroup.add(newMenuItem);
} else {
menuListGroup.insert(newMenuItem, index);
}
return menuListGroup.getWidgetIndex(newMenuItem);
}
use of org.gwtbootstrap3.client.ui.ListGroupItem in project ovirt-engine by oVirt.
the class TagsView method addChildTags.
private void addChildTags(List<TagModel> tagModels, HasWidgets group, final int indent) {
int newIndent = indent + 1;
for (TagModel model : tagModels) {
ListGroupItem tagItem = new ListGroupItem();
tagItem.getElement().getStyle().setPaddingLeft(indent * INDENT_WIDTH, Unit.PX);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(createActivateButton(model));
buttonGroup.add(createAddButton(model));
buttonGroup.add(createEditButton(model));
buttonGroup.add(createRemoveButton(model));
buttonGroup.addStyleName(Styles.PULL_RIGHT);
tagItem.add(buttonGroup);
tagItem.setText(model.getName().getEntity());
group.add(tagItem);
List<TagModel> children = model.getChildren();
if (children != null && !children.isEmpty()) {
addChildTags(model.getChildren(), group, newIndent);
}
}
}
Aggregations