use of com.vaadin.ui.VerticalLayout in project Activiti by Activiti.
the class UserDetailsComponent method addUserDetails.
protected void addUserDetails() {
VerticalLayout detailsLayout = new VerticalLayout();
addComponent(detailsLayout);
// Layout for name + skype
HorizontalLayout nameLayout = new HorizontalLayout();
nameLayout.setSpacing(true);
detailsLayout.addComponent(nameLayout);
// Name
Label nameLabel = null;
if (user != null) {
nameLabel = new Label(user.getFirstName() + " " + user.getLastName());
nameLabel.addStyleName(ExplorerLayout.STYLE_LABEL_BOLD);
} else {
nameLabel = new Label(" ", Label.CONTENT_XHTML);
}
nameLayout.addComponent(nameLabel);
// Layout for lower details
HorizontalLayout actionsLayout = new HorizontalLayout();
actionsLayout.setSpacing(true);
detailsLayout.addComponent(actionsLayout);
// Role
Label roleLabel = new Label(role);
actionsLayout.addComponent(roleLabel);
// Action button
if (clickListener != null) {
Button button = new Button(buttonCaption);
button.addStyleName(Reindeer.BUTTON_SMALL);
button.addListener(clickListener);
actionsLayout.addComponent(button);
}
}
use of com.vaadin.ui.VerticalLayout in project Activiti by Activiti.
the class EditorProcessDefinitionDetailPanel method initUi.
protected void initUi() {
setSizeFull();
addStyleName(Reindeer.LAYOUT_WHITE);
detailPanelLayout = new VerticalLayout();
detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
detailPanelLayout.setMargin(true);
detailPanelLayout.setSpacing(true);
setDetailContainer(detailPanelLayout);
// All details about the process definition
initHeader();
detailContainer = new HorizontalLayout();
detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
detailPanelLayout.addComponent(detailContainer);
detailContainer.setSizeFull();
initActions();
initProcessDefinitionInfo();
}
use of com.vaadin.ui.VerticalLayout in project Activiti by Activiti.
the class SelectEditorComponent method createModelerEditorChoice.
protected void createModelerEditorChoice() {
modelerLayout = new HorizontalLayout();
modelerLayout.setWidth("300px");
modelerLayout.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
addComponent(modelerLayout);
modelerButton = new Button();
modelerButton.setIcon(Images.PROCESS_EDITOR_BPMN);
modelerButton.setStyleName(Reindeer.BUTTON_LINK);
modelerLayout.addComponent(modelerButton);
modelerLayout.setComponentAlignment(modelerButton, Alignment.MIDDLE_LEFT);
VerticalLayout modelerTextLayout = new VerticalLayout();
modelerLayout.addComponent(modelerTextLayout);
modelerLayout.setExpandRatio(modelerTextLayout, 1.0f);
modelerLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_MODELER));
modelerLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
modelerTextLayout.addComponent(modelerLabel);
modelerDescriptionLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_MODELER_DESCRIPTION));
modelerDescriptionLabel.addStyleName(Reindeer.LABEL_SMALL);
modelerDescriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
modelerTextLayout.addComponent(modelerDescriptionLabel);
modelerLayout.addListener(new LayoutClickListener() {
public void layoutClick(LayoutClickEvent event) {
preferModeler();
}
});
modelerButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
preferModeler();
}
});
}
use of com.vaadin.ui.VerticalLayout in project Activiti by Activiti.
the class UploadComponent method addDropPanel.
protected void addDropPanel() {
Panel dropPanel = new Panel();
DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(dropPanel);
dragAndDropWrapper.setDropHandler(this);
dragAndDropWrapper.setWidth("80%");
addComponent(dragAndDropWrapper);
setComponentAlignment(dragAndDropWrapper, Alignment.MIDDLE_CENTER);
Label dropLabel = new Label(i18nManager.getMessage(Messages.UPLOAD_DROP));
dropLabel.setSizeUndefined();
dropPanel.addComponent(dropLabel);
((VerticalLayout) dropPanel.getContent()).setComponentAlignment(dropLabel, Alignment.MIDDLE_CENTER);
}
use of com.vaadin.ui.VerticalLayout in project Activiti by Activiti.
the class ImageAttachmentRenderer method getDetailComponent.
@Override
public Component getDetailComponent(Attachment attachment) {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setSizeUndefined();
verticalLayout.setSpacing(true);
verticalLayout.setMargin(true);
Label description = new Label(attachment.getDescription());
description.setSizeUndefined();
verticalLayout.addComponent(description);
// Image
TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
String mimeType = extractMineType(attachment.getType());
InputStream imageStream = ImageUtil.resizeImage(taskService.getAttachmentContent(attachment.getId()), mimeType, 900, 550);
Resource resource = new StreamResource(new InputStreamStreamSource(imageStream), attachment.getName() + extractExtention(attachment.getType()), ExplorerApp.get());
Embedded image = new Embedded(null, resource);
verticalLayout.addComponent(image);
// Linke
HorizontalLayout LinkLayout = new HorizontalLayout();
LinkLayout.setSpacing(true);
verticalLayout.addComponent(LinkLayout);
verticalLayout.setComponentAlignment(LinkLayout, Alignment.MIDDLE_CENTER);
Label fullSizeLabel = new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.RELATED_CONTENT_SHOW_FULL_SIZE));
LinkLayout.addComponent(fullSizeLabel);
Link link = null;
if (attachment.getUrl() != null) {
link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
} else {
taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
Resource res = new StreamResource(new InputStreamStreamSource(taskService.getAttachmentContent(attachment.getId())), attachment.getName() + extractExtention(attachment.getType()), ExplorerApp.get());
link = new Link(attachment.getName(), res);
}
link.setIcon(Images.RELATED_CONTENT_PICTURE);
link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
LinkLayout.addComponent(link);
return verticalLayout;
}
Aggregations