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();
}
});
}
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());
}
});
}
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);
}
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);
}
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);
}
}
}
Aggregations