Search in sources :

Example 51 with ClickListener

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

the class EventOverviewPanel method initEvents.

protected void initEvents() {
    HorizontalLayout eventsHeader = new HorizontalLayout();
    eventsHeader.setSpacing(true);
    eventsHeader.setWidth(80, UNITS_PERCENTAGE);
    eventsHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    addDetailComponent(eventsHeader);
    initEventTitle(eventsHeader);
    stepButton = new Button(i18nManager.getMessage(Messages.CRYSTALBALL_BUTTON_NEXTEVENT));
    stepButton.setEnabled(false);
    stepButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            if (!SimulationRunContext.getEventCalendar().getEvents().isEmpty()) {
                simulationDebugger.step();
                refreshEvents();
            }
        }
    });
    eventsHeader.addComponent(stepButton);
    eventsHeader.setComponentAlignment(stepButton, Alignment.MIDDLE_LEFT);
    showProcessInstanceButton = new Button();
    showProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK);
    showProcessInstanceButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            if (replayHistoricInstance != null) {
                ExplorerApp.get().getViewManager().showMyProcessInstancesPage(replayHistoricInstance.getId());
            }
        }
    });
    eventsHeader.addComponent(showProcessInstanceButton);
    eventsHeader.setComponentAlignment(showProcessInstanceButton, Alignment.MIDDLE_LEFT);
    eventLayout = new HorizontalLayout();
    eventLayout.setWidth(100, UNITS_PERCENTAGE);
    addDetailComponent(eventLayout);
    initEventsTable();
}
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 52 with ClickListener

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

the class GroupDetailPanel method initDeleteButton.

protected void initDeleteButton(VerticalLayout actionsLayout) {
    Button deleteButton = new Button(i18nManager.getMessage(Messages.GROUP_DELETE));
    deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
    actionsLayout.addComponent(deleteButton);
    deleteButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.GROUP_CONFIRM_DELETE, group.getId()));
            confirmPopup.addListener(new ConfirmationEventListener() {

                protected void rejected(ConfirmationEvent event) {
                }

                protected void confirmed(ConfirmationEvent event) {
                    // Delete group from database
                    identityService.deleteGroup(group.getId());
                    // Update ui
                    groupPage.refreshSelectNext();
                }
            });
            ExplorerApp.get().getViewManager().showPopupWindow(confirmPopup);
        }
    });
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 53 with ClickListener

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

the class GroupDetailPanel method initSaveButton.

protected void initSaveButton(VerticalLayout actionsLayout) {
    Button saveButton = new Button(i18nManager.getMessage(Messages.USER_SAVE));
    saveButton.addStyleName(Reindeer.BUTTON_SMALL);
    actionsLayout.addComponent(saveButton);
    saveButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            String originalName = group.getName();
            // Update data
            if (nameTextField.getValue() != null) {
                group.setName(nameTextField.getValue().toString());
                group.setType(typeCombobox.getValue().toString());
            }
            identityService.saveGroup(group);
            // Update UI
            editingDetails = false;
            detailLayout.removeAllComponents();
            populateGroupDetails();
            // Refresh task list (only if name was changed)
            if ((originalName != null && !originalName.equals(group.getName())) || (originalName == null && group.getName() != null)) {
                groupPage.notifyGroupChanged(group.getId());
            }
        }
    });
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 54 with ClickListener

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

the class UserDetailPanel method initActions.

protected void initActions() {
    Button createUserButton = new Button(i18nManager.getMessage(Messages.USER_CREATE));
    createUserButton.setIcon(Images.USER_16);
    createUserButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            NewUserPopupWindow newUserPopupWindow = new NewUserPopupWindow();
            ExplorerApp.get().getViewManager().showPopupWindow(newUserPopupWindow);
        }
    });
    userPage.getToolBar().removeAllButtons();
    userPage.getToolBar().addButton(createUserButton);
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 55 with ClickListener

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

the class UserDetailPanel method initDeleteButton.

protected void initDeleteButton(VerticalLayout actionLayout) {
    Button deleteButton = new Button(i18nManager.getMessage(Messages.USER_DELETE));
    deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
    actionLayout.addComponent(deleteButton);
    deleteButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.USER_CONFIRM_DELETE, user.getId()));
            confirmPopup.addListener(new ConfirmationEventListener() {

                protected void rejected(ConfirmationEvent event) {
                }

                protected void confirmed(ConfirmationEvent event) {
                    // Delete user from database
                    identityService.deleteUser(user.getId());
                    // Update ui
                    userPage.refreshSelectNext();
                }
            });
            ExplorerApp.get().getViewManager().showPopupWindow(confirmPopup);
        }
    });
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) ClickListener(com.vaadin.ui.Button.ClickListener)

Aggregations

ClickEvent (com.vaadin.ui.Button.ClickEvent)69 ClickListener (com.vaadin.ui.Button.ClickListener)69 Button (com.vaadin.ui.Button)64 HorizontalLayout (com.vaadin.ui.HorizontalLayout)15 Label (com.vaadin.ui.Label)12 VerticalLayout (com.vaadin.ui.VerticalLayout)8 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)8 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)7 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)7 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)4 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)4 TextField (com.vaadin.ui.TextField)4 Map (java.util.Map)4 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)4 ClaimTaskClickListener (org.activiti.explorer.ui.task.listener.ClaimTaskClickListener)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 ExternalResource (com.vaadin.terminal.ExternalResource)3 Form (com.vaadin.ui.Form)3 URL (java.net.URL)3