use of com.vaadin.ui.Button.ClickEvent 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();
}
});
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class ConfirmationDialogPopupWindow method initButtons.
protected void initButtons(I18nManager i18nManager) {
yesButton = new Button(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_YES));
layout.addComponent(yesButton, 0, 1);
layout.setComponentAlignment(yesButton, Alignment.BOTTOM_RIGHT);
yesButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
close();
fireEvent(new ConfirmationEvent(ConfirmationDialogPopupWindow.this, true));
}
});
noButton = new Button(i18nManager.getMessage(Messages.CONFIRMATION_DIALOG_NO));
layout.addComponent(noButton, 1, 1);
layout.setComponentAlignment(noButton, Alignment.BOTTOM_LEFT);
noButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
close();
fireEvent(new ConfirmationEvent(ConfirmationDialogPopupWindow.this, false));
}
});
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class GenericAttachmentRenderer method getOverviewComponent.
public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) {
Button attachmentLink = new Button(attachment.getName());
attachmentLink.addStyleName(Reindeer.BUTTON_LINK);
attachmentLink.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
parent.showAttachmentDetail(attachment);
}
});
return attachmentLink;
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class SelectUsersPopupWindow method initSelectUserButton.
protected void initSelectUserButton() {
selectUserButton = new Button(">");
selectUserButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
for (String selectedItemId : (Set<String>) matchingUsersTable.getValue()) {
// Remove from left table
Item originalItem = matchingUsersTable.getItem(selectedItemId);
// And put it in right table
selectUser(selectedItemId, (String) originalItem.getItemProperty("userName").getValue());
// Remove from left table (must be done on the end, or item properties will be inaccessible)
matchingUsersTable.removeItem(selectedItemId);
}
}
});
userSelectionLayout.addComponent(selectUserButton);
userSelectionLayout.setComponentAlignment(selectUserButton, Alignment.MIDDLE_CENTER);
}
use of com.vaadin.ui.Button.ClickEvent in project Activiti by Activiti.
the class CopyModelPopupWindow method addButtons.
protected void addButtons() {
// Cancel
Button cancelButton = new Button(i18nManager.getMessage(Messages.BUTTON_CANCEL));
cancelButton.addStyleName(Reindeer.BUTTON_SMALL);
cancelButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
close();
}
});
// Create
Button createButton = new Button(i18nManager.getMessage(Messages.PROCESS_NEW_POPUP_CREATE_BUTTON));
createButton.addStyleName(Reindeer.BUTTON_SMALL);
createButton.addListener(new ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
if (StringUtils.isEmpty((String) nameTextField.getValue())) {
form.setComponentError(new UserError("The name field is required."));
return;
}
Model newModelData = repositoryService.newModel();
ObjectNode modelObjectNode = new ObjectMapper().createObjectNode();
modelObjectNode.put(MODEL_NAME, (String) nameTextField.getValue());
String description = null;
if (StringUtils.isNotEmpty((String) descriptionTextArea.getValue())) {
description = (String) descriptionTextArea.getValue();
} else {
description = "";
}
modelObjectNode.put(MODEL_DESCRIPTION, description);
newModelData.setMetaInfo(modelObjectNode.toString());
newModelData.setName((String) nameTextField.getValue());
repositoryService.saveModel(newModelData);
repositoryService.addModelEditorSource(newModelData.getId(), repositoryService.getModelEditorSource(modelData.getId()));
repositoryService.addModelEditorSourceExtra(newModelData.getId(), repositoryService.getModelEditorSourceExtra(modelData.getId()));
close();
ExplorerApp.get().getViewManager().showEditorProcessDefinitionPage(newModelData.getId());
}
});
// Alignment
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setSpacing(true);
buttonLayout.addComponent(cancelButton);
buttonLayout.addComponent(createButton);
addComponent(buttonLayout);
windowLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
}
Aggregations