Example usage for com.vaadin.ui CustomLayout CustomLayout

List of usage examples for com.vaadin.ui CustomLayout CustomLayout

Introduction

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

Prototype

public CustomLayout(String template) 

Source Link

Document

Constructor for custom layout with given template name.

Usage

From source file:metacom.sprut7.AllPu.java

private void BuildMain() {
    J2EEConnectionPool connectionPool = new J2EEConnectionPool(linkPool);
    FreeformQuery dlg = new FreeformQuery("select * from GSG_WEB_VIEW_ALL_PU", connectionPool, "id");
    dlg.setDelegate(new ViewDelegate("GSG_WEB_VIEW_ALL_PU"));
    try {/*  w  ww.  j a v  a  2  s . com*/
        puContainer = new SQLContainer(dlg);
    } catch (SQLException ex) {
        Logger.getLogger(LispTuWindow.class.getName()).log(Level.SEVERE, null, ex);
    }
    puContainer.addContainerFilter(new Compare.Equal("ID_PLAT", idplat)); //    

    pan.setContent(null);
    StringBuffer output = new StringBuffer(110);
    output.append(
            "<table bgcolor=\"#F0FFFF\" border=\"1\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\">");
    output.append("<tbody>");
    output.append("<tr align=\"center\" bgcolor=\"#ADD8E6\">");
    //        output.append(" <td rowspan=\"2\"> .</td>");
    output.append(" <td> .</td>");
    output.append(" <td>  </td>");
    output.append(" <td>?  </td>");
    output.append(" <td>  </td>");
    output.append(" <td>? ?.</td>");
    output.append(" <td> ?. .</td>");
    output.append(" <td> ?? ?. .</td>");
    output.append(" <td> ?</td>");
    output.append(" <td> ?</td>");
    output.append(" <td>?</td>");
    output.append("</tr>");
    String ldate1;
    String lldate1;
    String ldate2;
    String lldate2;
    for (int i = 0; i < puContainer.size(); i++) {
        Object id = puContainer.getIdByIndex(i);
        Item item = puContainer.getItem(id);
        //         if (item.getItemProperty("ID") != null){;}

        if (i == 1) {
            output.append("<tr align=\"left\"  bgcolor=\"#FFFAFA\">");
        } else {
            output.append("<tr align=\"left\">");
        }
        output.append(" <td align=\"left\">" + item.getItemProperty("ID").getValue().toString() + "</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("ZAVNO").getValue().toString() + "</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("NAMETU").getValue().toString() + "</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("N_TYPS").getValue().toString() + "</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("KTR").getValue().toString() + "</td>");
        ldate1 = (String) item.getItemProperty("DATE_GOS_STR").getValue();
        lldate1 = ldate1 == null ? "" : ldate1;
        output.append(" <td align=\"left\">" + lldate1 + "</td>");
        ldate2 = (String) item.getItemProperty("DATE_END_GOS_STR").getValue();
        lldate2 = ldate2 == null ? "" : ldate2;
        output.append(" <td align=\"left\">" + lldate2 + "</td>");
        if (item.getItemProperty("DATE_UST").getValue() == null) {
            output.append(" <td></td>");
        } else {
            output.append(" <td align=\"center\">" + df.format(item.getItemProperty("DATE_UST").getValue())
                    + "</td>");
        }
        //            output.append(" <td align=\"left\">"+item.getItemProperty("DATE_UST").getValue().toString()+"</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("PERIOD_TEST_STR").getValue().toString()
                + "</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("ZNACHN").getValue().toString() + "</td>");
        //            GenDebet(output, e);
        //            GenKredit(output, e);
        output.append("</tr>");

    }
    puContainer.removeAllItems();

    output.append("</tbody></table>");
    try {
        CustomLayout custom = new CustomLayout(new ByteArrayInputStream(output.toString().getBytes("UTF-8")));
        pan.setContent(custom);
    } catch (IOException ex) {
        Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex);
    }
    pan.setImmediate(true);

}

From source file:metacom.sprut7.HistoryNalNak.java

public void refresh() {
    pan.setContent(null);//from w ww .j a  v a  2  s  . c  o  m

    StringBuffer output = new StringBuffer(110);
    output.append(
            "<table bgcolor=\"#F0FFFF\" border=\"1\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\">");
    output.append("<tbody>");
    output.append("<tr align=\"center\" bgcolor=\"#ADD8E6\">");
    output.append(" <td> ..</td>");
    output.append(" <td> ??</td>");
    output.append(" <td width=\"80\"> ?</td>");
    output.append(" <td ></td>");
    output.append(" <td >?, </td>");
    output.append(" <td >?, </td>");
    output.append(" <td >? ? ?, </td>");
    output.append(" <td >? ?</td>");
    output.append(" <td >??</td>");
    output.append("</tr>");

    J2EEConnectionPool connectionPool = new J2EEConnectionPool(linkPool);
    FreeformQuery dlg = new FreeformQuery("select * from GSG_WEB_HIST_NN", connectionPool, "nompp");
    dlg.setDelegate(new ViewDelegate("GSG_WEB_HIST_NN"));
    SQLContainer container = null;
    try {
        container = new SQLContainer(dlg);
    } catch (SQLException ex) {
        Logger.getLogger(LispTuWindow.class.getName()).log(Level.SEVERE, null, ex);
    }
    container.addContainerFilter(new Compare.Equal("ID_PLAT", idplat)); //    
    container.addContainerFilter(new Compare.GreaterOrEqual("YR", year1)); //    
    container.addContainerFilter(new Compare.LessOrEqual("YR", year2)); //    
    int ii = 0;
    Integer oldYr = 0;
    Integer yr;
    for (int i = 0; i < container.size(); i++) {
        Object id = container.getIdByIndex(i);
        Item item = container.getItem(id);
        yr = (Integer) item.getItemProperty("YR").getValue();
        if (oldYr.intValue() != yr.intValue()) {
            output.append("<tr align=\"center\">");
            output.append(" <td colspan=\"9\" bgcolor=\"#ADD8E6\">" + yr.toString() + " </td>");
            output.append("</tr>");
            oldYr = yr;
        }
        if (ii == 1) {
            output.append("<tr align=\"left\"  bgcolor=\"#FFFAFA\">");
        } else {
            output.append("<tr align=\"left\">");
        }

        output.append(" <td align=\"left\">" + item.getItemProperty("NOMPP").getValue().toString() + "</td>");
        output.append(
                " <td align=\"center\">" + item.getItemProperty("NOMNAL").getValue().toString() + "</td>");
        if (item.getItemProperty("DATVIP").getValue() == null) {
            output.append(" <td></td>");
        } else {
            output.append(
                    " <td align=\"center\">" + df.format(item.getItemProperty("DATVIP").getValue()) + "</td>");
        }
        output.append(" <td align=\"left\">" + item.getItemProperty("VIDANA").getValue().toString() + "</td>");
        output.append(
                " <td align=\"right\">" + item.getItemProperty("SUM_BAZ").getValue().toString() + "</td>");
        output.append(
                " <td align=\"right\">" + item.getItemProperty("SUM_NDS").getValue().toString() + "</td>");
        output.append(
                " <td align=\"right\">" + item.getItemProperty("SUM_ALL").getValue().toString() + "</td>");
        output.append(
                " <td align=\"left\">" + item.getItemProperty("NAL_CORR").getValue().toString() + "</td>");
        output.append(" <td align=\"left\">" + item.getItemProperty("PRIM").getValue().toString() + "</td>");
        ii = ii == 0 ? 1 : 0;
    }

    output.append("</tbody></table>");

    try {
        CustomLayout custom = new CustomLayout(new ByteArrayInputStream(output.toString().getBytes("UTF-8")));
        pan.setContent(custom);
    } catch (IOException ex) {
        Logger.getLogger(HistoryNalNak.class.getName()).log(Level.SEVERE, null, ex);
    }

    pan.setImmediate(true);

}

From source file:module.pandabox.presentation.PandaBox.java

License:Open Source License

private void showWelcomeScreen() {
    CustomLayout welcome = new CustomLayout("welcome");
    welcome.setSizeFull();
    root.setSecondComponent(welcome);
}

From source file:org.activiti.administrator.AdminApp.java

License:Apache License

@Override
public void init() {

    // Set theme/* ww w .jav a2  s  . co  m*/
    setTheme(Consts.THEME);

    // Set default locale
    setLocale(new Locale("en"));

    // Init resource bundle
    final ResourceBundle i18n = ResourceBundle.getBundle(Messages.class.getName(), getLocale());

    // Add title
    mainWindow = new Window(i18n.getString(Messages.AppTitle));

    // Set window to full size
    mainWindow.setSizeFull();

    // Set as main window
    setMainWindow(mainWindow);

    // Create main layout
    mainLayout = new CustomLayout(Consts.THEME);

    // Add styles
    mainLayout.addStyleName(Reindeer.LAYOUT_WHITE);
    mainLayout.setSizeFull();

    // Add layout to main window
    mainWindow.setContent(mainLayout);

    // Add window to view manager
    viewManager = new ViewManager(mainWindow);

    // Switch to the login screen
    switchView(LoginView.class.getName(), new LoginView(this));

}

From source file:org.activiti.kickstart.KickStartApplication.java

License:Apache License

protected void initMainWindow() {

    Window mainWindow = new Window(TITLE);
    setMainWindow(mainWindow);/*from   w  ww. jav  a 2 s  . co  m*/
    Panel p = new Panel();
    p.setSizeFull();
    mainWindow.setContent(p);

    mainLayout = new CustomLayout(THEME_NAME); // uses layout defined in webapp/Vaadin/themes/yakalo
    mainLayout.setSizeFull();
    p.setContent(mainLayout);

    initSplitPanel();
    initViewManager();
    initActionsPanel();
}

From source file:org.airline.CelestiaLogin.java

@Override
protected void init(VaadinRequest request) {
    //Vista final para la UI
    final VerticalLayout layout = new VerticalLayout();

    Panel loginPanel = new Panel("Login");
    CustomLayout login = new CustomLayout("LoginLayout");
    //Seccin de Vista del Login
    //VerticalLayout login=new VerticalLayout(); 
    Label label = new Label("Iniciar Sesin / Registrarse");
    TextField user = new TextField("", "Usuario");
    TextField passwd = new TextField("", "Contrasea");

    Button init_session = new Button("Iniciar Sesin");
    init_session.setStyleName(ValoTheme.BUTTON_PRIMARY);
    init_session.addClickListener(cliqueo -> {
        Notification.show("Bienvenido " + user.getValue());
    });/*  w  w w  .jav a2  s .c o m*/

    login.addComponent(label);
    login.addComponent(user);
    login.addComponent(passwd);
    login.addComponent(init_session);
    login.setWidth("500px");
    //login.setMargin(true);
    login.setResponsive(true);

    layout.addComponent(login);
    layout.setComponentAlignment(login, Alignment.MIDDLE_CENTER);
    setContent(login);
}

From source file:org.bubblecloud.ilves.ui.anonymous.login.LoginFlowlet.java

License:Apache License

@SuppressWarnings("serial")
@Override// ww  w. j a  va2 s . c o  m
public void initialize() {

    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);

    final Company company = getSite().getSiteContext().getObject(Company.class);
    if (company.isOpenIdLogin()) {
        final VerticalLayout mainPanel = new VerticalLayout();
        mainPanel.setCaption(getSite().localize("header-open-id-login"));
        layout.addComponent(mainPanel);
        final HorizontalLayout openIdLayout = new HorizontalLayout();
        mainPanel.addComponent(openIdLayout);
        openIdLayout.setMargin(new MarginInfo(false, false, true, false));
        openIdLayout.setSpacing(true);
        final String returnViewName = "openidlogin";
        final Map<String, String> urlIconMap = OpenIdUtil.getOpenIdProviderUrlIconMap();
        for (final String url : urlIconMap.keySet()) {
            openIdLayout.addComponent(OpenIdUtil.getLoginButton(url, urlIconMap.get(url), returnViewName));
        }
    }

    try {
        final CustomLayout loginFormLayout = new CustomLayout(
                JadeUtil.parse("/VAADIN/themes/ilves/layouts/login.jade"));
        Responsive.makeResponsive(loginFormLayout);
        loginFormLayout.setCaption(getSite().localize("header-email-and-password-login"));
        layout.addComponent(loginFormLayout);
    } catch (final IOException e) {
        throw new SiteException("Error loading login form.", e);
    }

    if (company.isSelfRegistration()) {
        final Button registerButton = new Button(getSite().localize("button-register") + " >>");
        registerButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                getFlow().forward(RegisterFlowlet.class);
            }
        });
        layout.addComponent(registerButton);
    }

    if (company.isEmailPasswordReset()) {
        final Button forgotPasswordButton = new Button(getSite().localize("button-forgot-password") + " >>");
        forgotPasswordButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                getFlow().forward(ForgotPasswordFlowlet.class);
            }
        });
        layout.addComponent(forgotPasswordButton);
    }

    final Panel panel = new Panel();
    panel.setSizeUndefined();
    panel.setContent(layout);

    setViewContent(panel);

}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private void addFooter(final VerticalLayout rootLayout) {
    final Resource resource = context
            .getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");

    try (final InputStream resourceStream = resource.getInputStream()) {
        final CustomLayout customLayout = new CustomLayout(resourceStream);
        customLayout.setSizeUndefined();
        rootLayout.addComponent(customLayout);
        rootLayout.setComponentAlignment(customLayout, Alignment.BOTTOM_LEFT);
    } catch (final IOException ex) {
        LOG.error("Footer file cannot be loaded", ex);
    }//from  w  w w . j a  v a2  s .c om
}

From source file:org.eclipse.hawkbit.ui.login.HawkbitLoginUI.java

License:Open Source License

@Override
protected void init(final VaadinRequest request) {
    SpringContextHelper.setContext(context);

    final VerticalLayout rootLayout = new VerticalLayout();
    final Component header = buildHeader();

    rootLayout.addComponent(header);/*from   w  w  w . j a va  2  s  . c  om*/
    rootLayout.setSizeFull();

    final HorizontalLayout content = new HorizontalLayout();
    rootLayout.addComponent(content);
    content.setStyleName("view-content");
    content.setSizeFull();
    rootLayout.setStyleName("main-content");

    rootLayout.setExpandRatio(header, 1.0F);
    rootLayout.setExpandRatio(content, 2.0F);
    final Resource resource = context
            .getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");

    try (InputStream resourceStream = resource.getInputStream()) {
        final CustomLayout customLayout = new CustomLayout(resourceStream);
        customLayout.setSizeUndefined();
        rootLayout.addComponent(customLayout);
    } catch (final IOException ex) {
        LOG.error("Footer file cannot be loaded", ex);
    }
    setContent(rootLayout);

    final Navigator navigator = new Navigator(this, content);
    navigator.addProvider(viewProvider);
    setNavigator(navigator);
}

From source file:org.escidoc.browser.ui.maincontent.SimpleSearch.java

License:Open Source License

public SimpleSearch(final Router router, LayoutDesign layout, final EscidocServiceLocation serviceLocation,
        final Repositories repositories) {
    Preconditions.checkNotNull(router, "mainSite is null: %s", router);
    Preconditions.checkNotNull(serviceLocation, "serviceLocation is null: %s", serviceLocation);
    Preconditions.checkNotNull(repositories, "repositories is null: %s", repositories);
    this.router = router;
    this.layout = layout;
    this.serviceLocation = serviceLocation;
    this.repositories = repositories;

    final CustomLayout custom = new CustomLayout("simplesearch");
    addComponent(custom);//ww w  .  j  a  va2s .  c o m

    // top-level component properties
    setWidth("100.0%");
    setHeight("100.0%");

    searchField = new TextField();
    searchField.setWidth("268px");
    searchField.setHeight("-1px");
    searchField.setImmediate(false);

    // button_1
    searchBtn = new Button("Search", this, "onClick");
    searchBtn.setImmediate(true);

    // Advanced
    advancedBtn = new Button("Advanced Search", this, "onClickAdvSearch");
    advancedBtn.setStyleName(BaseTheme.BUTTON_LINK);
    advancedBtn.setImmediate(true);

    custom.addComponent(advancedBtn, "btnAdvanced");
    custom.addComponent(searchField, "searchfld");
    custom.addComponent(searchBtn, "searchbtn");

}