Search in sources :

Example 1 with Button

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

the class CopyPopupWithPackageView method button.

Button button(final String text, final Command command, final ButtonType type) {
    Button button = new Button(text, event -> command.execute());
    button.setType(type);
    return button;
}
Also used : Button(org.gwtbootstrap3.client.ui.Button)

Example 2 with Button

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

the class MenuDevCommandsBuilder method buildDevMenuItem.

private MenuItem buildDevMenuItem() {
    final DropDownMenu menu = new DropDownMenu() {

        {
            addStyleName("pull-right");
        }
    };
    for (final MenuDevCommand command : devCommands) {
        menu.add(new AnchorListItem(command.getText()) {

            {
                setIcon(command.getIcon());
                addClickHandler(event -> command.execute());
            }
        });
    }
    final IsWidget group = new ButtonGroup() {

        {
            add(new Button() {

                {
                    setToggleCaret(false);
                    setDataToggle(Toggle.DROPDOWN);
                    setIcon(IconType.COG);
                    setSize(ButtonSize.SMALL);
                    setTitle("Development");
                }
            });
            add(menu);
        }
    };
    return MenuUtils.buildItem(group);
}
Also used : AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) IconType(org.gwtbootstrap3.client.ui.constants.IconType) DropDownMenu(org.gwtbootstrap3.client.ui.DropDownMenu) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) Button(org.gwtbootstrap3.client.ui.Button) Inject(javax.inject.Inject) List(java.util.List) Toggle(org.gwtbootstrap3.client.ui.constants.Toggle) MenuUtils(org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils) MenuItem(org.uberfire.workbench.model.menu.MenuItem) ApplicationScoped(javax.enterprise.context.ApplicationScoped) IsWidget(com.google.gwt.user.client.ui.IsWidget) LinkedList(java.util.LinkedList) ButtonSize(org.gwtbootstrap3.client.ui.constants.ButtonSize) ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) IsWidget(com.google.gwt.user.client.ui.IsWidget) AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) Button(org.gwtbootstrap3.client.ui.Button) DropDownMenu(org.gwtbootstrap3.client.ui.DropDownMenu)

Example 3 with Button

use of org.gwtbootstrap3.client.ui.Button in project drools-wb by kiegroup.

the class ScenarioWidgetComponentCreator method getRuleSelectionWidget.

public Widget getRuleSelectionWidget(final RuleSelectionEvent selected) {
    final HorizontalPanel horizontalPanel = GWT.create(HorizontalPanel.class);
    horizontalPanel.add(ruleNameSelector);
    final Button ok = createOkButton(selected);
    horizontalPanel.add(ok);
    return horizontalPanel;
}
Also used : Button(org.gwtbootstrap3.client.ui.Button) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel)

Example 4 with Button

use of org.gwtbootstrap3.client.ui.Button in project drools-wb by kiegroup.

the class ActivateRuleFlowWidget method render.

private void render(final FixtureList retList, final FlexTable outer, final Scenario sc) {
    outer.clear();
    outer.getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader");
    outer.getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);
    outer.setStyleName("modeller-fact-pattern-Widget");
    outer.setWidget(0, 0, new SmallLabel(TestScenarioConstants.INSTANCE.ActivateRuleFlowGroup()));
    outer.getFlexCellFormatter().setColSpan(0, 0, 2);
    int row = 1;
    for (Fixture fixture : retList) {
        final ActivateRuleFlowGroup acticateRuleFlowGroup = (ActivateRuleFlowGroup) fixture;
        outer.setWidget(row, 0, new SmallLabel(acticateRuleFlowGroup.getName()));
        Button deleteButton = new Button();
        deleteButton.setIcon(IconType.TRASH);
        deleteButton.setTitle(TestScenarioConstants.INSTANCE.RemoveThisRuleFlowActivation());
        deleteButton.addClickHandler(clickEvent -> {
            retList.remove(acticateRuleFlowGroup);
            sc.getFixtures().remove(acticateRuleFlowGroup);
            render(retList, outer, sc);
            parent.renderEditor();
        });
        outer.setWidget(row, 1, deleteButton);
        row++;
    }
    ScenarioUtils.addBottomAndRightPaddingToTableCells(outer);
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) Button(org.gwtbootstrap3.client.ui.Button) Fixture(org.drools.workbench.models.testscenarios.shared.Fixture) ActivateRuleFlowGroup(org.drools.workbench.models.testscenarios.shared.ActivateRuleFlowGroup)

Example 5 with Button

use of org.gwtbootstrap3.client.ui.Button in project drools-wb by kiegroup.

the class MethodParameterCallValueEditor method showTypeChoice.

protected void showTypeChoice(final Widget w) {
    final FormStylePopup form = new FormStylePopup(TestScenarioAltedImages.INSTANCE.Wizard(), TestScenarioConstants.INSTANCE.FieldValue());
    Button lit = new Button(TestScenarioConstants.INSTANCE.LiteralValue());
    lit.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            methodParameter.nature = FieldData.TYPE_LITERAL;
            methodParameter.value = " ";
            refresh();
            form.hide();
        }
    });
    form.addAttribute(TestScenarioConstants.INSTANCE.LiteralValue() + ":", widgets(lit, new InfoPopup(TestScenarioConstants.INSTANCE.Literal(), TestScenarioConstants.INSTANCE.LiteralValTip())));
    form.addRow(new HTML("<hr/>"));
    form.addRow(new SmallLabel(TestScenarioConstants.INSTANCE.AdvancedSection()));
    /*
         * If there is a bound variable that is the same type of the current
         * variable type, then show a button
         */
    List<String> vars = model.getFactNamesInScope(ex, true);
    for (String v : vars) {
        boolean createButton = false;
        Button variable = new Button(TestScenarioConstants.INSTANCE.BoundVariable());
        FactData factData = (FactData) model.getFactTypes().get(v);
        if (factData.getType().equals(this.parameterType)) {
            createButton = true;
        }
        if (createButton == true) {
            form.addAttribute(TestScenarioConstants.INSTANCE.BoundVariable() + ":", variable);
            variable.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {
                    methodParameter.nature = FieldData.TYPE_VARIABLE;
                    methodParameter.value = "=";
                    refresh();
                    form.hide();
                }
            });
            break;
        }
    }
    form.show();
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(org.gwtbootstrap3.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FactData(org.drools.workbench.models.testscenarios.shared.FactData) FormStylePopup(org.uberfire.ext.widgets.common.client.common.popups.FormStylePopup) HTML(com.google.gwt.user.client.ui.HTML) InfoPopup(org.uberfire.ext.widgets.common.client.common.InfoPopup)

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