Search in sources :

Example 21 with ClickListener

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

the class ConfirmationDialogPopupWindow method initButtons.

protected void initButtons(I18nManager i18nManager) {
    yesButton = new Button(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_YES));
    layout.addComponent(yesButton, 0, 1);
    layout.setComponentAlignment(yesButton, Alignment.BOTTOM_RIGHT);
    yesButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            close();
            fireEvent(new ConfirmationEvent(ConfirmationDialogPopupWindow.this, true));
        }
    });
    noButton = new Button(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_NO));
    layout.addComponent(noButton, 1, 1);
    layout.setComponentAlignment(noButton, Alignment.BOTTOM_LEFT);
    noButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            close();
            fireEvent(new ConfirmationEvent(ConfirmationDialogPopupWindow.this, false));
        }
    });
}
Also used : ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 22 with ClickListener

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

the class GenericAttachmentRenderer method getOverviewComponent.

public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) {
    Button attachmentLink = new Button(attachment.getName());
    attachmentLink.addStyleName(Reindeer.BUTTON_LINK);
    attachmentLink.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            parent.showAttachmentDetail(attachment);
        }
    });
    return attachmentLink;
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 23 with ClickListener

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

the class SelectUsersPopupWindow method initSelectUserButton.

protected void initSelectUserButton() {
    selectUserButton = new Button(">");
    selectUserButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            for (String selectedItemId : (Set<String>) matchingUsersTable.getValue()) {
                // Remove from left table
                Item originalItem = matchingUsersTable.getItem(selectedItemId);
                // And put it in right table
                selectUser(selectedItemId, (String) originalItem.getItemProperty("userName").getValue());
                // Remove from left table (must be done on the end, or item properties will be inaccessible) 
                matchingUsersTable.removeItem(selectedItemId);
            }
        }
    });
    userSelectionLayout.addComponent(selectUserButton);
    userSelectionLayout.setComponentAlignment(selectUserButton, Alignment.MIDDLE_CENTER);
}
Also used : Item(com.vaadin.data.Item) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 24 with ClickListener

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

the class CopyModelPopupWindow method addButtons.

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

        private static final long serialVersionUID = 1L;

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

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            if (StringUtils.isEmpty((String) nameTextField.getValue())) {
                form.setComponentError(new UserError("The name field is required."));
                return;
            }
            Model newModelData = repositoryService.newModel();
            ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
            modelObjectNode.put(MODEL_NAME, (String) nameTextField.getValue());
            String description = null;
            if (StringUtils.isNotEmpty((String) descriptionTextArea.getValue())) {
                description = (String) descriptionTextArea.getValue();
            } else {
                description = "";
            }
            modelObjectNode.put(MODEL_DESCRIPTION, description);
            newModelData.setMetaInfo(modelObjectNode.toString());
            newModelData.setName((String) nameTextField.getValue());
            repositoryService.saveModel(newModelData);
            repositoryService.addModelEditorSource(newModelData.getId(), repositoryService.getModelEditorSource(modelData.getId()));
            repositoryService.addModelEditorSourceExtra(newModelData.getId(), repositoryService.getModelEditorSourceExtra(modelData.getId()));
            close();
            ExplorerApp.get().getViewManager().showEditorProcessDefinitionPage(newModelData.getId());
        }
    });
    // Alignment
    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    buttonLayout.addComponent(cancelButton);
    buttonLayout.addComponent(createButton);
    addComponent(buttonLayout);
    windowLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
}
Also used : UserError(com.vaadin.terminal.UserError) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) Model(org.activiti.engine.repository.Model) ClickListener(com.vaadin.ui.Button.ClickListener) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 25 with ClickListener

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

the class DeleteModelPopupWindow method addButtons.

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

        private static final long serialVersionUID = 1L;

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

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            repositoryService.deleteModel(modelData.getId());
            close();
            ExplorerApp.get().getViewManager().showEditorProcessDefinitionPage();
        }
    });
    // 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)

Aggregations

ClickEvent (com.vaadin.ui.Button.ClickEvent)66 ClickListener (com.vaadin.ui.Button.ClickListener)66 Button (com.vaadin.ui.Button)61 HorizontalLayout (com.vaadin.ui.HorizontalLayout)15 Label (com.vaadin.ui.Label)11 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)8 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)7 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)7 VerticalLayout (com.vaadin.ui.VerticalLayout)6 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