use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class JobDetailPanel method addLinkToProcessDefinition.
protected void addLinkToProcessDefinition(final VerticalLayout verticalLayout, final String labelText, final boolean isSuspendedProcessDefinition) {
HorizontalLayout layout = new HorizontalLayout();
verticalLayout.addComponent(layout);
Label processDefinitionLabel = new Label(labelText);
processDefinitionLabel.setSizeUndefined();
layout.addComponent(processDefinitionLabel);
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
Button showProcessDefinitionLink = new Button(job.getProcessDefinitionId());
showProcessDefinitionLink.addStyleName(Reindeer.BUTTON_LINK);
showProcessDefinitionLink.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (isSuspendedProcessDefinition) {
ExplorerApp.get().getViewManager().showSuspendedProcessDefinitionsPage(job.getProcessDefinitionId());
} else {
ExplorerApp.get().getViewManager().showActiveProcessDefinitionsPage(job.getProcessDefinitionId());
}
}
});
layout.addComponent(showProcessDefinitionLink);
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class ActiveProcessDefinitionDetailPanel method initActions.
protected void initActions(final AbstractPage parentPage) {
ActiveProcessDefinitionPage processDefinitionPage = (ActiveProcessDefinitionPage) parentPage;
Button suspendButton = new Button(i18nManager.getMessage(Messages.PROCESS_SUSPEND));
suspendButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
ChangeProcessSuspensionStatePopupWindow popupWindow = new ChangeProcessSuspensionStatePopupWindow(processDefinition.getId(), parentPage, true);
ExplorerApp.get().getViewManager().showPopupWindow(popupWindow);
}
});
// Check if button must be disabled
boolean suspendJobPending = false;
List<Job> jobs = ProcessEngines.getDefaultProcessEngine().getManagementService().createJobQuery().processDefinitionId(processDefinition.getId()).list();
for (Job job : jobs) {
// TODO: this is a hack. Needs to be cleaner in engine!
if (((JobEntity) job).getJobHandlerType().equals(TimerSuspendProcessDefinitionHandler.TYPE)) {
suspendJobPending = true;
break;
}
}
suspendButton.setEnabled(!suspendJobPending);
// Clear toolbar and add 'start' button
processDefinitionPage.getToolBar().removeAllButtons();
processDefinitionPage.getToolBar().addButton(suspendButton);
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class ReportDetailPanel method initActions.
protected void initActions() {
final Button saveButton = new Button(i18nManager.getMessage(Messages.BUTTON_SAVE));
saveButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
SaveReportPopupWindow saveReportPopupWindow = new SaveReportPopupWindow();
saveReportPopupWindow.setProcessDefinitionId(processDefinition.getId());
saveReportPopupWindow.setOriginalFormProperties(savedFormProperties);
saveReportPopupWindow.setComponentToDisableOnClose(saveButton);
ExplorerApp.get().getViewManager().showPopupWindow(saveReportPopupWindow);
}
});
// Clear toolbar and add 'start' button
parentPage.getToolBar().removeAllButtons();
parentPage.getToolBar().addButton(saveButton);
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class HistoricTaskDetailPanel method populateSubTasks.
protected void populateSubTasks(List<HistoricTaskInstance> subTasks) {
for (final HistoricTaskInstance subTask : subTasks) {
// icon
Embedded icon = new Embedded(null, Images.TASK_22);
icon.setWidth(22, UNITS_PIXELS);
icon.setWidth(22, UNITS_PIXELS);
subTaskGrid.addComponent(icon);
// Link to subtask
Button subTaskLink = new Button(subTask.getName());
subTaskLink.addStyleName(Reindeer.BUTTON_LINK);
subTaskLink.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ExplorerApp.get().getViewManager().showTaskPage(subTask.getId());
}
});
subTaskGrid.addComponent(subTaskLink);
subTaskGrid.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT);
}
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class HistoricTaskDetailPanel method initParentTaskLink.
protected void initParentTaskLink() {
if (historicTask.getParentTaskId() != null) {
final HistoricTaskInstance parentTask = historyService.createHistoricTaskInstanceQuery().taskId(historicTask.getParentTaskId()).singleResult();
Button showParentTaskButton = new Button(i18nManager.getMessage(Messages.TASK_SUBTASK_OF_PARENT_TASK, parentTask.getName()));
showParentTaskButton.addStyleName(Reindeer.BUTTON_LINK);
showParentTaskButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
viewManager.showTaskPage(parentTask.getId());
}
});
centralLayout.addComponent(showParentTaskButton);
}
}
Aggregations