Example usage for com.google.gwt.gwtpages.client.page PageAttributes put

List of usage examples for com.google.gwt.gwtpages.client.page PageAttributes put

Introduction

In this page you can find the example usage for com.google.gwt.gwtpages.client.page PageAttributes put.

Prototype

public <R> PageAttributes put(Object key, Object data) 

Source Link

Document

Add a data attribute

Usage

From source file:com.google.gwt.gwtpages.demo.client.loaders.DemoPageLoader.java

/**
 * We'll add some data to the page attributes
 * //from w w  w  .j  a  va  2s . c o m
 * @param token
 *            the page token
 * @param title
 *            the page title (this is referenced in the application
 *            presenters - {@link DefaultLayoutPage} and
 *            {@link RightNavLayoutPage}
 * @param layoutToken
 *            the token representing which application presenter (layout) we
 *            will use - {@link CompositeLayoutApplicationPresenter}
 * @param pageClass
 *            the page class
 */
private void registerPage(String token, String title, String layoutToken, Class<? extends Page> pageClass) {
    PageAttributes attributes = new PageAttributes();
    attributes.put(PageConstants.PARAM_PAGE_TITLE, title);
    if (null != layoutToken)
        attributes.put(CompositeLayoutApplicationPresenter.PRESENTER_TOKEN_KEY, layoutToken);
    super.registerPage(token, pageClass, attributes);
}

From source file:com.google.gwt.gwtpages.demo.client.loaders.DemoPageLoader.java

private void registerPage(String token, String title, String layoutToken, Class<? extends Page> pageClass,
        Class<?> viewClass) {
    PageAttributes attributes = new PageAttributes();
    attributes.put(PageConstants.PARAM_PAGE_TITLE, title);
    if (null != layoutToken)
        attributes.put(CompositeLayoutApplicationPresenter.PRESENTER_TOKEN_KEY, layoutToken);
    super.registerPage(token, pageClass, viewClass, attributes);
}