@Override public void setSizeFull() { getRootOrThrow().setSizeFull(); }
private Component doCreateLayout(LayoutDefinition<?> definition, Map<String, Component> components) { final LayoutProducer<LayoutDefinition> producer = getComponentProvider().newInstance(definition.getImplementationClass()); final Component layout = producer.createLayout(definition, components); layout.setSizeFull(); return layout; }
@Override public void changeView(@Nonnull KrailView toView) { checkNotNull(toView); log.debug("changing view to {}", toView.getName()); Component content = toView.getRootComponent(); if (content == null) { throw new ConfigurationException("The root component for " + toView.getName() + " cannot be null"); } translator.translate(toView); content.setSizeFull(); getViewDisplayPanel().setContent(content); this.view = toView; String pageTitle = pageTitle(); getPage().setTitle(pageTitle); log.debug("Page title set to '{}'", pageTitle); }
private void initContentPanel() { contentPanel = new Panel(); contentPanel.setContent(new VerticalLayout()); contentPanel.getContent().setSizeFull(); contentPanel.setSizeFull(); }
public void valueChange(ValueChangeEvent event) { String name = (String) event.getProperty().getValue(); if (name != null) { currentSelection = name; currentComponent = components.get(name); selectedComponentLayout.removeComponent(selectedComponentLayout.getComponent(0, 0)); if (currentComponent != null) { currentComponent.setSizeFull(); selectedComponentLayout.addComponent(currentComponent, 0, 0); okButton.setEnabled(true); } else { okButton.setEnabled(false); } } } });
@Test public void changeView() { // given when(toView.getRootComponent()).thenReturn(viewContent); when(toView.getName()).thenReturn("toView"); // when ui.changeView(toView); // then verify(toView).getRootComponent(); verify(translator).translate(toView); verify(viewContent).setSizeFull(); assertThat(ui.getViewDisplayPanel() .getContent()).isEqualTo(viewContent); }
/** * Sets a component as content to the message dialog. * * @param messageComponent The component as content * @return The {@link MessageBox} instance itself */ public MessageBox withMessage(Component messageComponent) { if (this.messageComponent != null) { contentLayout.removeComponent(this.messageComponent); } this.messageComponent = messageComponent; if (messageComponent != null) { messageComponent.setSizeFull(); contentLayout.addComponent(messageComponent, contentLayout.getComponentCount()); contentLayout.setExpandRatio(messageComponent, 1.0f); contentLayout.setComponentAlignment(messageComponent, Alignment.MIDDLE_CENTER); } return this; }
@Override public void changeView(KrailView toView) { checkNotNull(toView); log.debug("changing view to {}", toView.getName()); Component content = toView.getRootComponent(); if (content == null) { throw new ConfigurationException("The root component for " + toView.getName() + " cannot be null"); } if (toView instanceof Form) { ((Form) toView).translate(); } else { i18NProcessor.translate(toView); } content.setSizeFull(); getViewDisplayPanel().setContent(content); this.view = toView; updatePageTitle(); }
@Test public void changeViewToForm() { // given Form form = mock(Form.class); when(form.getRootComponent()).thenReturn(viewContent); when(form.getName()).thenReturn("toForm"); // when ui.changeView(form); // then verify(form).getRootComponent(); verify(translator, never()).translate(toView); verify(form).translate(); verify(viewContent).setSizeFull(); assertThat(ui.getViewDisplayPanel() .getContent()).isEqualTo(viewContent); }
public IntroductionView(JmxConfigGeneratorApplication app) { this.app = app; Button next = UIHelper.createButton("next", IconProvider.BUTTON_NEXT, this); setSizeFull(); setContent(new VerticalLayout()); getContent().setSizeFull(); Layout layout = new VerticalLayout(); layout.addComponent(new Label(UIHelper.loadContentFromFile(getClass(), "/descriptions/IntroductionView.html"), ContentMode.HTML)); layout.addComponent(next); setContent(layout); }
/** * Creates the main window and adds the header, main and button panels to * it. */ private void initMainWindow() { Window window = new Window("JmxConfigGenerator GUI Tool"); VerticalLayout layout = new VerticalLayout(); layout.addComponent(headerPanel); layout.addComponent(contentPanel); // content Panel should use most of the space :) layout.setExpandRatio(contentPanel, 1); window.setContent(layout); window.getContent().setSizeFull(); window.setSizeFull(); addWindow(window); }
/** * Adds a component to a given vertical layout and applies some sizing and formatting options. * * @param verticalLayout the vertical layout * @param component the component to be added */ private void addToComponent(VerticalLayout verticalLayout, Component component) { HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setWidth(100, Unit.PERCENTAGE); Label label = new Label(component.getCaption()); label.setWidth(200, Unit.PIXELS); component.setSizeFull(); component.setCaption(null); horizontalLayout.addComponent(label); horizontalLayout.addComponent(component); horizontalLayout.setExpandRatio(component, 1.0f); verticalLayout.addComponent(horizontalLayout); }
tabComponent.setSizeFull();
@Override public Accordion.Tab addTab(String name, Component childComponent) { if (childComponent.getParent() != null && childComponent.getParent() != this) { throw new IllegalStateException("Component already has parent"); } Tab tab = new Tab(name, childComponent); this.tabs.put(name, tab); com.vaadin.ui.Component tabComponent = childComponent.unwrapComposition(com.vaadin.ui.Component.class); tabComponent.setSizeFull(); tabMapping.put(tabComponent, new ComponentDescriptor(name, childComponent)); com.vaadin.ui.Accordion.Tab tabControl = this.component.addTab(tabComponent); if (getDebugId() != null) { this.component.setTestId(tabControl, AppUI.getCurrent().getTestIdManager().getTestId(getDebugId() + "." + name)); } if (AppUI.getCurrent().isTestMode()) { this.component.setCubaId(tabControl, name); } if (frame != null) { if (childComponent instanceof BelongToFrame && ((BelongToFrame) childComponent).getFrame() == null) { ((BelongToFrame) childComponent).setFrame(frame); } else { ((FrameImplementation) frame).registerComponent(childComponent); } } childComponent.setParent(this); return tab; }
/** * Opens the requested sub view.<p> * * @param state the state * @param updateState <code>true</code> to update the state URL token */ public void openSubView(String state, boolean updateState) { if (updateState) { CmsAppWorkplaceUi.get().changeCurrentAppState(state); } Component comp = getComponentForState(state); if (comp != null) { comp.setSizeFull(); m_rootLayout.setMainContent(comp); } else { m_rootLayout.setMainContent(new Label("Malformed path, tool not availabel for path: " + state)); } updateSubNav(getSubNavEntries(state)); updateBreadCrumb(getBreadCrumbForState(state)); }
private void addContentLayout() { m_layout = new VerticalLayout(); m_layout.setSizeFull(); // Set expand ratio so that all extra space is allocated to this vertical component m_rootLayout.addComponent(m_layout); m_rootLayout.setExpandRatio(m_layout, 1); m_mapLayout = createMapLayout(); m_mapLayout.setSizeFull(); m_menuBar = new TopologyMenuBar(); m_contextMenu = new TopologyContextMenu(); updateMenu(); if(m_widgetManager.widgetCount() != 0) { updateWidgetView(m_widgetManager); }else { m_layout.addComponent(m_mapLayout); } // Set expand ratio so that extra space is not allocated to this vertical component if (m_showHeader) { m_rootLayout.addComponent(m_menuBar, 1); } else { m_rootLayout.addComponent(m_menuBar, 0); } }
private void addContentLayout() { m_layout = new VerticalLayout(); m_layout.setSizeFull(); // Set expand ratio so that all extra space is allocated to this vertical component m_rootLayout.addComponent(m_layout); m_rootLayout.setExpandRatio(m_layout, 1); m_mapLayout = createMapLayout(); m_mapLayout.setSizeFull(); m_menuBar = new TopologyMenuBar(); m_contextMenu = new TopologyContextMenu(getUI()); updateMenu(); if(m_widgetManager.widgetCount() != 0) { updateWidgetView(m_widgetManager); }else { m_layout.addComponent(m_mapLayout); } // Set expand ratio so that extra space is not allocated to this vertical component if (m_showHeader) { m_rootLayout.addComponent(m_menuBar, 1); } else { m_rootLayout.addComponent(m_menuBar, 0); } }
protected Component buildLowerPanel() { // Add main panel final VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setMargin(false); layout.setSpacing(true); final Component mainPanel = this.buildMainPanel(); mainPanel.setSizeFull(); layout.addComponent(mainPanel); layout.setComponentAlignment(mainPanel, Alignment.TOP_CENTER); layout.setExpandRatio(mainPanel, 1); // Add footer containing links (admin only) and version label final HorizontalLayout footerLayout = new HorizontalLayout(); footerLayout.setWidth("100%"); footerLayout.setSpacing(true); final Label spacer = new Label(); footerLayout.addComponent(spacer); footerLayout.setExpandRatio(spacer, 1); footerLayout.addComponent(new SizedLabel("JSimpleDB Viewer")); layout.addComponent(footerLayout); // Done return layout; }
protected Component buildLowerPanel() { // Add main panel final VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setMargin(false); layout.setSpacing(true); final Component mainPanel = this.buildMainPanel(); mainPanel.setSizeFull(); layout.addComponent(mainPanel); layout.setComponentAlignment(mainPanel, Alignment.TOP_CENTER); layout.setExpandRatio(mainPanel, 1); // Add footer containing links (admin only) and version label final HorizontalLayout footerLayout = new HorizontalLayout(); footerLayout.setWidth("100%"); footerLayout.setSpacing(true); final Label spacer = new Label(); footerLayout.addComponent(spacer); footerLayout.setExpandRatio(spacer, 1); footerLayout.addComponent(new SizedLabel("Permazen Viewer")); layout.addComponent(footerLayout); // Done return layout; }
((Component)m_fileTree).setSizeFull(); updateView();