Search in sources :

Example 31 with Button

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

the class TagsView method createRemoveButton.

private Button createRemoveButton(final TagModel model) {
    Button result = new Button(constants.removeTag());
    result.addClickHandler(e -> {
        tagModelProvider.getSelectionModel().setSelected(model, true);
        Scheduler.get().scheduleDeferred(() -> {
            tagModelProvider.getModel().executeCommand(tagModelProvider.getModel().getRemoveCommand());
        });
    });
    return result;
}
Also used : Button(org.gwtbootstrap3.client.ui.Button)

Example 32 with Button

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

the class RadioButtonPanel method createRadioButton.

private RadioButton createRadioButton(String title, boolean active, boolean enabled, ValueChangeHandler<Boolean> handler) {
    RadioButton button = new RadioButton(title);
    button.setHTML(title);
    button.setName(name);
    button.setEnabled(enabled);
    button.setActive(active);
    button.addValueChangeHandler(handler);
    return button;
}
Also used : RadioButton(org.gwtbootstrap3.client.ui.RadioButton)

Example 33 with Button

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

the class AddRemoveRowWidget method createMinusButton.

private Button createMinusButton(final Pair<T, V> item) {
    final Button button = createButton(IconType.MINUS, event -> {
        final T value = item.getFirst();
        final V widget = item.getSecond();
        if (vetoRemoveWidget(item, value, widget)) {
            return;
        }
        doRemoveItem(item, value, widget);
    });
    return button;
}
Also used : Button(org.gwtbootstrap3.client.ui.Button)

Example 34 with Button

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

the class PatternflyListViewItem method createItemContainerPanel.

protected Container createItemContainerPanel(Row content, boolean hidden) {
    Container panel = new Container();
    panel.addStyleName(LIST_GROUP_ITEM_CONTAINER);
    if (hidden) {
        panel.addStyleName(ExpandableListViewItem.HIDDEN);
        panel.setFluid(true);
        Button closeButton = new Button();
        closeButton.addStyleName(Styles.CLOSE);
        getClickHandlerRegistrations().add(closeButton.addClickHandler(this));
        Span icon = new Span();
        icon.addStyleName(PatternflyConstants.PFICON);
        icon.addStyleName(PatternflyConstants.PFICON_CLOSE);
        closeButton.add(icon);
        panel.add(closeButton);
    }
    panel.add(content);
    return panel;
}
Also used : Container(org.gwtbootstrap3.client.ui.Container) Button(org.gwtbootstrap3.client.ui.Button) Span(org.gwtbootstrap3.client.ui.html.Span)

Example 35 with Button

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

the class AbstractActionTable method updateContextMenu.

/**
 * Rebuilds context menu items to match the action button list.
 * @param dropDownMenu The menu bar to populate.
 * @param actions A list of {@code ActionButtonDefinition}s used to populate the {@code MenuBar}.
 * @param popupPanel The pop-up panel containing the {@code MenuBar}.
 * @param removeOldItems A flag to indicate if we should remove old items.
 * @return A {@code MenuBar} containing all the action buttons as menu items.
 */
private DropDownMenu updateContextMenu(DropDownMenu dropDownMenu, List<ActionButtonDefinition<T>> actions, boolean removeOldItems) {
    if (removeOldItems) {
        ElementTooltipUtils.destroyMenuItemTooltips(dropDownMenu);
        dropDownMenu.clear();
        // Close any other open popups as well.
        closeOtherPopups();
    }
    for (final ActionButtonDefinition<T> buttonDef : actions) {
        if (buttonDef instanceof UiMenuBarButtonDefinition) {
            UiMenuBarButtonDefinition<T> menuBarDef = (UiMenuBarButtonDefinition<T>) buttonDef;
            DropDownHeader subMenuHeader = new DropDownHeader(buttonDef.getText());
            dropDownMenu.add(new Divider());
            subMenuHeader.setVisible(buttonDef.isVisible(getSelectedItems()));
            dropDownMenu.add(subMenuHeader);
            updateContextMenu(dropDownMenu, menuBarDef.getSubActions(), false);
        } else {
            AnchorListItem item = new AnchorListItem(buttonDef.getText());
            item.addClickHandler(e -> buttonDef.onClick(getSelectedItems()));
            updateMenuItem(item, buttonDef);
            dropDownMenu.add(item);
        }
    }
    return dropDownMenu;
}
Also used : AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) DropDownHeader(org.gwtbootstrap3.client.ui.DropDownHeader) Divider(org.gwtbootstrap3.client.ui.Divider) UiMenuBarButtonDefinition(org.ovirt.engine.ui.common.widget.action.UiMenuBarButtonDefinition)

Aggregations

Button (org.gwtbootstrap3.client.ui.Button)71 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)33 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)33 FormStylePopup (org.uberfire.ext.widgets.common.client.common.popups.FormStylePopup)14 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)12 HTML (com.google.gwt.user.client.ui.HTML)10 ListBox (org.gwtbootstrap3.client.ui.ListBox)10 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)9 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)9 InfoPopup (org.uberfire.ext.widgets.common.client.common.InfoPopup)9 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)7 TextBox (org.gwtbootstrap3.client.ui.TextBox)6 MenuItem (org.uberfire.workbench.model.menu.MenuItem)6 IsWidget (com.google.gwt.user.client.ui.IsWidget)5 Widget (com.google.gwt.user.client.ui.Widget)5 AnchorListItem (org.gwtbootstrap3.client.ui.AnchorListItem)5 ButtonGroup (org.gwtbootstrap3.client.ui.ButtonGroup)5 FlexTable (com.google.gwt.user.client.ui.FlexTable)4 ApplicationScoped (javax.enterprise.context.ApplicationScoped)4 Inject (javax.inject.Inject)4