Search in sources :

Example 46 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class DeleteDeploymentPopupWindow method addButtons.

protected void addButtons() {
    // Cancel
    Button cancelButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
    cancelButton.addStyleName(Reindeer.BUTTON_SMALL);
    cancelButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    // Delete
    Button deleteButton = new Button(i18nManager.getMessage(Messages.DEPLOYMENT_DELETE_POPUP_DELETE_BUTTON));
    deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
    deleteButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            // Delete deployment, close popup window and refresh deployment list
            repositoryService.deleteDeployment(deployment.getId(), true);
            close();
            deploymentPage.refreshSelectNext();
        }
    });
    // Alignment
    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    buttonLayout.addComponent(cancelButton);
    buttonLayout.addComponent(deleteButton);
    addComponent(buttonLayout);
    windowLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 47 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class UserProfileLink method initUserLink.

protected void initUserLink(final String userId) {
    User user = ProcessEngines.getDefaultProcessEngine().getIdentityService().createUserQuery().userId(userId).singleResult();
    Button userButton = new Button(user.getFirstName() + " " + user.getLastName());
    ClickListener buttonClickListener = new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            viewManager.showProfilePopup(userId);
        }
    };
    userButton.addStyleName(Reindeer.BUTTON_LINK);
    userButton.addListener(buttonClickListener);
    addComponent(userButton);
    setComponentAlignment(userButton, Alignment.MIDDLE_LEFT);
}
Also used : User(org.activiti.engine.identity.User) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 48 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class FormPropertiesForm method initButtons.

protected void initButtons() {
    submitFormButton = new Button();
    cancelFormButton = new Button();
    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    buttons.setWidth(100, UNITS_PERCENTAGE);
    buttons.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    buttons.addComponent(submitFormButton);
    buttons.setComponentAlignment(submitFormButton, Alignment.BOTTOM_RIGHT);
    buttons.addComponent(cancelFormButton);
    buttons.setComponentAlignment(cancelFormButton, Alignment.BOTTOM_RIGHT);
    Label buttonSpacer = new Label();
    buttons.addComponent(buttonSpacer);
    buttons.setExpandRatio(buttonSpacer, 1.0f);
    addComponent(buttons);
}
Also used : Button(com.vaadin.ui.Button) Label(com.vaadin.ui.Label) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 49 with Button

use of com.vaadin.ui.Button in project opennms by OpenNMS.

the class GrafanaDashletQuickRangePicker method createLayout.

private VerticalLayout createLayout(Map<String, QuickRange> quickRanges) {
    VerticalLayout verticalLayout = new VerticalLayout();
    for (final Map.Entry<String, QuickRange> entry : quickRanges.entrySet()) {
        Button button = new Button(entry.getKey());
        button.addStyleName(BaseTheme.BUTTON_LINK);
        button.addClickListener(e -> {
            for (QuickRangeListener quickRangeListener : quickRangeListeners) {
                quickRangeListener.quickRangeSelected(entry.getValue());
            }
            selectButton(button);
        });
        verticalLayout.addComponent(button);
        buttonMap.put(entry.getValue(), button);
    }
    return verticalLayout;
}
Also used : Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.ui.VerticalLayout) TreeMap(java.util.TreeMap) Map(java.util.Map) HashMap(java.util.HashMap)

Example 50 with Button

use of com.vaadin.ui.Button in project opennms by OpenNMS.

the class UIHelper method createButton.

public static Button createButton(final String buttonCaption, final String buttonDescription, final Resource icon, final ClickListener clickListener) {
    Button button = new Button();
    button.setCaption(buttonCaption);
    button.setIcon(icon);
    if (buttonDescription != null)
        button.setDescription(buttonDescription);
    if (clickListener != null)
        button.addClickListener(clickListener);
    return button;
}
Also used : Button(com.vaadin.ui.Button)

Aggregations

Button (com.vaadin.ui.Button)114 ClickEvent (com.vaadin.ui.Button.ClickEvent)72 ClickListener (com.vaadin.ui.Button.ClickListener)64 HorizontalLayout (com.vaadin.ui.HorizontalLayout)33 VerticalLayout (com.vaadin.ui.VerticalLayout)25 Label (com.vaadin.ui.Label)21 Chart (com.vaadin.addon.charts.Chart)8 ListSeries (com.vaadin.addon.charts.model.ListSeries)8 TextField (com.vaadin.ui.TextField)8 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)7 Configuration (com.vaadin.addon.charts.model.Configuration)6 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)6 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)6 ClaimTaskClickListener (org.activiti.explorer.ui.task.listener.ClaimTaskClickListener)5 ComboBox (com.vaadin.ui.ComboBox)4 FormLayout (com.vaadin.ui.FormLayout)4 Window (com.vaadin.ui.Window)4 SimpleDateFormat (java.text.SimpleDateFormat)4 SubmitEventListener (org.activiti.explorer.ui.event.SubmitEventListener)4 VertexRef (org.opennms.features.topology.api.topo.VertexRef)4