use of com.vaadin.ui.Button in project Activiti by Activiti.
the class ProcessDefinitionDetailPanel method initActions.
protected void initActions(AbstractPage parentPage) {
ProcessDefinitionPage processDefinitionPage = (ProcessDefinitionPage) parentPage;
startProcessInstanceButton = new Button(i18nManager.getMessage(Messages.PROCESS_START));
startProcessInstanceButton.addListener(new StartProcessInstanceClickListener(processDefinition, processDefinitionPage));
editProcessDefinitionButton = new Button(i18nManager.getMessage(Messages.PROCESS_CONVERT));
editProcessDefinitionButton.addListener(new ConvertProcessDefinitionToModelClickListener(processDefinition));
if (((ProcessDefinitionEntity) processDefinition).isGraphicalNotationDefined() == false) {
editProcessDefinitionButton.setEnabled(false);
}
// Clear toolbar and add 'start' button
processDefinitionPage.getToolBar().removeAllButtons();
processDefinitionPage.getToolBar().addButton(startProcessInstanceButton);
processDefinitionPage.getToolBar().addButton(editProcessDefinitionButton);
}
use of com.vaadin.ui.Button in project Activiti by Activiti.
the class DescriptionComponent method initLayoutClickListener.
protected void initLayoutClickListener() {
addListener(new LayoutClickListener() {
public void layoutClick(LayoutClickEvent event) {
if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
// textarea
final TextArea descriptionTextArea = new TextArea();
descriptionTextArea.setWidth(100, UNITS_PERCENTAGE);
descriptionTextArea.setValue(task.getDescription());
editLayout.addComponent(descriptionTextArea);
// ok button
Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
editLayout.addComponent(okButton);
editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
// replace
replaceComponent(descriptionLabel, editLayout);
// When OK is clicked -> update task data + ui
okButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
// Update data
task.setDescription(descriptionTextArea.getValue().toString());
taskService.saveTask(task);
// Update UI
descriptionLabel.setValue(task.getDescription());
replaceComponent(editLayout, descriptionLabel);
}
});
}
}
});
}
use of com.vaadin.ui.Button 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 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 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);
}
Aggregations