Search in sources :

Example 46 with ClickListener

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

the class NewCasePopupWindow method initCreateTaskButton.

protected void initCreateTaskButton() {
    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setWidth(100, UNITS_PERCENTAGE);
    form.getFooter().setWidth(100, UNITS_PERCENTAGE);
    form.getFooter().addComponent(buttonLayout);
    Button createButton = new Button(i18nManager.getMessage(Messages.BUTTON_CREATE));
    buttonLayout.addComponent(createButton);
    buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
    createButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            handleFormSubmit();
        }
    });
}
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 ClickListener

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

the class TaskEventsPanel method addInputField.

protected void addInputField() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setWidth(100, UNITS_PERCENTAGE);
    addComponent(layout);
    // Hack: actionHandlers can only be attached to panels or windows
    Panel textFieldPanel = new Panel();
    textFieldPanel.addStyleName(Reindeer.PANEL_LIGHT);
    textFieldPanel.setContent(new VerticalLayout());
    textFieldPanel.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(textFieldPanel);
    layout.setExpandRatio(textFieldPanel, 1.0f);
    commentInputField = new TextField();
    commentInputField.setWidth(100, UNITS_PERCENTAGE);
    textFieldPanel.addComponent(commentInputField);
    // Hack to catch keyboard 'enter'
    textFieldPanel.addActionHandler(new Handler() {

        public void handleAction(Action action, Object sender, Object target) {
            addNewComment(commentInputField.getValue().toString());
        }

        public Action[] getActions(Object target, Object sender) {
            return new Action[] { new ShortcutAction("enter", ShortcutAction.KeyCode.ENTER, null) };
        }
    });
    addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT));
    layout.addComponent(addCommentButton);
    layout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT);
    addCommentButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            addNewComment(commentInputField.getValue().toString());
        }
    });
}
Also used : Panel(com.vaadin.ui.Panel) ShortcutAction(com.vaadin.event.ShortcutAction) Action(com.vaadin.event.Action) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) VerticalLayout(com.vaadin.ui.VerticalLayout) TextField(com.vaadin.ui.TextField) Handler(com.vaadin.event.Action.Handler) ShortcutAction(com.vaadin.event.ShortcutAction) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 48 with ClickListener

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

the class JobDetailPanel method addActions.

protected void addActions() {
    Button deleteButton = new Button(i18nManager.getMessage(Messages.JOB_DELETE));
    deleteButton.setIcon(Images.DELETE);
    deleteButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            managementService.deleteJob(job.getId());
            notificationManager.showInformationNotification(Messages.JOB_DELETED);
            jobPage.refreshSelectNext();
        }
    });
    Button executeButton = new Button(i18nManager.getMessage(Messages.JOB_EXECUTE));
    executeButton.setIcon(Images.EXECUTE);
    executeButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            try {
                managementService.executeJob(job.getId());
                jobPage.refreshSelectNext();
            } catch (ActivitiException ae) {
                String errorMessage = ae.getMessage() + (ae.getCause() != null ? " (" + ae.getCause().getClass().getName() + ")" : "");
                notificationManager.showErrorNotification(Messages.JOB_ERROR, errorMessage);
                // Refresh the current job
                jobPage.refreshCurrentJobDetails();
            }
        }
    });
    jobPage.getToolBar().removeAllButtons();
    jobPage.getToolBar().addButton(executeButton);
    jobPage.getToolBar().addButton(deleteButton);
}
Also used : ActivitiException(org.activiti.engine.ActivitiException) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 49 with ClickListener

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

the class DeploymentDetailPanel method addActions.

protected void addActions() {
    // Delete button
    Button deleteButton = new Button(i18nManager.getMessage(Messages.DEPLOYMENT_DELETE));
    deleteButton.setIcon(Images.DELETE);
    deleteButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            viewManager.showPopupWindow(new DeleteDeploymentPopupWindow(deployment, parent));
        }
    });
    parent.getToolBar().removeAllButtons();
    parent.getToolBar().addButton(deleteButton);
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 50 with ClickListener

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

the class DeploymentDetailPanel method addProcessDefinitionLinks.

protected void addProcessDefinitionLinks() {
    List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).orderByProcessDefinitionName().asc().list();
    if (!processDefinitions.isEmpty()) {
        // Header
        Label processDefinitionHeader = new Label(i18nManager.getMessage(Messages.DEPLOYMENT_HEADER_DEFINITIONS));
        processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_H3);
        processDefinitionHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
        processDefinitionHeader.setWidth(100, UNITS_PERCENTAGE);
        addDetailComponent(processDefinitionHeader);
        // processes
        VerticalLayout processDefinitionLinksLayout = new VerticalLayout();
        processDefinitionLinksLayout.setSpacing(true);
        processDefinitionLinksLayout.setMargin(true, false, true, false);
        addDetailComponent(processDefinitionLinksLayout);
        for (final ProcessDefinition processDefinition : processDefinitions) {
            Button processDefinitionButton = new Button(getProcessDisplayName(processDefinition));
            processDefinitionButton.addListener(new ClickListener() {

                public void buttonClick(ClickEvent event) {
                    viewManager.showDeployedProcessDefinitionPage(processDefinition.getId());
                }
            });
            processDefinitionButton.addStyleName(Reindeer.BUTTON_LINK);
            processDefinitionLinksLayout.addComponent(processDefinitionButton);
        }
    }
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) Label(com.vaadin.ui.Label) PrettyTimeLabel(org.activiti.explorer.ui.custom.PrettyTimeLabel) VerticalLayout(com.vaadin.ui.VerticalLayout) ProcessDefinition(org.activiti.engine.repository.ProcessDefinition) 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