use of com.vaadin.ui.Button.ClickListener 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.ClickListener 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.ClickListener 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.ClickListener 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);
}
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class SelectEditorComponent method createTableDrivenEditorChoice.
protected void createTableDrivenEditorChoice() {
tableEditorLayout = new HorizontalLayout();
tableEditorLayout.setWidth("300px");
tableEditorLayout.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
addComponent(tableEditorLayout);
tableEditorButton = new Button();
tableEditorButton.setIcon(Images.PROCESS_EDITOR_TABLE);
tableEditorButton.setStyleName(Reindeer.BUTTON_LINK);
tableEditorLayout.addComponent(tableEditorButton);
tableEditorLayout.setComponentAlignment(tableEditorButton, Alignment.MIDDLE_LEFT);
VerticalLayout tableEditorTextLayout = new VerticalLayout();
tableEditorLayout.addComponent(tableEditorTextLayout);
tableEditorLayout.setExpandRatio(tableEditorTextLayout, 1.0f);
tableEditorLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_TABLE));
tableEditorLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
tableEditorTextLayout.addComponent(tableEditorLabel);
tableEditorDescriptionLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_TABLE_DESCRIPTION));
tableEditorDescriptionLabel.addStyleName(Reindeer.LABEL_SMALL);
tableEditorDescriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
tableEditorTextLayout.addComponent(tableEditorDescriptionLabel);
tableEditorLayout.addListener(new LayoutClickListener() {
public void layoutClick(LayoutClickEvent event) {
preferTableDrivenEditor();
}
});
tableEditorButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
preferTableDrivenEditor();
}
});
}
Aggregations