Example usage for com.google.gwt.user.client Window getTitle

List of usage examples for com.google.gwt.user.client Window getTitle

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window getTitle.

Prototype

public static String getTitle() 

Source Link

Usage

From source file:com.googlecode.mgwt.mvp.client.history.MGWTPlaceHistoryHandler.java

License:Apache License

protected void pushToken(String token) {
    historian.pushState(token, Window.getTitle(), "#" + History.encodeHistoryToken(token));
}

From source file:com.guit.client.place.PlaceManagerImpl.java

License:Apache License

@Inject
public PlaceManagerImpl(final PlaceManagerInitializer initializer, Crypter crypter, EventBus eventBus) {
    this.eventBus = eventBus;
    this.crypter = crypter;
    this.defaultTitle = Window.getTitle();

    initializer.initialize(this);
}

From source file:com.mansi.client.board.ExampleTabPanel.java

License:Apache License

/**
 * Add another example to demonstrate./*from  w  w  w. j  a  v a 2 s .  c  o  m*/
 * 
 * @param example the example panel to add
 */
public void add(Example example) {
    VerticalPanel verticalPanel = new VerticalPanel();
    //    verticalPanel.add(describe(example.getInvolvedClasses(), example.getDescription()));
    verticalPanel.add(example);
    Label tabLabel = new Label("Demo " + (getTabCount() + 1));
    tabLabel.setWordWrap(false);
    String title = DOMUtil
            .adjustTitleForBrowser(StringUtil.getShortTypeName(example) + "\n" + example.getDescription());
    tabLabel.setTitle(title);
    add(verticalPanel, tabLabel, example.getHistoryToken(),
            Window.getTitle() + " - " + example.getHistoryToken());
}

From source file:com.urlisit.siteswrapper.cloud.client.RenderedPage.java

License:Apache License

@SuppressWarnings("deprecation")
public static AbsolutePanel renderLayout() {
    Window.setMargin(RenderedPage.windowMargin + "px");
    RenderedPage.sizeLayoutElements();//from   w w w. j a  va2s .c om
    RenderedPage.locLangSelector.addItem("United States / English");
    RenderedPage.locLangSelector.addItem("Costa Rica / Spanish");
    RenderedPage.searchField.setText("Search");
    RenderedPage.mainMenu.setText(0, 0, "");
    RenderedPage.mainMenu.getElement().getStyle()
            .setBackgroundImage("url('" + Resources.resources.mainMenuSprite().getURL() + "')");
    RenderedPage.mainMenu.getElement().getStyle().setProperty("BackgroundRepeat", "repeat-x");
    int x = 0;
    while (RenderedPage.pageMap.get("page" + x) != null) {
        RenderedPage.instanceMap.get(RenderedPage.pageMap.get("page" + x)).mainMenuHyperLink
                .setHTML(RenderedPage.instanceMap.get(RenderedPage.pageMap.get("page" + x)).getMainMenuLink());
        RenderedPage.mainMenu.setWidget(0, x + 1, mainMenuLinks.get(x));
        x++;
    }
    int cellWidth = (int) Math.round(RenderedPage.windowWidth / RenderedPage.mainMenu.getCellCount(0));
    int y = RenderedPage.mainMenu.getCellCount(0);
    for (x = 0; x <= y; x++) {
        RenderedPage.mainMenu.getCellFormatter().setWidth(0, x, cellWidth + "px");
        RenderedPage.mainMenu.getCellFormatter().setHorizontalAlignment(0, x,
                HasHorizontalAlignment.ALIGN_CENTER);
    }
    RenderedPage.mainPanel.add(RenderedPage.locLangSelector, RenderedPage.locLangSelectorLeft,
            RenderedPage.locLangSelectorTop);
    RenderedPage.mainPanel.add(RenderedPage.searchField, RenderedPage.searchFieldLeft,
            RenderedPage.searchFieldTop);
    RenderedPage.mainPanel.add(RenderedPage.searchButton, RenderedPage.searchButtonLeft,
            RenderedPage.searchButtonTop);
    RenderedPage.mainPanel.add(RenderedPage.mainMenu, RenderedPage.mainMenuLeft, RenderedPage.mainMenuTop);
    /*
     * If renderLayout is called with an empty instanceMap report it using an alert box and fail gracefully
     * by returning an AbsolutePanel without any page instances to render. This situation happens when the
     * RenderedPage.renderLayout() method is called before new instance objects are created or the configuration
     * in the datastore is empty.  
     */
    if (RenderedPage.instanceMap.isEmpty()) {
        Window.alert("RenderedPage instanceMap is empty. Check the configuration database.");
    } else {
        RenderedPage.instanceMap.get(Window.getTitle()).materialize();
    }
    return RenderedPage.mainPanel;
}

From source file:com.urlisit.siteswrapper.cloud.client.RenderedPage.java

License:Apache License

@Override
public void onResize(ResizeEvent event) {
    sizePageElements();/*from w  w  w  . ja v a2  s.  c  om*/
    if (pageTitle.equals(Window.getTitle())) {
        positionPageElements();
        RenderedPage.sizeLayoutElements();
        RenderedPage.positionLayoutElements();
    }
}

From source file:com.urlisit.siteswrapper.cloud.client.RenderedPage.java

License:Apache License

@Override
public void onValueChange(ValueChangeEvent<String> event) {
    if (event.getValue().equals(pageTitle)) {
        RenderedPage.instanceMap.get(Window.getTitle()).dematerialize();
        RenderedPage.instanceMap.get(event.getValue()).materialize();
        Window.setTitle(event.getValue());
    }/*from  w  ww. j  a  va 2  s  .c  o m*/
}

From source file:com.urlisit.siteswrapper.cloud.presenter.URLePresenter.java

License:Apache License

@Override
public void onValueChange(ValueChangeEvent<String> event) {
    /*/*from  w w w. j  a  v a  2s  .  c o m*/
     * Handle events from a click in the MainMenu
     */
    for (String viewTitle : views.keySet()) {
        if (event.getValue().equals(viewTitle)) {
            getView(Window.getTitle()).getMenu().setEntryNotSelected(Window.getTitle());
            getView(viewTitle).getMenu().setEntrySelected(viewTitle);
            getView(Window.getTitle()).unLoad(this, getView(viewTitle));
        }
    }
}

From source file:com.urlisit.siteswrapper.cloud.presenter.URLePresenter.java

License:Apache License

@Override
public void onResize(ResizeEvent event) {
    //getView(Window.getTitle()).getMenu().onResize(getView(Window.getTitle()).getNumber());
    getView(Window.getTitle()).onResize();
    //getView(Window.getTitle()).getMenu().onResize();
}

From source file:com.urlisit.siteswrapper.cloud.widgets.MainMenu.java

License:Apache License

public void onResize(int viewNumber) {
    String title = Window.getTitle();
    Literals literals = entries.get(viewNumber).getView().getLiterals();
    LookAndFeel lookAndFeel = entries.get(viewNumber).getView().getLookAndFeel();
    ViewPanel panel = entries.get(viewNumber).getView().getPanel();
    int numCells = menu.getCellCount(literals.rowZero());
    double menuWidth = Window.getClientWidth()
            - (Window.getClientWidth() * Double.valueOf(lookAndFeel.getMainMenuLeft()));
    int cellWidth = (int) Math.round(menuWidth / numCells);
    for (int x = 0; x < numCells; x++) {
        menu.getCellFormatter().setWidth(literals.rowZero(), x, cellWidth + literals.px());
        menu.getCellFormatter().setHorizontalAlignment(literals.zero(), x, HasHorizontalAlignment.ALIGN_LEFT);
    }/*from   ww  w . ja  v a  2  s.  c om*/
    int left = (int) Math.round(Window.getClientWidth() * Double.valueOf(lookAndFeel.getMainMenuLeft()));
    int top = (int) Math.round(Double.valueOf(lookAndFeel.getMainMenuTopPercent()) * Window.getClientHeight());
    panel.add(this, left, top);
    panel.onResize();
}

From source file:com.urlisit.siteswrapper.cloud.widgets.Selector.java

License:Apache License

@Override
public void onResize() {
    Literals literals = presenter.getView(Window.getTitle()).getLiterals();
    LookAndFeel lookAndFeel = presenter.getView(Window.getTitle()).getLookAndFeel();
    ViewPanel panel = presenter.getView(Window.getTitle()).getPanel();
    int numCells = mainMenu.getCellCount(literals.rowZero());
    double width = Window.getClientWidth()
            - (Window.getClientWidth() * Double.valueOf(lookAndFeel.getMainMenuLeft()));
    int cellWidth = (int) Math.round(width / numCells);
    for (int x = 0; x < numCells; x++) {
        mainMenu.getCellFormatter().setWidth(literals.rowZero(), x, cellWidth + literals.px());
        mainMenu.getCellFormatter().setHorizontalAlignment(literals.zero(), x,
                HasHorizontalAlignment.ALIGN_LEFT);
    }//from   ww w .j  a  v  a2 s  .c o m
    int left = (int) Math.round(Window.getClientWidth() * Double.valueOf(lookAndFeel.getMainMenuLeft()));
    int top = (int) Math.round(Double.valueOf(lookAndFeel.getMainMenuTopPercent()) * Window.getClientHeight());
    panel.add(this, left, top);
}