Search in sources :

Example 1 with ButtonGroup

use of org.gwtbootstrap3.client.ui.ButtonGroup 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 2 with ButtonGroup

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

the class BPMNDiagramEditorMenuItemsBuilder method newFormsGenerationMenuItem.

public MenuItem newFormsGenerationMenuItem(final Command generateProcessForm, final Command generateAllForms, final Command generateSelectedForms) {
    final DropDownMenu menu = new DropDownMenu() {

        {
            setPull(Pull.RIGHT);
        }
    };
    menu.add(new AnchorListItem(translationService.getValue(BPMNClientConstants.EditorGenerateProcessForm)) {

        {
            setIcon(IconType.LIST_ALT);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(BPMNClientConstants.EditorGenerateProcessForm));
            addClickHandler(event -> generateProcessForm.execute());
        }
    });
    menu.add(new AnchorListItem(translationService.getValue(BPMNClientConstants.EditorGenerateAllForms)) {

        {
            setIcon(IconType.LIST_ALT);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(BPMNClientConstants.EditorGenerateAllForms));
            addClickHandler(event -> generateAllForms.execute());
        }
    });
    menu.add(new AnchorListItem(translationService.getValue(BPMNClientConstants.EditorGenerateSelectionForms)) {

        {
            setIcon(IconType.LIST_ALT);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(BPMNClientConstants.EditorGenerateSelectionForms));
            addClickHandler(event -> generateSelectedForms.execute());
        }
    });
    final IsWidget group = new ButtonGroup() {

        {
            add(new Button() {

                {
                    setToggleCaret(true);
                    setDataToggle(Toggle.DROPDOWN);
                    setIcon(IconType.LIST_ALT);
                    setSize(ButtonSize.SMALL);
                    setTitle(translationService.getValue(BPMNClientConstants.EditorFormGenerationTitle));
                }
            });
            add(menu);
        }
    };
    return MenuUtils.buildItem(group);
}
Also used : AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) IconType(org.gwtbootstrap3.client.ui.constants.IconType) Pull(org.gwtbootstrap3.client.ui.constants.Pull) BPMNClientConstants(org.kie.workbench.common.stunner.bpmn.project.client.resources.BPMNClientConstants) DropDownMenu(org.gwtbootstrap3.client.ui.DropDownMenu) IconPosition(org.gwtbootstrap3.client.ui.constants.IconPosition) Button(org.gwtbootstrap3.client.ui.Button) Inject(javax.inject.Inject) ClientTranslationService(org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService) 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) ButtonSize(org.gwtbootstrap3.client.ui.constants.ButtonSize) Command(org.uberfire.mvp.Command) 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 ButtonGroup

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

the class ExplorerMenuViewImpl method asMenu.

@Override
public Menus asMenu() {
    return MenuFactory.newTopLevelCustomMenu(new MenuFactory.CustomMenuBuilder() {

        @Override
        public void push(MenuFactory.CustomMenuBuilder element) {
        }

        @Override
        public MenuItem build() {
            return new BaseMenuCustom() {

                @Override
                public Widget build() {
                    return new ButtonGroup() {

                        {
                            add(new Button() {

                                {
                                    setToggleCaret(false);
                                    setDataToggle(Toggle.DROPDOWN);
                                    setIcon(IconType.COG);
                                    setSize(ButtonSize.SMALL);
                                    setTitle(ProjectExplorerConstants.INSTANCE.customizeView());
                                }
                            });
                            add(new DropDownMenu() {

                                {
                                    addStyleName("pull-right");
                                    add(businessView);
                                    add(techView);
                                    add(new Divider());
                                    add(breadcrumbExplorer);
                                    add(treeExplorer);
                                    add(new Divider());
                                    add(showTagFilter);
                                    add(new Divider());
                                    add(archiveProject);
                                }
                            });
                        }
                    };
                }
            };
        }
    }).endMenu().newTopLevelCustomMenu(new MenuFactory.CustomMenuBuilder() {

        @Override
        public void push(MenuFactory.CustomMenuBuilder element) {
        }

        @Override
        public MenuItem build() {
            return new BaseMenuCustom() {

                @Override
                public Widget build() {
                    return new Button() {

                        {
                            setIcon(IconType.REFRESH);
                            setSize(ButtonSize.SMALL);
                            setTitle(ProjectExplorerConstants.INSTANCE.refresh());
                            addClickHandler(new ClickHandler() {

                                @Override
                                public void onClick(ClickEvent event) {
                                    presenter.onRefresh();
                                }
                            });
                        }
                    };
                }
            };
        }
    }).endMenu().build();
}
Also used : MenuFactory(org.uberfire.workbench.model.menu.MenuFactory) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) Button(org.gwtbootstrap3.client.ui.Button) BaseMenuCustom(org.uberfire.workbench.model.menu.impl.BaseMenuCustom) DropDownMenu(org.gwtbootstrap3.client.ui.DropDownMenu) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Widget(com.google.gwt.user.client.ui.Widget) MenuItem(org.uberfire.workbench.model.menu.MenuItem) Divider(org.gwtbootstrap3.client.ui.Divider)

Example 4 with ButtonGroup

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

the class ProjectDiagramEditorMenuItemsBuilder method newExportsItem.

public MenuItem newExportsItem(final Command exportPNGCommand, final Command exportJPGCommand, final Command exportPDFCommand, final Command exportBPMNCommand) {
    final DropDownMenu menu = new DropDownMenu() {

        {
            setPull(Pull.RIGHT);
        }
    };
    menu.add(new AnchorListItem(translationService.getValue(CoreTranslationMessages.EXPORT_PNG)) {

        {
            setIcon(IconType.FILE_IMAGE_O);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(CoreTranslationMessages.EXPORT_PNG));
            addClickHandler(event -> exportPNGCommand.execute());
        }
    });
    menu.add(new AnchorListItem(translationService.getValue(CoreTranslationMessages.EXPORT_JPG)) {

        {
            setIcon(IconType.FILE_IMAGE_O);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(CoreTranslationMessages.EXPORT_JPG));
            addClickHandler(event -> exportJPGCommand.execute());
        }
    });
    menu.add(new AnchorListItem(translationService.getValue(CoreTranslationMessages.EXPORT_PDF)) {

        {
            setIcon(IconType.FILE_PDF_O);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(CoreTranslationMessages.EXPORT_PDF));
            addClickHandler(event -> exportPDFCommand.execute());
        }
    });
    menu.add(new AnchorListItem(translationService.getValue(CoreTranslationMessages.EXPORT_BPMN)) {

        {
            setIcon(IconType.FILE_TEXT_O);
            setIconPosition(IconPosition.LEFT);
            setTitle(translationService.getValue(CoreTranslationMessages.EXPORT_BPMN));
            addClickHandler(event -> exportBPMNCommand.execute());
        }
    });
    final IsWidget group = new ButtonGroup() {

        {
            add(new Button() {

                {
                    setToggleCaret(true);
                    setDataToggle(Toggle.DROPDOWN);
                    setIcon(IconType.DOWNLOAD);
                    setSize(ButtonSize.SMALL);
                    setTitle(translationService.getValue(StunnerProjectClientConstants.DOWNLOAD_DIAGRAM));
                }
            });
            add(menu);
        }
    };
    return buildItem(group);
}
Also used : AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) IconType(org.gwtbootstrap3.client.ui.constants.IconType) Pull(org.gwtbootstrap3.client.ui.constants.Pull) DropDownMenu(org.gwtbootstrap3.client.ui.DropDownMenu) IconPosition(org.gwtbootstrap3.client.ui.constants.IconPosition) StunnerProjectClientConstants(org.kie.workbench.common.stunner.project.client.resources.i18n.StunnerProjectClientConstants) Button(org.gwtbootstrap3.client.ui.Button) Inject(javax.inject.Inject) ClientTranslationService(org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService) Toggle(org.gwtbootstrap3.client.ui.constants.Toggle) MenuUtils(org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils) CoreTranslationMessages(org.kie.workbench.common.stunner.core.i18n.CoreTranslationMessages) MenuItem(org.uberfire.workbench.model.menu.MenuItem) MenuDevCommandsBuilder(org.kie.workbench.common.stunner.client.widgets.menu.dev.MenuDevCommandsBuilder) ApplicationScoped(javax.enterprise.context.ApplicationScoped) IsWidget(com.google.gwt.user.client.ui.IsWidget) PopupUtil(org.kie.workbench.common.stunner.client.widgets.popups.PopupUtil) ButtonSize(org.gwtbootstrap3.client.ui.constants.ButtonSize) Command(org.uberfire.mvp.Command) 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 5 with ButtonGroup

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

the class ShapeSetsMenuItemsBuilder method build.

public MenuItem build(final String title, final String prefix, final Callback callback) {
    final DropDownMenu menu = new DropDownMenu() {

        {
            addStyleName("pull-right");
        }
    };
    final Collection<ShapeSet<?>> shapeSets = shapeManager.getShapeSets();
    if (null != shapeSets) {
        shapeSets.stream().forEach(shapeSet -> {
            menu.add(new AnchorListItem(prefix + " " + shapeSet.getDescription()) {

                {
                    setTitle(prefix + " " + shapeSet.getDescription());
                    setIcon(IconType.PLUS);
                    addClickHandler(event -> callback.onClick(shapeSet));
                }
            });
        });
    }
    final IsWidget group = new ButtonGroup() {

        {
            add(new Button() {

                {
                    setToggleCaret(false);
                    setDataToggle(Toggle.DROPDOWN);
                    setSize(ButtonSize.SMALL);
                    setText(title);
                    setTitle(title);
                }
            });
            add(menu);
        }
    };
    return MenuUtils.buildItem(group);
}
Also used : AnchorListItem(org.gwtbootstrap3.client.ui.AnchorListItem) IconType(org.gwtbootstrap3.client.ui.constants.IconType) Collection(java.util.Collection) DropDownMenu(org.gwtbootstrap3.client.ui.DropDownMenu) Button(org.gwtbootstrap3.client.ui.Button) Inject(javax.inject.Inject) Toggle(org.gwtbootstrap3.client.ui.constants.Toggle) MenuUtils(org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils) MenuItem(org.uberfire.workbench.model.menu.MenuItem) ShapeManager(org.kie.workbench.common.stunner.core.client.api.ShapeManager) ApplicationScoped(javax.enterprise.context.ApplicationScoped) IsWidget(com.google.gwt.user.client.ui.IsWidget) ButtonSize(org.gwtbootstrap3.client.ui.constants.ButtonSize) ButtonGroup(org.gwtbootstrap3.client.ui.ButtonGroup) ShapeSet(org.kie.workbench.common.stunner.core.client.ShapeSet) 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) ShapeSet(org.kie.workbench.common.stunner.core.client.ShapeSet)

Aggregations

ButtonGroup (org.gwtbootstrap3.client.ui.ButtonGroup)9 Button (org.gwtbootstrap3.client.ui.Button)5 DropDownMenu (org.gwtbootstrap3.client.ui.DropDownMenu)5 MenuItem (org.uberfire.workbench.model.menu.MenuItem)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)4 ApplicationScoped (javax.enterprise.context.ApplicationScoped)4 Inject (javax.inject.Inject)4 AnchorListItem (org.gwtbootstrap3.client.ui.AnchorListItem)4 ButtonSize (org.gwtbootstrap3.client.ui.constants.ButtonSize)4 IconType (org.gwtbootstrap3.client.ui.constants.IconType)4 Toggle (org.gwtbootstrap3.client.ui.constants.Toggle)4 MenuUtils (org.kie.workbench.common.stunner.client.widgets.menu.MenuUtils)4 RadioButton (org.gwtbootstrap3.client.ui.RadioButton)3 IconPosition (org.gwtbootstrap3.client.ui.constants.IconPosition)2 Pull (org.gwtbootstrap3.client.ui.constants.Pull)2 ClientTranslationService (org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService)2 Command (org.uberfire.mvp.Command)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Widget (com.google.gwt.user.client.ui.Widget)1