Search in sources :

Example 1 with Anchor

use of org.gwtbootstrap3.client.ui.Anchor in project kie-wb-common by kiegroup.

the class DocumentFieldRendererViewImpl method setValue.

@Override
public void setValue(DocumentData value, boolean fireEvents) {
    if (this.value == value) {
        return;
    }
    if (value == null || value.getStatus().equals(DocumentStatus.NEW) || !value.equals(this.value)) {
        this.value = value;
        linkContainer.clear();
        if (this.value != null) {
            Anchor link = new Anchor();
            link.setText(value.getFileName() + " (" + calculateSize() + ")");
            if (value.getLink() == null) {
                link.setEnabled(false);
                link.setHref("#");
                link.addClickHandler(event -> {
                    return;
                });
            } else {
                link.setHref(value.getLink());
                link.setTarget("_blank");
            }
            linkContainer.add(link);
        }
        if (fireEvents) {
            ValueChangeEvent.fire(this, this.value);
        }
    }
}
Also used : Anchor(org.gwtbootstrap3.client.ui.Anchor)

Example 2 with Anchor

use of org.gwtbootstrap3.client.ui.Anchor in project ovirt-engine by oVirt.

the class MenuView method getLabelFromHref.

@Override
public String getLabelFromHref(String href) {
    ListGroupItem group = hrefToGroupLabelMap.get(href);
    String result = "";
    if (group != null) {
        result = ((Anchor) group.getWidget(1)).getElement().getInnerText().trim();
    }
    return result;
}
Also used : ListGroupItem(org.gwtbootstrap3.client.ui.ListGroupItem)

Example 3 with Anchor

use of org.gwtbootstrap3.client.ui.Anchor in project ovirt-engine by oVirt.

the class MenuView method addPrimaryMenuItemPlace.

private int addPrimaryMenuItemPlace(int index, String label, String href, String iconCssName) {
    ListGroupItem newMenuItem = new ListGroupItem();
    Anchor menuAnchor = new Anchor(hashifyString(href));
    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);
    // Insert the new menu item into the href map.
    hrefToGroupLabelMap.put(href, newMenuItem);
    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 4 with Anchor

use of org.gwtbootstrap3.client.ui.Anchor in project ovirt-engine by oVirt.

the class EventsListPopover method createTitleHeader.

private IsWidget createTitleHeader(String title) {
    FlowPanel header = new FlowPanel();
    header.addStyleName(PatternflyConstants.PF_DRAWER_TITLE);
    titleAnchor = new Anchor();
    titleAnchor.addStyleName(PatternflyConstants.PF_DRAWER_TOGGLE_EXPAND);
    titleAnchor.addClickHandler(e -> toggle());
    header.add(titleAnchor);
    Anchor closeAnchor = new Anchor();
    closeAnchor.addStyleName(PatternflyConstants.PF_DRAWER_CLOSE);
    closeAnchor.addStyleName(PatternflyConstants.PFICON);
    closeAnchor.addStyleName(PatternflyConstants.PFICON_CLOSE);
    closeAnchor.addClickHandler(e -> hide());
    header.add(closeAnchor);
    Heading titleHeading = new Heading(HeadingSize.H3, title);
    titleHeading.addStyleName(PatternflyConstants.CENTER_TEXT);
    header.add(titleHeading);
    return header;
}
Also used : Anchor(org.gwtbootstrap3.client.ui.Anchor) Heading(org.gwtbootstrap3.client.ui.Heading) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 5 with Anchor

use of org.gwtbootstrap3.client.ui.Anchor in project kie-wb-common by kiegroup.

the class BreadcrumbNavigator method createUpFolder.

private void createUpFolder(final FolderItem item) {
    int col = 0;
    navigator.setText(0, col, "");
    navigator.setText(0, ++col, "");
    final Anchor anchor = new Anchor();
    anchor.setIcon(IconType.LEVEL_UP);
    anchor.setIconSize(IconSize.LARGE);
    anchor.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onActiveFolderItemSelected(item);
        }
    });
    navigator.setWidget(0, ++col, anchor);
    navigator.setText(0, ++col, "");
    if (options.showItemAge()) {
        navigator.setText(0, ++col, "");
    }
    if (options.showItemMessage()) {
        navigator.setText(0, ++col, "");
    }
}
Also used : Anchor(org.gwtbootstrap3.client.ui.Anchor) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent)

Aggregations

Anchor (org.gwtbootstrap3.client.ui.Anchor)14 Span (org.gwtbootstrap3.client.ui.html.Span)5 ListGroupItem (org.gwtbootstrap3.client.ui.ListGroupItem)4 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)3 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 Button (org.gwtbootstrap3.client.ui.Button)2 Heading (org.gwtbootstrap3.client.ui.Heading)2 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 Widget (com.google.gwt.user.client.ui.Widget)1 Icon (org.gwtbootstrap3.client.ui.Icon)1 ListGroup (org.gwtbootstrap3.client.ui.ListGroup)1 ListItem (org.gwtbootstrap3.client.ui.ListItem)1 PanelBody (org.gwtbootstrap3.client.ui.PanelBody)1 PanelCollapse (org.gwtbootstrap3.client.ui.PanelCollapse)1 PanelHeader (org.gwtbootstrap3.client.ui.PanelHeader)1 Tooltip (org.gwtbootstrap3.client.ui.Tooltip)1 Div (org.gwtbootstrap3.client.ui.html.Div)1 Paragraph (org.gwtbootstrap3.client.ui.html.Paragraph)1 AuditLog (org.ovirt.engine.core.common.businessentities.AuditLog)1