Example usage for com.vaadin.ui VerticalLayout setWidth

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

Introduction

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

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

From source file:nl.amc.biolab.nsg.display.component.ProcessingStatusForm.java

License:Open Source License

private VerticalLayout makeSubmissionStatusLayout(List<SubmissionIO> submissionIOinputs,
        final Processing processing, final VaadinTestApplication app) {
    StringBuffer statusValue = new StringBuffer();
    VerticalLayout statusLayout = new VerticalLayout();
    statusLayout.setWidth("100%");
    final Submission submission = submissionIOinputs.get(0).getSubmission(); // There is at least one input!
    //get status information
    String submissionStatus = submission.getLastStatus().getValue();
    logger.info("Status is " + submissionStatus);
    Date lastUpdateDate = processing.getDate();
    final Iterator<Status> iterator = submission.getStatuses().iterator();
    Status st = null;//from   www  . j  ava  2  s  .c  o  m
    while (iterator.hasNext()) {
        st = iterator.next();
    }
    if (st != null) {
        lastUpdateDate = st.getTimestamp();
    }
    String submissionUpdateDate = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(lastUpdateDate); // when the status is last updated

    nl.amc.biolab.datamodel.objects.Error error = null;
    List<nl.amc.biolab.datamodel.objects.Error> errors = submissionIOinputs.get(0).getSubmission().getErrors();

    if (submissionIOinputs.get(0).getSubmission().getErrors() != null
            && submissionIOinputs.get(0).getSubmission().getErrors().size() > 0) {
        error = errors.get(errors.size() - 1);
    }

    if (error != null) {
        logger.info("Error message is " + error.getMessage());
    }

    statusValue.append(getStatus(submissionStatus, error, userDataService.isNSGAdmin())).append("\n");

    logger.info(statusValue);

    createSubmissionButtons(app, submissionIOinputs.get(0), error);

    Label status = new Label(statusValue.toString(), Label.CONTENT_XHTML);
    status.setDescription("Last updated on " + submissionUpdateDate);
    status.setWidth("80%");

    String aborted = "Aborted";

    if (aborted.equals(submissionStatus)) {
        statusLayout.addComponent(status);
        statusLayout.addComponent(remarksButton);
    } else {
        statusLayout.addComponent(status);
    }

    return statusLayout;
}

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 ww w  .  jav a 2s  . c  o m*/

    // 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:nl.kpmg.lcm.ui.view.administration.TasksPanel.java

License:Apache License

public TasksPanel() {
    Panel panel = new Panel();
    VerticalLayout root = new VerticalLayout();

    Panel schedulePanel = new Panel();
    VerticalLayout schedulePanelLayout = new VerticalLayout();
    scheduleTable = new Table();
    scheduleTable.setWidth("100%");
    scheduleTable.setHeight("300px");
    scheduleTable.addContainerProperty("Name", String.class, null);
    scheduleTable.addContainerProperty("Cron", String.class, null);
    scheduleTable.addContainerProperty("Job", String.class, null);
    scheduleTable.addContainerProperty("Target", String.class, null);
    Label scheduleLabel = new Label("Schedule");
    scheduleLabel.setStyleName("v-label-h2");
    schedulePanelLayout.addComponent(scheduleLabel);
    schedulePanelLayout.addComponent(scheduleTable);
    schedulePanel.setContent(schedulePanelLayout);

    Panel tasksPanel = new Panel();
    VerticalLayout tasksPanelLayout = new VerticalLayout();
    tasksTable = new Table();
    tasksTable.setWidth("100%");
    tasksTable.addContainerProperty("Job", String.class, null);
    tasksTable.addContainerProperty("Target", String.class, null);
    tasksTable.addContainerProperty("Start", Date.class, null);
    tasksTable.addContainerProperty("End", Date.class, null);
    tasksTable.addContainerProperty("Status", String.class, null);
    Label tasksLabel = new Label("Tasks");
    tasksLabel.setStyleName("v-label-h2");
    tasksPanelLayout.addComponent(tasksLabel);
    tasksPanelLayout.addComponent(tasksTable);
    tasksPanel.setContent(tasksPanelLayout);

    root.addComponent(schedulePanel);/* ww  w  .j  av  a 2s  . c  o m*/
    root.addComponent(tasksPanel);

    root.setSpacing(true);
    root.setMargin(true);
    root.setWidth("100%");

    panel.setContent(root);

    setCompositionRoot(panel);
}

From source file:nl.kpmg.lcm.ui.view.MetadataOverviewViewImpl.java

License:Apache License

/**
 * Builds the interface.//from  w w  w  .j a  v  a  2 s . c o m
 */
@PostConstruct
public final void init() {
    final VerticalLayout root = new VerticalLayout();

    createButton.addClickListener(this);
    refreshButton.addClickListener(this);

    HorizontalLayout menubar = new HorizontalLayout();
    createButton.addStyleName("margin-10");
    refreshButton.addStyleName("margin-10");
    menubar.addComponent(createButton);
    menubar.addComponent(refreshButton);

    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Location", ArrayList.class, null);
    table.addContainerProperty("Actions", HorizontalLayout.class, null);

    table.setWidth("100%");
    table.setHeight("100%");

    root.addComponent(menubar);
    root.addComponent(table);

    root.setSpacing(true);
    root.setMargin(true);
    root.setWidth("100%");
    root.setExpandRatio(table, 1f);

    addComponent(root);
}

From source file:nl.kpmg.lcm.ui.view.transfer.SchedulePanel.java

License:Apache License

private HorizontalLayout initDataLayout() throws UnsupportedOperationException {
    VerticalLayout tableLayout = new VerticalLayout();
    remoteMetadataTable = initRemoteMetadataTable();
    tableLayout.addComponent(remoteMetadataTable);
    tableLayout.addStyleName("padding-right-20");

    VerticalLayout detailsLayout = new VerticalLayout();
    detailsLayout.setWidth("100%");
    detailsLayout.setHeight("100%");

    HorizontalLayout dataLayout = new HorizontalLayout();
    dataLayout.addComponent(tableLayout);
    dataLayout.setWidth("100%");

    return dataLayout;
}

From source file:no.uib.probe.mnpc_2017.view.ApplicationLayout.java

public ApplicationLayout() {
    this.setWidth("100%");
    this.setHeightUndefined();
    //        this.setStyleName(Reindeer.LAYOUT_WHITE);
    this.setMargin(false);
    this.setSpacing(true);

    VerticalLayout headerLayout = new VerticalLayout();
    headerLayout.setWidth("100%");
    headerLayout.setHeight("77px");
    this.addComponent(headerLayout);

    Panel mainBodyPanel = new Panel();
    //        headerLayout.setStyleName(Reindeer.LAYOUT_BLUE);

    HorizontalLayout topLayoutContainer = new HorizontalLayout();
    headerLayout.addComponent(topLayoutContainer);
    headerLayout.setComponentAlignment(topLayoutContainer, Alignment.MIDDLE_CENTER);
    topLayoutContainer.setWidthUndefined();
    topLayoutContainer.setHeight("100%");

    VerticalLayout logoLayout = new VerticalLayout();
    logoLayout.setWidth("200px");
    logoLayout.setHeight("100%");
    logoLayout.setStyleName("starlogo");
    logoLayout.setMargin(new MarginInfo(false, true, false, false));

    Label title = new Label("NPC 2017");
    logoLayout.addComponent(title);//from   www .jav a 2 s. c o m

    topLayoutContainer.addComponent(logoLayout);
    topLayoutContainer.setComponentAlignment(logoLayout, Alignment.MIDDLE_RIGHT);

    HorizontalLayout mainMenuContainer = new HorizontalLayout();
    mainMenuContainer.setWidth("780px");
    topLayoutContainer.addComponent(mainMenuContainer);
    topLayoutContainer.setComponentAlignment(mainMenuContainer, Alignment.MIDDLE_RIGHT);

    VerticalLayout layoutI = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Home", layoutI));

    VerticalLayout layoutII = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Programme", layoutII));

    VerticalLayout layoutIII = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Practical Information", layoutIII));

    VerticalLayout layoutIV = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Exhibition & Sponsorship", layoutIV));

    VerticalLayout layoutV = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Registration", layoutV));

    VerticalLayout layoutVI = new VerticalLayout();
    mainMenuContainer.addComponent(generateMenuBtn("Contact", layoutVI));

}

From source file:org.activiti.administrator.ui.LoginView.java

License:Apache License

@SuppressWarnings("serial")
public LoginView(AdminApp application) {

    // Set application reference
    this.app = application;

    // Init window caption
    app.getMainWindow().setCaption(app.getMessage(Messages.Title));

    // Set style/*from w ww.  ja v a 2  s.  c o m*/
    setStyleName(Reindeer.LAYOUT_WHITE);

    // Set layout to full size
    setSizeFull();

    // Create main layout
    VerticalLayout mainLayout = new VerticalLayout();

    // Add layout styles
    mainLayout.setStyleName(Reindeer.LAYOUT_WHITE);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.setMargin(false);
    mainLayout.setSpacing(false);

    // Add layout
    addComponent(mainLayout);
    setComponentAlignment(mainLayout, Alignment.TOP_LEFT);

    // Add field and button layout
    VerticalLayout buttonLayout = new VerticalLayout();
    buttonLayout.setSpacing(true);
    buttonLayout.setMargin(true);
    buttonLayout.setWidth("200px");
    buttonLayout.setStyleName("login-form");

    // Add username field
    username = new TextField(app.getMessage(Messages.Username));
    username.setWidth("100%");
    buttonLayout.addComponent(username);

    // Add password field
    password = new PasswordField(app.getMessage(Messages.Password));
    password.setWidth("100%");
    buttonLayout.addComponent(password);

    // Add Login button
    buttonLayout.addComponent(login);
    buttonLayout.setComponentAlignment(login, Alignment.BOTTOM_LEFT);

    // Add button layout
    mainLayout.addComponent(buttonLayout);

    // Add footer text
    Label footerText = new Label(app.getMessage(Messages.Footer));
    footerText.setSizeUndefined();
    footerText.setStyleName(Reindeer.LABEL_SMALL);
    footerText.addStyleName("footer");
    mainLayout.addComponent(footerText);
    mainLayout.setComponentAlignment(footerText, Alignment.BOTTOM_CENTER);

    // Set focus to this component
    username.focus();

    // Add shortcut to login button
    login.setClickShortcut(KeyCode.ENTER);

    login.addListener(new Button.ClickListener() {

        public void buttonClick(Button.ClickEvent event) {
            try {

                // Athenticate the user
                authenticate((String) username.getValue(), (String) password.getValue());

                // Switch to the main view
                app.switchView(MainView.class.getName(), new MainView(app));

            } catch (Exception e) {
                getWindow().showNotification(e.toString());
            }
        }
    });

}

From source file:org.apache.tamaya.ui.views.ConfigView.java

License:Apache License

private Component createRuntimeTab() {
    VerticalLayout tabLayout = new VerticalLayout();
    TextArea runtimeProps = new TextArea();
    runtimeProps.setRows(25);//  w ww . ja v a 2  s. c  o m
    StringBuilder b = new StringBuilder();
    b.setLength(0);
    b.append("Available Processors : ").append(Runtime.getRuntime().availableProcessors()).append('\n');
    b.append("Free Memory          : ").append(Runtime.getRuntime().freeMemory()).append('\n');
    b.append("Max Memory           : ").append(Runtime.getRuntime().maxMemory()).append('\n');
    b.append("Total Memory         : ").append(Runtime.getRuntime().totalMemory()).append('\n');
    b.append("Default Locale       : ").append(Locale.getDefault()).append('\n');
    runtimeProps.setValue(b.toString());
    runtimeProps.setReadOnly(true);
    runtimeProps.setHeight("100%");
    runtimeProps.setWidth("100%");
    tabLayout.addComponents(runtimeProps);
    tabLayout.setHeight("100%");
    tabLayout.setWidth("100%");
    return tabLayout;
}

From source file:org.apache.tamaya.ui.views.ConfigView.java

License:Apache License

private Component createSysPropsTab() {
    VerticalLayout tabLayout = new VerticalLayout();
    TextArea sysProps = new TextArea();
    sysProps.setRows(25);// w w w.jav  a2 s.c  om
    StringBuilder b = new StringBuilder();
    for (Map.Entry<Object, Object> en : new TreeMap<>(System.getProperties()).entrySet()) {
        b.append(en.getKey()).append("=").append(en.getValue()).append('\n');
    }
    sysProps.setValue(b.toString());
    sysProps.setReadOnly(true);
    sysProps.setHeight("100%");
    sysProps.setWidth("100%");
    tabLayout.addComponents(sysProps);
    tabLayout.setHeight("100%");
    tabLayout.setWidth("100%");
    return tabLayout;
}

From source file:org.apache.tamaya.ui.views.ConfigView.java

License:Apache License

private Component createEnvTab() {
    VerticalLayout tabLayout = new VerticalLayout();
    TextArea envProps = new TextArea();
    StringBuilder b = new StringBuilder();
    envProps.setRows(25);//from w ww  . jav  a  2 s .co  m
    for (Map.Entry<String, String> en : new TreeMap<>(System.getenv()).entrySet()) {
        b.append(en.getKey()).append("=").append(en.getValue()).append('\n');
    }
    envProps.setValue(b.toString());
    envProps.setReadOnly(true);
    envProps.setHeight("100%");
    envProps.setWidth("100%");
    tabLayout.addComponents(envProps);
    tabLayout.setHeight("100%");
    tabLayout.setWidth("100%");
    return tabLayout;
}