List of usage examples for com.vaadin.ui Panel setStyleName
@Override public void setStyleName(String style)
From source file:module.pandabox.presentation.PandaBox.java
License:Open Source License
private Layout getPanelPreviews() { Layout grid = getPreviewLayout("Panels"); Panel panel = new DemoPanel("Panel"); panel.setIcon(new ThemeResource("../runo/icons/16/document.png")); grid.addComponent(panel);//from w ww .j a v a 2s.co m panel = new DemoPanel(); grid.addComponent(panel); panel = new DemoPanel("Borderless Panel"); panel.setStyleName(BennuTheme.PANEL_BORDERLESS); grid.addComponent(panel); panel = new DemoPanel(); panel.setStyleName(BennuTheme.PANEL_BORDERLESS); grid.addComponent(panel); panel = new DemoPanel("Light panel"); panel.setStyleName(BennuTheme.PANEL_LIGHT); panel.setIcon(new ThemeResource("../runo/icons/16/document.png")); grid.addComponent(panel); panel = new DemoPanel(); panel.setStyleName(BennuTheme.PANEL_LIGHT); grid.addComponent(panel); panel = new DemoPanel("Borderless Light"); panel.addStyleName(BennuTheme.PANEL_BORDERLESS); panel.addStyleName(BennuTheme.PANEL_LIGHT); grid.addComponent(panel); panel = new DemoPanel(); panel.addStyleName(BennuTheme.PANEL_BORDERLESS); panel.addStyleName(BennuTheme.PANEL_LIGHT); grid.addComponent(panel); return grid; }
From source file:nl.kpmg.lcm.ui.component.DefinedLabel.java
License:Apache License
public DefinedLabel(String title, String content, String tooltip) { // A layout structure used for composition Panel panel = new Panel(); panel.setStyleName("v-panel-borderless"); panel.setWidth("100%"); VerticalLayout panelContent = new VerticalLayout(); panelContent.setMargin(true); // Very useful panelContent.setWidth("100%"); panel.setContent(panelContent);/*from w w w . j a va2s. com*/ // Compose from multiple components Label titleLabel = new Label(title); titleLabel.setStyleName("v-label-h4"); panelContent.addComponent(titleLabel); Label contentLabel = new Label(content); panelContent.addComponent(contentLabel); // The composition root MUST be set setCompositionRoot(panel); }
From source file:org.activiti.kickstart.ui.panel.KickstartWorkflowPanel.java
License:Apache License
protected void initButtons(GridLayout layout) { final Button saveButton = new Button("Save"); saveButton.setEnabled(nameField.getValue() != null && !"".equals((String) nameField.getValue())); saveButton.setIcon(saveImage);/*from www.j av a 2 s . c o m*/ saveButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 3546324122090420533L; public void buttonClick(ClickEvent event) { try { adhocWorkflowService.deployKickstartWorkflow(createAdhocWorkflow()); Panel successPanel = new Panel(); successPanel.setStyleName(Reindeer.PANEL_LIGHT); Label successLabel = new Label("Process successfully deployed"); successPanel.addComponent(successLabel); viewManager.switchWorkArea(ViewManager.PROCESS_SUCESSFULLY_DEPLOYED, successPanel); } catch (Exception e) { e.printStackTrace(); viewManager.showPopupWindow(new ErrorPopupWindow(e)); } } }); // Dependending on namefield value, save button is enabled nameField.addListener(new ValueChangeListener() { private static final long serialVersionUID = -4357300368046546003L; public void valueChange(ValueChangeEvent event) { if (nameField.getValue() != null && !"".equals((String) nameField.getValue())) { saveButton.setEnabled(true); } else { saveButton.setEnabled(false); } } }); Button generateImageButton = new Button("View image"); generateImageButton.setIcon(generateImageImage); generateImageButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 5671158538486627690L; public void buttonClick(ClickEvent event) { viewManager.showPopupWindow(new ProcessImagePopupWindow(viewManager, createAdhocWorkflow())); } }); HorizontalLayout footer = new HorizontalLayout(); footer.setSpacing(true); footer.addComponent(saveButton); footer.addComponent(generateImageButton); layout.addComponent(new Label()); layout.addComponent(footer); }
From source file:org.activiti.kickstart.ui.popup.ProcessImagePopupWindow.java
License:Apache License
protected void initUi() { setModal(true);//w w w . j a va2 s . co m setHeight("80%"); setWidth("80%"); center(); setCaption(TITLE); StreamResource.StreamSource streamSource = null; if (processDefinitionId != null) { streamSource = new StreamSource() { private static final long serialVersionUID = -8875067466181823014L; public InputStream getStream() { return adhocWorkflowService.getProcessImage(processDefinitionId); } }; } else if (adhocWorkflow != null) { final ProcessDiagramGenerator converter = new ProcessDiagramGenerator(adhocWorkflow); streamSource = new StreamSource() { private static final long serialVersionUID = 239500411112658830L; public InputStream getStream() { return converter.execute(); } }; } // resource must have unique id! StreamResource imageresource = new StreamResource(streamSource, UUID.randomUUID() + ".png", viewManager.getApplication()); Panel panel = new Panel(); panel.setContent(new HorizontalLayout()); panel.setStyleName(Reindeer.PANEL_LIGHT); panel.setHeight("95%"); Embedded embedded = new Embedded("", imageresource); embedded.setType(Embedded.TYPE_IMAGE); panel.addComponent(embedded); addComponent(panel); }
From source file:org.eclipse.hawkbit.ui.AbstractHawkbitUI.java
License:Open Source License
private Panel buildContent() { final Panel content = new Panel(); content.setSizeFull();/*from w w w .j ava2 s .co m*/ content.setStyleName("view-content"); return content; }
From source file:org.eclipse.hawkbit.ui.common.table.AbstractTableLayout.java
License:Open Source License
private void buildLayout() { setSizeFull();// w w w . ja v a 2 s. c o m setSpacing(true); setMargin(false); setStyleName("group"); final VerticalLayout tableHeaderLayout = new VerticalLayout(); tableHeaderLayout.setSizeFull(); tableHeaderLayout.setSpacing(false); tableHeaderLayout.setMargin(false); tableHeaderLayout.setStyleName("table-layout"); tableHeaderLayout.addComponent(tableHeader); tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER); if (isShortCutKeysRequired()) { final Panel tablePanel = new Panel(); tablePanel.setStyleName("table-panel"); tablePanel.setHeight(100.0F, Unit.PERCENTAGE); tablePanel.setContent(table); tablePanel.addActionHandler(getShortCutKeysHandler(i18n)); tablePanel.addStyleName(ValoTheme.PANEL_BORDERLESS); tableHeaderLayout.addComponent(tablePanel); tableHeaderLayout.setComponentAlignment(tablePanel, Alignment.TOP_CENTER); tableHeaderLayout.setExpandRatio(tablePanel, 1.0F); } else { tableHeaderLayout.addComponent(table); tableHeaderLayout.setComponentAlignment(table, Alignment.TOP_CENTER); tableHeaderLayout.setExpandRatio(table, 1.0F); } addComponent(tableHeaderLayout); addComponent(detailsLayout); setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER); setComponentAlignment(detailsLayout, Alignment.TOP_CENTER); setExpandRatio(tableHeaderLayout, 1.0F); }
From source file:org.eclipse.hawkbit.ui.tenantconfiguration.TenantConfigurationDashboardView.java
License:Open Source License
/** * Init method adds all Configuration Views to the list of Views. *///from w ww .j a v a 2 s . co m @PostConstruct public void init() { if (defaultDistributionSetTypeLayout.getComponentCount() > 0) { configurationViews.add(defaultDistributionSetTypeLayout); } configurationViews.add(repositoryConfigurationView); configurationViews.add(rolloutConfigurationView); configurationViews.add(authenticationConfigurationView); configurationViews.add(pollingConfigurationView); if (customConfigurationViews != null) { configurationViews.addAll(customConfigurationViews.stream().filter(ConfigurationGroup::show) .collect(Collectors.toList())); } final Panel rootPanel = new Panel(); rootPanel.setStyleName("tenantconfig-root"); final VerticalLayout rootLayout = new VerticalLayout(); rootLayout.setSizeFull(); rootLayout.setMargin(true); rootLayout.setSpacing(true); configurationViews.forEach(rootLayout::addComponent); final HorizontalLayout buttonContent = saveConfigurationButtonsLayout(); rootLayout.addComponent(buttonContent); rootLayout.setComponentAlignment(buttonContent, Alignment.BOTTOM_LEFT); rootPanel.setContent(rootLayout); setCompositionRoot(rootPanel); configurationViews.forEach(view -> view.addChangeListener(this)); }
From source file:org.escidoc.browser.controller.ContentModelView.java
License:Open Source License
private Panel buildMetaViewsPanel() { // common part: create layout Panel metaViewsPanel = new Panel(); metaViewsPanel.setImmediate(false);/*from w w w . j a v a2 s. com*/ metaViewsPanel.setWidth("100.0%"); metaViewsPanel.setHeight("100.0%"); metaViewsPanel.setStyleName(Runo.PANEL_LIGHT); // hlMetaViews HorizontalLayout hlMetaViews = buildHlMetaViews(); metaViewsPanel.setContent(hlMetaViews); return metaViewsPanel; }
From source file:org.escidoc.browser.controller.ContentModelView.java
License:Open Source License
private VerticalLayout buildVlLeftPanel() { // common part: create layout VerticalLayout vlLeftPanel = new VerticalLayout(); vlLeftPanel.setImmediate(false);//from w w w . j a v a 2 s . co m vlLeftPanel.setWidth("100.0%"); vlLeftPanel.setHeight("100.0%"); vlLeftPanel.setMargin(false); // directMembersPanel Panel directMembersPanel = buildDirectMembersPanel(); directMembersPanel.setStyleName("directmembers"); vlLeftPanel.addComponent(directMembersPanel); return vlLeftPanel; }
From source file:org.escidoc.browser.controller.ContentModelView.java
License:Open Source License
private Panel buildDirectMembersPanel() { // common part: create layout Panel directMembersPanel = new Panel(); directMembersPanel.setImmediate(false); directMembersPanel.setWidth("100.0%"); directMembersPanel.setHeight("100.0%"); directMembersPanel.setStyleName(Runo.PANEL_LIGHT); // vlDirectMember VerticalLayout vlDirectMember = new VerticalLayout(); vlDirectMember.setImmediate(false);/*from w w w . ja v a 2s.c om*/ vlDirectMember.setWidth("100.0%"); vlDirectMember.setHeight("100.0%"); vlDirectMember.setMargin(false); directMembersPanel.setContent(vlDirectMember); return directMembersPanel; }