Search in sources :

Example 86 with Button

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

the class ApplicationSelectionLinkGenerator method generateCell.

@Override
public Object generateCell(final Table source, final Object itemId, Object columnId) {
    final Property<Integer> idProperty = source.getContainerProperty(itemId, idPropertyName);
    final Property<String> labelProperty = source.getContainerProperty(itemId, labelPropertyName);
    Object cellValue = columnGenerator.generateCell(source, itemId, columnId);
    if (cellValue == null) {
        return null;
    } else {
        if (idProperty.getValue() == null) {
            return cellValue;
        } else {
            Button button = new Button(cellValue.toString());
            button.setStyleName(BaseTheme.BUTTON_LINK);
            button.setDescription(idProperty.getValue().toString());
            button.addClickListener(new Button.ClickListener() {

                @Override
                public void buttonClick(Button.ClickEvent event) {
                    Integer applicationId = idProperty.getValue();
                    String applicationName = labelProperty.getValue();
                    ApplicationVertex vertex = new ApplicationVertex(applicationId.toString(), applicationName);
                    fireVertexUpdatedEvent(vertex);
                }
            });
            return button;
        }
    }
}
Also used : Button(com.vaadin.ui.Button) ApplicationVertex(org.opennms.features.topology.plugins.topo.application.ApplicationVertex)

Example 87 with Button

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

the class PromptWindow method buttonClick.

/* (non-Javadoc)
     * @see com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.Button.ClickEvent)
     */
@Override
public void buttonClick(Button.ClickEvent event) {
    final Button btn = event.getButton();
    if (btn == okButton) {
        if (fileName.getValue() != null && !((String) fileName.getValue()).trim().equals("")) {
            textFieldChanged((String) fileName.getValue());
        }
    }
    close();
}
Also used : Button(com.vaadin.ui.Button)

Example 88 with Button

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

the class NodeSelectionLinkGenerator method generateCell.

@Override
public Object generateCell(final Table source, final Object itemId, Object columnId) {
    final Property<Integer> nodeIdProperty = source.getContainerProperty(itemId, m_nodeIdProperty);
    Object cellValue = m_generator.generateCell(source, itemId, columnId);
    if (cellValue == null) {
        return null;
    } else {
        if (nodeIdProperty.getValue() == null) {
            return cellValue;
        } else {
            Button button = new Button(cellValue.toString());
            button.setStyleName(BaseTheme.BUTTON_LINK);
            button.setDescription(nodeIdProperty.getValue().toString());
            button.addClickListener(new ClickListener() {

                @Override
                public void buttonClick(ClickEvent event) {
                    Integer nodeId = nodeIdProperty.getValue();
                    String nodeLabel = (String) source.getContainerProperty(itemId, m_nodeLabelProperty).getValue();
                    VertexRef vertexRef = new DefaultVertexRef("nodes", String.valueOf(nodeId), nodeLabel);
                    fireVertexUpdatedEvent(vertexRef);
                }
            });
            return button;
        }
    }
}
Also used : DefaultVertexRef(org.opennms.features.topology.api.topo.DefaultVertexRef) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) DefaultVertexRef(org.opennms.features.topology.api.topo.DefaultVertexRef) VertexRef(org.opennms.features.topology.api.topo.VertexRef) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 89 with Button

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

the class TaskInvolvedPeopleComponent method initAddPeopleButton.

protected void initAddPeopleButton(HorizontalLayout headerLayout) {
    addPeopleButton = new Button();
    addPeopleButton.addStyleName(ExplorerLayout.STYLE_ADD);
    headerLayout.addComponent(addPeopleButton);
    addPeopleButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            final SelectUsersPopupWindow involvePeoplePopupWindow = new SelectUsersPopupWindow(i18nManager.getMessage(Messages.PEOPLE_INVOLVE_POPUP_CAPTION), true);
            involvePeoplePopupWindow.addListener(new SubmitEventListener() {

                protected void submitted(SubmitEvent event) {
                    Collection<String> selectedUserIds = involvePeoplePopupWindow.getSelectedUserIds();
                    for (String userId : selectedUserIds) {
                        String role = involvePeoplePopupWindow.getSelectedUserRole(userId);
                        taskService.addUserIdentityLink(task.getId(), userId, role);
                    }
                    taskDetailPanel.notifyPeopleInvolvedChanged();
                }

                protected void cancelled(SubmitEvent event) {
                }
            });
            viewManager.showPopupWindow(involvePeoplePopupWindow);
        }
    });
}
Also used : SelectUsersPopupWindow(org.activiti.explorer.ui.custom.SelectUsersPopupWindow) Button(com.vaadin.ui.Button) SubmitEventListener(org.activiti.explorer.ui.event.SubmitEventListener) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Example 90 with Button

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

the class TaskRelatedContentComponent method initActions.

protected void initActions() {
    HorizontalLayout actionsContainer = new HorizontalLayout();
    actionsContainer.setSizeFull();
    // Title
    Label processTitle = new Label(i18nManager.getMessage(Messages.TASK_RELATED_CONTENT));
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processTitle.setSizeFull();
    actionsContainer.addComponent(processTitle);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT);
    actionsContainer.setExpandRatio(processTitle, 1.0f);
    // Add content button
    Button addRelatedContentButton = new Button();
    addRelatedContentButton.addStyleName(ExplorerLayout.STYLE_ADD);
    addRelatedContentButton.addListener(new com.vaadin.ui.Button.ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
            CreateAttachmentPopupWindow popup = new CreateAttachmentPopupWindow();
            if (task.getProcessInstanceId() != null) {
                popup.setProcessInstanceId(task.getProcessInstanceId());
            } else {
                popup.setTaskId(task.getId());
            }
            // Add listener to update attachments when added
            popup.addListener(new SubmitEventListener() {

                private static final long serialVersionUID = 1L;

                @Override
                protected void submitted(SubmitEvent event) {
                    taskDetailPanel.notifyRelatedContentChanged();
                }

                @Override
                protected void cancelled(SubmitEvent event) {
                // No attachment was added so updating UI isn't needed.
                }
            });
            ExplorerApp.get().getViewManager().showPopupWindow(popup);
        }
    });
    actionsContainer.addComponent(addRelatedContentButton);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT);
    addComponent(actionsContainer);
}
Also used : Button(com.vaadin.ui.Button) SubmitEventListener(org.activiti.explorer.ui.event.SubmitEventListener) Label(com.vaadin.ui.Label) CreateAttachmentPopupWindow(org.activiti.explorer.ui.content.CreateAttachmentPopupWindow) HorizontalLayout(com.vaadin.ui.HorizontalLayout) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

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