/** * Creates a new empty panel which contains the given content. * * @param content * the content for the panel. */ public Panel(Component content) { registerRpc(rpc); setContent(content); setWidth(100, Unit.PERCENTAGE); getState().tabIndex = -1; }
final Integer newHeight = (Integer) variables.get("height"); if (newWidth != null && newWidth.intValue() != getWidth()) { setWidth(newWidth.intValue(), UNITS_PIXELS);
/** * @param popupWidth the popupWidth to set */ public void setPopupWidth(String popupWidth) { this.popupWidth = popupWidth; if (root != null) { root.setWidth(popupWidth); } }
public UiPanel() { this.layout = new Panel(); // layout.setSizeFull(); layout.setWidth("100%"); }
public static Panel panel(String title, com.vaadin.ui.Component... components) { Panel p = new Panel(); p.setWidth(100, Sizeable.UNITS_PERCENTAGE); p.setCaption(title); for (com.vaadin.ui.Component c : components) { p.addComponent(c); } return p; }
public OrganisaatioSearchPopup(OrganisaatioSearchTree orgSearch) { orgSearchTree = orgSearch; orgSearchTree.init(); orgSearchTree.reload(); root = new Panel(); root.setWidth(popupWidth); root.setHeight(popupHeight); root.addComponent(orgSearchTree); }
@Override public void setWidth(float width, Unit unit) { super.setWidth(width, unit); if (getContent() != null) { if (width < 0) { getContent().setWidth(-1, Unit.PIXELS); } else { getContent().setWidth(100, Unit.PERCENTAGE); } } }
public OrganisaatioSearchPopup(OrganisaatioSearchTree orgSearch,List<String> oids) { orgSearchTree = orgSearch; orgSearchTree.init(); orgSearchTree.reloadWithOids(oids); root = new Panel(); root.setWidth(popupWidth); root.setHeight(popupHeight); root.addComponent(orgSearchTree); }
private void wrapWithModalWindow(Form form) { Panel panel = new Panel(); panel.setWidth("800px"); panel.setScrollable(true); panel.addComponent(form); setDetailsWindow(modalWindow(getMessage("dict.item"), panel)); }
@Override public com.vaadin.ui.Component getPopupComponent() { Panel popupPanel = new Panel(); popupPanel.addStyleName(ValoTheme.PANEL_BORDERLESS); popupPanel.setHeight("300px"); popupPanel.setWidth("300px"); popupViewLayout.setImmediate(true); popupPanel.setContent(popupViewLayout); popupPanel.setImmediate(true); return popupPanel; }
protected void addHtmlContent(String html) { Panel panel = new Panel(); panel.setWidth(800, UNITS_PIXELS); panel.setHeight(300, UNITS_PIXELS); content = new Label(html, Label.CONTENT_XHTML); content.setHeight(100, UNITS_PERCENTAGE); panel.addComponent(content); addComponent(panel); }
@Override protected Component getField() { if (field == null) { field = new Panel(); field.setWidth("100%"); field.setHeight("100px"); description = new Label(); description.setContentMode(Label.CONTENT_XHTML); //description.setWidth("100%"); VerticalLayout layout = new VerticalLayout(); layout.addComponent(description); layout.setWidth("100%"); field.setContent(layout); } return field; }
@Override protected void init(VaadinRequest request) { SampleGrid grid = new SampleGrid(); grid.setWidth(100, Unit.PERCENTAGE); Panel panel = new Panel(grid); panel.setWidth(600, Unit.PIXELS); HorizontalLayout layout = new HorizontalLayout(panel); layout.setMargin(true); layout.setSizeFull(); layout.setComponentAlignment(panel, Alignment.MIDDLE_CENTER); layout.setExpandRatio(panel, 1.0f); setContent(layout); } }
protected void addToCurrent(VaadinFormBuilder builder) { if (!MString.isEmpty(getElement().getTitle())) { panel = new Panel(getElement().getTitle()); panel.setContent(layout); panel.setWidth("100%"); builder.addComposite((LayoutComposite)getElement(), panel); } else super.addToCurrent(builder); }
public void afterPropertiesSet() throws Exception { setSizeFull(); Panel panel = new Panel(); panel.setWidth("50%"); panel.addComponent(new Label(getI18nHTML(), Label.CONTENT_XHTML)); addComponent(panel); setComponentAlignment(panel, Alignment.MIDDLE_CENTER); m_OKButton = new Button("OK"); panel.addComponent(m_OKButton); m_OKButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 1904763239654990140L; public void buttonClick(ClickEvent event) { getViewManager().popScreen(); getViewManager().getMainWindow().requestRepaint(); } }); }
private Panel getInitedWidgetTreePanel() { widgetTree.setContainerDataSource(hierarchicalContainer); widgetTree.setDragMode(Tree.TreeDragMode.NODE); widgetTree.setItemCaptionPropertyId("name"); widgetTree.setDropHandler(new TreeSortDropHandler(widgetTree, hierarchicalContainer)); widgetTree.setWidth("100%"); widgetTree.addShortcutListener(getDeleteShortcutListener()); Panel panel = new Panel(getLocalizedMessage("widget-hierarchy")); panel.setHeight("340px"); panel.setWidth("250px"); panel.addComponent(widgetTree); return panel; }
imagePanel.setScrollable(true); imagePanel.addStyleName(Reindeer.PANEL_LIGHT); imagePanel.setWidth(100, UNITS_PERCENTAGE); imagePanel.setHeight("100%"); mainLayout.addComponent(imagePanel);
/** * Constructor */ public AbstractDialog() { super(); // defaults setModal(true); setResizable(false); setDraggable(false); setClosable(false); // style name addStyleName("h-dialog"); // build content = new Panel(); content.setWidth("100%"); content.addStyleName(ValoTheme.PANEL_BORDERLESS); content.addStyleName("h-dialog-content"); actions = new HorizontalLayout(); actions.setWidth("100%"); actions.setSpacing(true); actions.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); actions.addStyleName("h-dialog-actions"); root = new VerticalLayout(); root.addComponent(content); root.addComponent(actions); setContent(root); }
public void doBuild() throws Exception { if (form.getAdapterProvider() == null) form.setAdapterProvider(MApi.lookup(ActivatorAdapterProvider.class, DefaultAdapterProvider.class ) ); if (isShowInformation()) { informationPane = new VaadinUiInformation(); form.setInformationPane(informationPane); addComponent(informationPane); setExpandRatio(informationPane, 0); int h = form.getModel().getInt("showInformationHeight", 0); informationPane.setHeight(h > 0 ? h + "px" : "100px"); informationPane.setWidth("100%"); } if (builder == null) builder = new VaadinFormBuilder(); builder.setForm(form); builder.doBuild(); builder.doRevert(); formPanel = new Panel(); formPanel.setWidth("100%"); formPanel.setHeight("100%"); layout = builder.getLayout(); formPanel.setContent(layout.getComponent()); addComponent(formPanel); setExpandRatio(formPanel, 1); }
private VerticalLayout buildWidgetEditorTabContent() { I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource(); VerticalLayout availableWidgetsLayout = new VerticalLayout(); availableWidgetsLayout.setSpacing(true); availableWidgetsLayout.setWidth("100%"); availableWidgetsLayout.addComponent(availableWidgetsPane); VerticalLayout stepLayout = new VerticalLayout(); stepLayout.setWidth("100%"); stepLayout.setSpacing(true); stepLayout.setMargin(true); stepLayout.addComponent(new Label(messages.getMessage("userstep.editor.widgets.instructions"), Label.CONTENT_XHTML)); stepLayout.addComponent(availableWidgetsLayout); Panel treePanel = new Panel(); treePanel.setStyleName(Reindeer.PANEL_LIGHT); treePanel.addComponent(stepTree); treePanel.setWidth("245px"); HorizontalLayout treeAndParamLayout = new HorizontalLayout(); treeAndParamLayout.setWidth("100%"); treeAndParamLayout.setSpacing(true); treeAndParamLayout.addComponent(treePanel); treeAndParamLayout.addComponent(paramPanel); treeAndParamLayout.setExpandRatio(paramPanel, 1.0f); stepLayout.addComponent(treeAndParamLayout); stepLayout.setExpandRatio(treeAndParamLayout, 1.0f); return stepLayout; }