use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class EventOverviewPanel method initEvents.
protected void initEvents() {
HorizontalLayout eventsHeader = new HorizontalLayout();
eventsHeader.setSpacing(true);
eventsHeader.setWidth(80, UNITS_PERCENTAGE);
eventsHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
addDetailComponent(eventsHeader);
initEventTitle(eventsHeader);
stepButton = new Button(i18nManager.getMessage(Messages.CRYSTALBALL_BUTTON_NEXTEVENT));
stepButton.setEnabled(false);
stepButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
if (!SimulationRunContext.getEventCalendar().getEvents().isEmpty()) {
simulationDebugger.step();
refreshEvents();
}
}
});
eventsHeader.addComponent(stepButton);
eventsHeader.setComponentAlignment(stepButton, Alignment.MIDDLE_LEFT);
showProcessInstanceButton = new Button();
showProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK);
showProcessInstanceButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (replayHistoricInstance != null) {
ExplorerApp.get().getViewManager().showMyProcessInstancesPage(replayHistoricInstance.getId());
}
}
});
eventsHeader.addComponent(showProcessInstanceButton);
eventsHeader.setComponentAlignment(showProcessInstanceButton, Alignment.MIDDLE_LEFT);
eventLayout = new HorizontalLayout();
eventLayout.setWidth(100, UNITS_PERCENTAGE);
addDetailComponent(eventLayout);
initEventsTable();
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class GroupDetailPanel method initDeleteButton.
protected void initDeleteButton(VerticalLayout actionsLayout) {
Button deleteButton = new Button(i18nManager.getMessage(Messages.GROUP_DELETE));
deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
actionsLayout.addComponent(deleteButton);
deleteButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.GROUP_CONFIRM_DELETE, group.getId()));
confirmPopup.addListener(new ConfirmationEventListener() {
protected void rejected(ConfirmationEvent event) {
}
protected void confirmed(ConfirmationEvent event) {
// Delete group from database
identityService.deleteGroup(group.getId());
// Update ui
groupPage.refreshSelectNext();
}
});
ExplorerApp.get().getViewManager().showPopupWindow(confirmPopup);
}
});
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class GroupDetailPanel method initSaveButton.
protected void initSaveButton(VerticalLayout actionsLayout) {
Button saveButton = new Button(i18nManager.getMessage(Messages.USER_SAVE));
saveButton.addStyleName(Reindeer.BUTTON_SMALL);
actionsLayout.addComponent(saveButton);
saveButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
String originalName = group.getName();
// Update data
if (nameTextField.getValue() != null) {
group.setName(nameTextField.getValue().toString());
group.setType(typeCombobox.getValue().toString());
}
identityService.saveGroup(group);
// Update UI
editingDetails = false;
detailLayout.removeAllComponents();
populateGroupDetails();
// Refresh task list (only if name was changed)
if ((originalName != null && !originalName.equals(group.getName())) || (originalName == null && group.getName() != null)) {
groupPage.notifyGroupChanged(group.getId());
}
}
});
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class UserDetailPanel method initActions.
protected void initActions() {
Button createUserButton = new Button(i18nManager.getMessage(Messages.USER_CREATE));
createUserButton.setIcon(Images.USER_16);
createUserButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
NewUserPopupWindow newUserPopupWindow = new NewUserPopupWindow();
ExplorerApp.get().getViewManager().showPopupWindow(newUserPopupWindow);
}
});
userPage.getToolBar().removeAllButtons();
userPage.getToolBar().addButton(createUserButton);
}
use of com.vaadin.ui.Button.ClickListener in project Activiti by Activiti.
the class UserDetailPanel method initDeleteButton.
protected void initDeleteButton(VerticalLayout actionLayout) {
Button deleteButton = new Button(i18nManager.getMessage(Messages.USER_DELETE));
deleteButton.addStyleName(Reindeer.BUTTON_SMALL);
actionLayout.addComponent(deleteButton);
deleteButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.USER_CONFIRM_DELETE, user.getId()));
confirmPopup.addListener(new ConfirmationEventListener() {
protected void rejected(ConfirmationEvent event) {
}
protected void confirmed(ConfirmationEvent event) {
// Delete user from database
identityService.deleteUser(user.getId());
// Update ui
userPage.refreshSelectNext();
}
});
ExplorerApp.get().getViewManager().showPopupWindow(confirmPopup);
}
});
}
Aggregations