/** * Validates the layout and returns a collection of errors. * * @since 7.1 * @param ui * The UI to validate * @return A collection of errors. An empty collection if there are no * errors. */ public static List<InvalidLayout> validateLayouts(UI ui) { List<InvalidLayout> invalidRelativeSizes = ComponentSizeValidator .validateComponentRelativeSizes(ui.getContent(), new ArrayList<>(), null); // Also check any existing subwindows if (ui.getWindows() != null) { for (Window subWindow : ui.getWindows()) { invalidRelativeSizes = ComponentSizeValidator .validateComponentRelativeSizes(subWindow.getContent(), invalidRelativeSizes, null); } } return invalidRelativeSizes; }
public void pushScreen(String viewName, ComponentContainer newView) { screenStack.push((ComponentContainer) getMainWindow().getContent()); switchScreen(viewName, newView); }
public void setWidth(int width) { if (width < 0) return; VerticalLayout innerLayout = (VerticalLayout) getMainWindow().getContent(); if (!isFull) innerLayout.setWidth(width,Sizeable.UNITS_PIXELS); this.width = width; doRememberSize(new int[] {width,height,isFull?1:0}); }
public void setHeight(int height) { if (height < 0) return; VerticalLayout innerLayout = (VerticalLayout) getMainWindow().getContent(); /*if (!isFull)*/ innerLayout.setHeight(height,Sizeable.UNITS_PIXELS); this.height = height; doRememberSize(new int[] {width,height,isFull?1:0}); }
@Override public void init() { window = new Window(); setMainWindow(window); layout = (VerticalLayout) getMainWindow().getContent(); }
public void init() { setTheme("ace"); if (!m_dependenciesResolved.get()) { final Window message = new Window("Apache ACE"); message.getContent().setSizeFull(); setMainWindow(message); Label richText = new Label("<h1>Apache ACE User Interface</h1>" + "<p>Due to missing component dependencies on the server, probably due to misconfiguration, " + "the user interface cannot be properly started. Please contact your server administrator. " + "You can retry accessing the user interface by <a href=\"?restartApplication\">following this link</a>.</p>"); richText.setContentMode(Label.CONTENT_XHTML); // TODO we might want to add some more details here as to what's // missing on the other hand, the user probably can't fix that anyway message.addComponent(richText); return; } m_mainWindow = new Window("Apache ACE"); m_mainWindow.getContent().setSizeFull(); m_mainWindow.setBorder(Window.BORDER_NONE); setMainWindow(m_mainWindow); // Authenticate the user either by showing a login window; or by another means... authenticate(); }
/** * 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); }
public void setFullSize(boolean full) { VerticalLayout innerLayout = (VerticalLayout) getMainWindow().getContent(); // innerLayout.setSizeUndefined(); if (full) { // innerLayout.setSizeFull(); innerLayout.setWidth("100%"); } else { isFull = false; innerLayout.setHeightUnits(Sizeable.UNITS_PIXELS); innerLayout.setWidthUnits(Sizeable.UNITS_PIXELS); setWidth(width); setHeight(height); } isFull = full; if (hasButtons) { bFull.setCaption(full ? " * " : " o "); //bHeightAdd.setEnabled(!full); //bHeightSub.setEnabled(!full); bWidthAdd.setEnabled(!full); bWidthSub.setEnabled(!full); } }
vl.addComponent(buttonBar); vl.addComponent(newView); final Component oldContent = window.getContent(); if (oldContent instanceof CmsBasicDialog) { List<CmsResource> infoResources = ((CmsBasicDialog)oldContent).getInfoResources();
final Window message = new Window("Apache ACE"); setMainWindow(message); message.getContent().setSizeFull(); Label richText = new Label( "<h1>Apache ACE User Interface</h1>" + main.getContent().setSizeFull();
setMainWindow(window); VerticalLayout innerLayout = (VerticalLayout) getMainWindow().getContent(); innerLayout.setHeightUnits(Sizeable.UNITS_PIXELS); innerLayout.setWidthUnits(Sizeable.UNITS_PIXELS);