Search in sources :

Example 6 with ListGroupItem

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);
    }
}
Also used : ListGroupItem(org.gwtbootstrap3.client.ui.ListGroupItem)

Example 7 with ListGroupItem

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;
}
Also used : Anchor(org.gwtbootstrap3.client.ui.Anchor) ListGroup(org.gwtbootstrap3.client.ui.ListGroup) ListGroupItem(org.gwtbootstrap3.client.ui.ListGroupItem) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 8 with ListGroupItem

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);
}
Also used : Anchor(org.gwtbootstrap3.client.ui.Anchor) ListGroupItem(org.gwtbootstrap3.client.ui.ListGroupItem) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 9 with ListGroupItem

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);
        }
    }
}
Also used : ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) ListGroupItem(org.gwtbootstrap3.client.ui.ListGroupItem) TagModel(org.ovirt.engine.ui.uicommonweb.models.tags.TagModel)

Aggregations

ListGroupItem (org.gwtbootstrap3.client.ui.ListGroupItem)8 Anchor (org.gwtbootstrap3.client.ui.Anchor)4 Span (org.gwtbootstrap3.client.ui.html.Span)4 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)2 IsWidget (com.google.gwt.user.client.ui.IsWidget)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 ButtonGroup (org.gwtbootstrap3.client.ui.ButtonGroup)1 ListGroup (org.gwtbootstrap3.client.ui.ListGroup)1 TagModel (org.ovirt.engine.ui.uicommonweb.models.tags.TagModel)1