Example usage for com.vaadin.ui VerticalLayout setSizeFull

List of usage examples for com.vaadin.ui VerticalLayout setSizeFull

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout setSizeFull.

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:com.lst.deploymentautomation.vaadin.core.AppLayout.java

License:Open Source License

private void initLayout() {
    addStyleName("app-layout");
    setSizeFull();//from  w  w  w .  j  a  v a  2  s  .c om

    //main page layout
    layout = new CustomLayout("page");
    layout.setSizeFull();
    setCompositionRoot(layout);

    //navigation menu
    VerticalLayout navLayout = new VerticalLayout();
    navLayout.setSizeFull();
    layout.addComponent(navLayout, "usermenu");
    navigation = new NavigationMenu();
    navigation.addStyleName("navigation-menu");
    layout.addComponent(navigation, "navigation");

    final UserInfo user = ((LspsUI) UI.getCurrent()).getUser();
    LspsUI ui = (LspsUI) UI.getCurrent();

    if (user.hasRight(HumanRights.READ_ALL_TODO) || user.hasRight(HumanRights.READ_OWN_TODO)) {
        addViewItem(navigation, TodoListView.TITLE, TodoListView.ID, FontAwesome.LIST);
    }
    /*if (user.hasRight(HumanRights.ACCESS_DOCUMENTS)) {
       addViewItem(navigation, DocumentsView.TITLE, DocumentsView.ID, FontAwesome.FILE_TEXT_O);
    }
    if (user.hasRight(EngineRights.READ_MODEL) && user.hasRight(EngineRights.CREATE_MODEL_INSTANCE)) {
       addViewItem(navigation, RunModelView.TITLE, RunModelView.ID, FontAwesome.CARET_SQUARE_O_RIGHT);
    }*/

    addNavigationCommandItem(navigation, "Initialize deployment", new NavigationMenu.OpenDocumentCommand(ui, "",
            "'deployment-automation-ui'::InitiateDeploymentDoc", null), FontAwesome.PLAY);
    addNavigationCommandItem(navigation, "Deployments list",
            new NavigationMenu.OpenDocumentCommand(ui, "", "'deployment-automation-ui'::DeploymentsList", null),
            FontAwesome.LIST_OL);

    //user menu
    userMenu = new NavigationMenu();
    userMenu.addStyleName("navigation-menu");
    navLayout.addComponent(userMenu);

    addViewItem(userMenu, SettingsView.TITLE, SettingsView.ID, FontAwesome.COG);

    NavigationCommand logoutCmd = new LogoutCommand((LspsUI) getUI());
    MenuItem logout = addNavigationCommandItem(userMenu, logoutCmd.getTitle(), logoutCmd,
            FontAwesome.POWER_OFF);
    String fullName = user.getPerson().getFullName();
    logout.setDescription(ui.getMessage("nav.logout", fullName));

    boolean collapsed = user.getSettingBoolean("collapsedMenu", false);

    if (collapsed == true) {
        UI.getCurrent().addStyleName("l-menu-collapsed");
    }

    Button button = new Button("");
    button.addStyleName("l-menu-expander");
    button.addStyleName("link");
    navLayout.addComponent(button);
    button.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            boolean collapsed = user.getSettingBoolean("collapsedMenu", false);
            if (collapsed) {
                UI.getCurrent().removeStyleName("l-menu-collapsed");
            } else {
                UI.getCurrent().addStyleName("l-menu-collapsed");
            }
            user.setSetting("collapsedMenu", !collapsed);
        }
    });
}

From source file:com.lst.deploymentautomation.vaadin.page.TodoView.java

License:Open Source License

@Override
protected void setContent(Component content) {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.addComponent(annotations);//  w ww  .j  a  v  a 2s.  co  m
    layout.addComponent(content);
    layout.setExpandRatio(content, 1);
    super.setContent(layout);
}

From source file:com.lst.deploymentautomation.vaadin.popup.TodoAnnotation.java

License:Open Source License

@Override
public void attach() {
    super.attach();

    LspsUI ui = (LspsUI) getUI();/*from   w w  w  .j av  a  2  s. c om*/
    setCaption(ui.getMessage("todo.annotationTitle"));

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    setContent(layout);

    Label help = new Label(ui.getMessage("todo.annotationHelp"));
    help.setStyleName("form-help");
    layout.addComponent(help);

    priorityField = new TextField(ui.getMessage("todo.priority"), priority);
    //TODO forbid negative priorities
    priorityField.setConverter(Integer.class);
    priorityField.setConversionError(ui.getMessage("app.invalidValueMessage"));
    priorityField.setNullRepresentation("");
    priorityField.setNullSettingAllowed(true);
    layout.addComponent(priorityField);

    TextArea notesField = new TextArea(ui.getMessage("todo.notes"), notes);
    notesField.setMaxLength(1024);
    notesField.setNullRepresentation("");
    priorityField.setNullSettingAllowed(true);
    notesField.setSizeFull();
    layout.addComponent(notesField);
    layout.setExpandRatio(notesField, 1);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    layout.addComponent(buttons);

    @SuppressWarnings("serial")
    Button submitButton = new Button(ui.getMessage("action.annotate"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            annotate();
        }
    });
    buttons.addComponent(submitButton);

    @SuppressWarnings("serial")
    Button cancelButton = new Button(ui.getMessage("action.cancel"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    buttons.addComponent(cancelButton);
}

From source file:com.lst.deploymentautomation.vaadin.popup.TodoDelegation.java

License:Open Source License

@Override
public void attach() {
    super.attach();

    LspsUI ui = (LspsUI) getUI();//w w w  .ja  v a  2s.c  o m
    setCaption(ui.getMessage("todo.delegationTitle"));

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    setContent(layout);

    Label help = new Label(ui.getMessage("todo.delegationHelp"));
    help.setStyleName("form-help");
    layout.addComponent(help);

    Collection<Person> allUsers = new ArrayList<Person>(
            personService.findPersons(new PersonCriteria()).getData());
    Set<Person> substitutes = ui.getUser().getPerson().getDirectSubstitutes();
    Set<String> substitutesIds = new HashSet<String>();
    for (Person p : substitutes) {
        substitutesIds.add(p.getId());
    }

    delegates = new OptionGroup(ui.getMessage("todo.delegates"));
    delegates.setMultiSelect(true);
    delegates.addStyleName("ui-spacing");
    delegates.setRequired(true);
    delegates.setSizeFull();
    for (Person p : allUsers) {
        delegates.addItem(p.getId());
        delegates.setItemCaption(p.getId(), p.getFullName());
    }
    delegates.setValue(substitutesIds);
    layout.addComponent(delegates);
    layout.setExpandRatio(delegates, 1);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    layout.addComponent(buttons);

    @SuppressWarnings("serial")
    Button delegateButton = new Button(ui.getMessage("action.delegate"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            delegate();
        }
    });
    buttons.addComponent(delegateButton);

    @SuppressWarnings("serial")
    Button cancelButton = new Button(ui.getMessage("action.cancel"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    buttons.addComponent(cancelButton);
}

From source file:com.lst.deploymentautomation.vaadin.popup.TodoEscalation.java

License:Open Source License

@Override
public void attach() {
    super.attach();

    LspsUI ui = (LspsUI) getUI();/*from w w  w  .ja  v  a2s  .co  m*/
    setCaption(ui.getMessage("todo.escalationTitle"));

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    setContent(layout);

    Label help = new Label(ui.getMessage("todo.escalationHelp"));
    help.setStyleName("form-help");
    layout.addComponent(help);

    reason = new TextArea(ui.getMessage("todo.escalationReason"));
    reason.setMaxLength(1024);
    reason.setRequired(true);
    reason.setSizeFull();
    layout.addComponent(reason);
    layout.setExpandRatio(reason, 1);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    layout.addComponent(buttons);

    @SuppressWarnings("serial")
    Button submitButton = new Button(ui.getMessage("action.escalate"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            escalate();
        }
    });
    buttons.addComponent(submitButton);

    @SuppressWarnings("serial")
    Button cancelButton = new Button(ui.getMessage("action.cancel"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    buttons.addComponent(cancelButton);
}

From source file:com.lst.deploymentautomation.vaadin.popup.TodoRejection.java

License:Open Source License

@Override
public void attach() {
    super.attach();

    LspsUI ui = (LspsUI) getUI();/*w  w  w . j av  a  2s.co m*/
    setCaption(ui.getMessage("todo.rejectionTitle"));

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    setContent(layout);

    Label help = new Label(ui.getMessage("todo.rejectionHelp"));
    help.setStyleName("form-help");
    layout.addComponent(help);

    reason = new TextArea(ui.getMessage("todo.rejectionReason"));
    reason.setMaxLength(1024);
    reason.setRequired(true);
    reason.setSizeFull();
    layout.addComponent(reason);
    layout.setExpandRatio(reason, 1);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    layout.addComponent(buttons);

    @SuppressWarnings("serial")
    Button rejectButton = new Button(ui.getMessage("action.reject"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            reject();
        }
    });
    buttons.addComponent(rejectButton);

    @SuppressWarnings("serial")
    Button cancelButton = new Button(ui.getMessage("action.cancel"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    buttons.addComponent(cancelButton);
}

From source file:com.m4gik.views.component.LicenseScreen.java

/**
 * Method builds license layout with texts.
 * /*from   w w  w . j  a  va  2s . co  m*/
 * @return The VerticalLayout with texts.
 * 
 * @see com.m4gik.views.component.ViewScreen#build()
 */
@Override
public Layout build() {
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setCaption("Welcome");

    Panel welcome = new Panel("License");
    welcome.setSizeFull();
    welcome.addStyleName(Runo.PANEL_LIGHT);
    layout.addComponent(welcome);
    layout.setExpandRatio(welcome, 1);

    CssLayout margin = new CssLayout();
    // margin.setMargin(true);
    margin.setWidth("100%");
    welcome.setContent(margin);

    Label title = new Label("Music player");
    title.addStyleName(Runo.LABEL_H1);
    // margin.addComponent(title);

    HorizontalLayout texts = new HorizontalLayout();
    texts.setSpacing(true);
    texts.setWidth("100%");
    margin.addComponent(texts);

    addText(texts,
            "<h3>Everything You Need Is Here</h3>" + "<p>Everything you see inside this application...</p>",
            null);
    addText(texts,
            "<h3>Everything You Need Is Here</h3>" + "<p>Everything you see inside this application...</p>",
            null);
    addText(texts,
            "<h3>Everything You Need Is Here</h3>" + "<p>Everything you see inside this application...</p>",
            null);

    layout.addComponent(new Label("<hr />", Label.CONTENT_XHTML));

    return layout;
}

From source file:com.m4gik.views.MainView.java

/**
 * Initial layout for {@link MainView}/*from  w  w  w .  ja  v  a2s.c  om*/
 */
private void initLayout() {

    VerticalLayout root = new VerticalLayout();
    root.setMargin(true);
    root.setSizeFull();

    VerticalLayout main = new VerticalLayout();
    main.setSizeFull();
    main.addComponent(root);

    playerLayout = new VerticalLayout();
    main.addComponent(playerLayout);

    if (MusicPlayerPanel.isRunning()) {
        MusicPlayerPanel.setPlayerLayout(playerLayout);
        MusicPlayerPanel.runDefaultSetup();
    }

    setContent(main);

    addTitle(root);
    addSpace(root);
    addSplitPanel(root);

    // setSizeFull();
    // VerticalLayout layout = new VerticalLayout();
    // layout.setSpacing(true);
    // layout.setMargin(true);
    //
    // HorizontalLayout usernameLayout = new HorizontalLayout();
    // usernameLayout.setSpacing(true);
    // usernameLayout.addComponent(new Label("Username:"));
    // usernameLayout.addComponent(usernameLabel);
    //
    // //HorizontalLayout userRolesLayout = new HorizontalLayout();
    // //userRolesLayout.setSpacing(true);
    // //userRolesLayout.addComponent(new Label("Roles:"));
    // //userRolesLayout.addComponent(rolesLabel);
    //
    // layout.addComponent(usernameLayout);
    // //addComponent(userRolesLayout);
    //
    // Link roleUserView = new
    // Link("Role \"user\" View (disabled, if user doesn't have access)",
    // new ExternalResource("#!" + RoleUserView.NAME));
    // Link roleAdminView = new
    // Link("Role \"admin\" View (disabled, if user doesn't have access)",
    // new ExternalResource("#!" + RoleAdminView.NAME));
    // Link authenticatedView = new
    // Link("@RequiresAuthentication View (disabled, if user doesn't have access)",
    // new ExternalResource("#!" + AuthenticatedView.NAME));
    // Link guestView = new
    // Link("@RequiresGuest View (disabled, if user doesn't have access)",
    // new ExternalResource("#!" + GuestView.NAME));
    // Link userView = new
    // Link("@RequiresUser View (disabled, if user doesn't have access)",
    // new ExternalResource("#!" + UserView.NAME));
    //
    // roleUserView.setEnabled(ShiroSecurityNavigator.hasAccess(RoleUserView.class));
    // roleAdminView.setEnabled(ShiroSecurityNavigator.hasAccess(RoleAdminView.class));
    // authenticatedView.setEnabled(ShiroSecurityNavigator.hasAccess(AuthenticatedView.class));
    // guestView.setEnabled(ShiroSecurityNavigator.hasAccess(GuestView.class));
    // userView.setEnabled(ShiroSecurityNavigator.hasAccess(UserView.class));
    //
    // layout.addComponent(roleUserView);
    // layout.addComponent(roleAdminView);
    // layout.addComponent(authenticatedView);
    // layout.addComponent(guestView);
    // layout.addComponent(userView);
    // layout.addComponent(new
    // Link("Role \"admin\" View (throw exception, if user doesn't have access)",
    // new ExternalResource("#!" + RoleAdminView.NAME)));
    //
    // layout.addComponent(new Link("Logout", new
    // ExternalResource("/logout/")));
    //
    // setContent(layout);

}

From source file:com.mcparland.john.vaadin_mvn_arch.samples.crud.SampleCrudView.java

License:Apache License

public SampleCrudView() {
    setSizeFull();/*from w w  w  .  j a  v a 2  s.c om*/
    addStyleName("crud-view");
    HorizontalLayout topLayout = createTopBar();

    table = new ProductTable();
    table.addValueChangeListener(new ValueChangeListener() {
        /**
         * The serialVersionUID.
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            viewLogic.rowSelected(table.getValue());
        }
    });

    form = new ProductForm(viewLogic);
    form.setCategories(DataService.get().getAllCategories());

    VerticalLayout barAndTableLayout = new VerticalLayout();
    barAndTableLayout.addComponent(topLayout);
    barAndTableLayout.addComponent(table);
    barAndTableLayout.setMargin(true);
    barAndTableLayout.setSpacing(true);
    barAndTableLayout.setSizeFull();
    barAndTableLayout.setExpandRatio(table, 1);
    barAndTableLayout.setStyleName("crud-main-layout");

    addComponent(barAndTableLayout);
    addComponent(form);

    viewLogic.init();
}

From source file:com.mechanicshop.components.MaintenanceLayout.java

private void buildLayout() {
    HorizontalLayout layoutTitle = new HorizontalLayout();
    layoutTitle.setSizeUndefined();/*  www  . j a  v  a  2 s .c  o m*/
    layoutTitle.setWidth("100%");
    layoutTitle.setSpacing(false);
    layoutTitle.setMargin(false);
    titleLabel.addStyleName(ValoTheme.LABEL_H2);
    titleLabel.addStyleName(ValoTheme.LABEL_COLORED);
    titleLabel.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    titleLabel.addStyleName(ValoTheme.LABEL_BOLD);
    titleLabel.setSizeUndefined();

    layoutTitle.addComponent(titleLabel);
    layoutTitle.setComponentAlignment(titleLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout layoutTable = new VerticalLayout();

    layoutTable.setSizeFull();

    layoutTable.setSpacing(true);
    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    layoutButtons.setSpacing(true);
    layoutButtons.setSizeUndefined();
    Button passwordBtn = new Button("Edit Password");
    passwordBtn.addClickListener(passwordListener);
    passwordBtn.setImmediate(true);
    passwordBtn.setIcon(FontAwesome.EDIT);
    passwordBtn.setStyleName(ValoTheme.BUTTON_TINY);
    Button media1Btn = new Button("Media 1 Default Text");
    media1Btn.setStyleName(ValoTheme.BUTTON_TINY);
    media1Btn.setImmediate(true);
    media1Btn.setIcon(FontAwesome.EDIT);
    media1Btn.addClickListener(media1Listener);
    Button media2Btn = new Button("Media 2 Default Text");
    media2Btn.setStyleName(ValoTheme.BUTTON_TINY);
    media2Btn.setImmediate(true);
    media2Btn.setIcon(FontAwesome.EDIT);
    media2Btn.addClickListener(media2Listener);
    layoutButtons.addComponents(passwordBtn, media1Btn, media2Btn);

    layoutButtons.setComponentAlignment(passwordBtn, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(media1Btn, Alignment.MIDDLE_LEFT);
    layoutButtons.setComponentAlignment(media2Btn, Alignment.MIDDLE_LEFT);

    addComponent(layoutTitle);
    addComponent(layoutTable);
    layoutTable.addComponent(layoutButtons);
    layoutTable.addComponent(table);
    layoutTable.setComponentAlignment(table, Alignment.TOP_CENTER);
    layoutTable.setExpandRatio(table, 3);
    setComponentAlignment(layoutTitle, Alignment.TOP_CENTER);
    setComponentAlignment(layoutTable, Alignment.TOP_CENTER);
    setExpandRatio(layoutTable, 3);
    setSpacing(true);
    setMargin(true);

}