use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class ReportDetailPanel method initHeader.
protected void initHeader() {
GridLayout details = new GridLayout(2, 2);
details.setWidth(100, UNITS_PERCENTAGE);
details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
details.setSpacing(true);
details.setMargin(false, false, true, false);
details.setColumnExpandRatio(1, 1.0f);
detailPanelLayout.addComponent(details);
// Image
Embedded image = new Embedded(null, Images.REPORT_50);
details.addComponent(image, 0, 0, 0, 1);
// Name
Label nameLabel = new Label(getReportDisplayName());
nameLabel.addStyleName(Reindeer.LABEL_H2);
details.addComponent(nameLabel, 1, 0);
// Properties
HorizontalLayout propertiesLayout = new HorizontalLayout();
propertiesLayout.setSpacing(true);
details.addComponent(propertiesLayout);
// Version
String versionString = i18nManager.getMessage(Messages.PROCESS_VERSION, processDefinition.getVersion());
Label versionLabel = new Label(versionString);
versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_VERSION);
propertiesLayout.addComponent(versionLabel);
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class ReportDetailPanel method initUi.
protected void initUi() {
setSizeFull();
addStyleName(Reindeer.LAYOUT_WHITE);
detailPanelLayout = new VerticalLayout();
detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
detailPanelLayout.setMargin(true);
setDetailContainer(detailPanelLayout);
initHeader();
detailContainer = new HorizontalLayout();
detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
detailPanelLayout.addComponent(detailContainer);
detailContainer.setSizeFull();
initForm();
initActions();
}
use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class EditorProcessDefinitionInfoComponent method initImage.
protected void initImage() {
processImageContainer = new VerticalLayout();
Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
processTitle.addStyleName(ExplorerLayout.STYLE_H3);
processImageContainer.addComponent(processTitle);
StreamSource streamSource = null;
final byte[] editorSourceExtra = repositoryService.getModelEditorSourceExtra(modelData.getId());
if (editorSourceExtra != null) {
streamSource = new StreamSource() {
private static final long serialVersionUID = 1L;
public InputStream getStream() {
InputStream inStream = null;
try {
inStream = new ByteArrayInputStream(editorSourceExtra);
} catch (Exception e) {
LOGGER.warn("Error reading PNG in StreamSource", e);
}
return inStream;
}
};
}
if (streamSource != null) {
Embedded embedded = new Embedded(null, new ImageStreamSource(streamSource, ExplorerApp.get()));
embedded.setType(Embedded.TYPE_IMAGE);
embedded.setSizeUndefined();
// using panel for scrollbars
Panel imagePanel = new Panel();
imagePanel.addStyleName(Reindeer.PANEL_LIGHT);
imagePanel.setWidth(100, UNITS_PERCENTAGE);
imagePanel.setHeight(700, UNITS_PIXELS);
HorizontalLayout panelLayout = new HorizontalLayout();
panelLayout.setSizeUndefined();
imagePanel.setContent(panelLayout);
imagePanel.addComponent(embedded);
processImageContainer.addComponent(imagePanel);
} else {
Label noImageAvailable = new Label(i18nManager.getMessage(Messages.PROCESS_NO_DIAGRAM));
processImageContainer.addComponent(noImageAvailable);
}
addComponent(processImageContainer);
}
use of com.vaadin.ui.HorizontalLayout 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.HorizontalLayout in project Activiti by Activiti.
the class UrlAttachmentRenderer method getDetailComponent.
public Component getDetailComponent(Attachment attachment) {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setSpacing(true);
verticalLayout.setMargin(true);
verticalLayout.addComponent(new Label(attachment.getDescription()));
HorizontalLayout linkLayout = new HorizontalLayout();
linkLayout.setSpacing(true);
verticalLayout.addComponent(linkLayout);
// Icon
linkLayout.addComponent(new Embedded(null, Images.RELATED_CONTENT_URL));
// Link
Link link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl()));
link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK);
linkLayout.addComponent(link);
return verticalLayout;
}
Aggregations