Search in sources :

Example 41 with Label

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

the class FunctionPolicyUnitPanel method initWidget.

@Override
public void initWidget() {
    FlowPanel namePanel = getNamePanel(policyUnit);
    if (!used) {
        namePanel.setStyleName(style.unusedPolicyUnitStyle());
    } else {
        final Label weightLabel = createWeightLabel();
        final Button downButton = createDownButton(weightLabel);
        if (factor == 1) {
            downButton.setEnabled(false);
        }
        Button upButton = createUpButton(weightLabel, downButton);
        if (!locked || policyUnit.isEnabled()) {
            namePanel.insert(upButton, 0);
        }
        namePanel.insert(weightLabel, 0);
        if (!locked || policyUnit.isEnabled()) {
            namePanel.insert(downButton, 0);
        }
        namePanel.setStyleName(style.usedFilterPolicyUnitStyle());
    }
    if (!policyUnit.isEnabled()) {
        namePanel.getElement().getStyle().setOpacity(0.5);
    }
    setWidget(namePanel);
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) Label(com.google.gwt.user.client.ui.Label)

Example 42 with Label

use of org.gwtbootstrap3.client.ui.Label 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());
}
Also used : Anchor(org.gwtbootstrap3.client.ui.Anchor) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ListItem(org.gwtbootstrap3.client.ui.ListItem) TagModel(org.ovirt.engine.ui.uicommonweb.models.tags.TagModel) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 43 with Label

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

the class NetworkOutOfSyncPanel method createLabel.

private Label createLabel(String text, boolean boldText) {
    Label output = new Label(text);
    output.getElement().getStyle().setBackgroundColor(BACKGROUND_COLOR);
    if (boldText) {
        output.getElement().getStyle().setFontWeight(FontWeight.BOLD);
    }
    final String textColor = boldText ? WHITE_TEXT_COLOR : TEXT_COLOR;
    output.getElement().getStyle().setColor(textColor);
    return output;
}
Also used : Label(org.gwtbootstrap3.client.ui.Label)

Example 44 with Label

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

the class NetworkOutOfSyncPanel method addOutOfSyncRow.

private void addOutOfSyncRow(List<Label> values, TextAlign textAlign, boolean bottomBorderSolid) {
    Row row = new Row();
    Column mainColumn = new Column(MAIN_COLUMN_SIZE);
    boolean firstTime = true;
    for (Label label : values) {
        Column subColumn;
        if (firstTime) {
            subColumn = new Column(PROPERTY_COLUMN_SIZE);
            firstTime = false;
        } else {
            subColumn = new Column(COLUMN_SIZE);
            subColumn.getElement().getStyle().setTextAlign(textAlign);
        }
        subColumn.add(label);
        mainColumn.add(subColumn);
    }
    row.add(mainColumn);
    if (bottomBorderSolid) {
        Row container = new Row();
        container.setPaddingBottom(4);
        container.add(row);
        // $NON-NLS-1$ //$NON-NLS-2$
        container.getElement().getStyle().setProperty("margin", "0 0 4px");
        // $NON-NLS-1$ //$NON-NLS-2$
        container.getElement().getStyle().setProperty("borderBottomStyle", "solid");
        // $NON-NLS-1$ //$NON-NLS-2$
        container.getElement().getStyle().setProperty("borderWidth", "1px");
        flowPanel.add(container);
    } else {
        flowPanel.add(row);
    }
}
Also used : Column(org.gwtbootstrap3.client.ui.Column) Label(org.gwtbootstrap3.client.ui.Label) Row(org.gwtbootstrap3.client.ui.Row)

Aggregations

Label (org.gwtbootstrap3.client.ui.Label)26 SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)16 MultiSelectionModel (com.google.gwt.view.client.MultiSelectionModel)10 Label (com.google.gwt.user.client.ui.Label)6 Button (org.gwtbootstrap3.client.ui.Button)6 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 Map (java.util.Map)4 ListGroupItem (org.gwtbootstrap3.client.ui.ListGroupItem)4 TextBox (org.gwtbootstrap3.client.ui.TextBox)4 Span (org.gwtbootstrap3.client.ui.html.Span)4 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 TextHeader (com.google.gwt.user.cellview.client.TextHeader)3 FlexTable (com.google.gwt.user.client.ui.FlexTable)3 HTML (com.google.gwt.user.client.ui.HTML)3 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)3 Anchor (org.gwtbootstrap3.client.ui.Anchor)3 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)3