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

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

Introduction

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

Prototype

public static void setTitle(String title) 

Source Link

Usage

From source file:org.unitime.timetable.gwt.client.Client.java

License:Apache License

public void init(String page) {
    try {//from w w  w  . j  a v  a2s.c  om
        RootPanel loading = RootPanel.get("UniTimeGWT:Loading");
        if (loading != null)
            loading.setVisible(false);
        for (Pages p : Pages.values()) {
            if (p.name().equals(page)) {
                LoadingWidget.getInstance().setMessage(MESSAGES.waitLoading(p.name(MESSAGES)));
                UniTimePageLabel.getInstance().setPageName(p.name(MESSAGES));
                Window.setTitle("UniTime " + CONSTANTS.version() + "| " + p.name(MESSAGES));
                RootPanel.get("UniTimeGWT:Body").add(p.widget());
                return;
            }
        }
        Label error = new Label(page == null ? MESSAGES.failedToLoadPageNotProvided()
                : MESSAGES.failedToLoadPageNotRegistered(page));
        error.setStyleName("unitime-ErrorMessage");
        RootPanel.get("UniTimeGWT:Body").add(error);
    } catch (Exception e) {
        Label error = new Label(MESSAGES.failedToLoadPage(e.getMessage()));
        error.setStyleName("unitime-ErrorMessage");
        RootPanel.get("UniTimeGWT:Body").add(error);
    }
}

From source file:org.unitime.timetable.gwt.client.page.UniTimePageLabel.java

License:Apache License

@Override
public void setValue(PageNameInterface value) {
    Window.setTitle("UniTime " + CONSTANTS.version() + "| " + value.getName());
    iLabel.setValue(value);/*from ww  w . ja  va  2  s. c  om*/
}

From source file:org.unitime.timetable.gwt.client.page.UniTimePageLabel.java

License:Apache License

@Override
public void setValue(PageNameInterface value, boolean fireEvents) {
    Window.setTitle("UniTime " + CONSTANTS.version() + "| " + value.getName());
    iLabel.setValue(value, fireEvents);//  www . j a v a2  s  . co m
}

From source file:org.vaadin.alump.offlinebuilder.client.offline.OfflineFactory.java

License:Open Source License

public void readRootState(ORootConnector connector) {
    String title = OfflineStorage.get(generateRootKey(TITLE_KEY));
    if (title != null) {
        Window.setTitle(title);
    }//  w w  w  .j a  v  a2  s  . c  o  m

    // Add stylenames that where in online mode v-ui element
    String classesAttribute = OfflineStorage.get(generateRootKey(UI_CLASS_KEY));
    if (classesAttribute != null && !classesAttribute.isEmpty()) {
        connector.getWidget().addStyleName(classesAttribute);
    }

    String parentClassAttribute = OfflineStorage.get(generateRootKey(PARENT_CLASS_KEY));
    if (parentClassAttribute != null && !parentClassAttribute.isEmpty()) {
        connector.getWidget().getElement().getParentElement().addClassName(parentClassAttribute);
    }

    String rootPid = OfflineStorage.get(generateRootKey(ROOT_KEY));
    if (rootPid != null) {
        OfflineConnector rootConnector = getOfflineConnector(rootPid);
        connector.getWidget().add(BuilderOfflineMode.resolveWidget(rootConnector));

        readState(rootConnector);
    } else {
        HTML error = new HTML();
        error.setHTML("No root?");
        connector.getWidget().add(error);
    }
}

From source file:org.waveprotocol.box.webclient.client.WindowTitleHandler.java

License:Apache License

@Override
public void onOpened(WaveContext wave) {
    String waveTitle = TitleHelper.getTitle(wave);
    String windowTitle = formatTitle(waveTitle);
    if (waveTitle == null || waveTitle.isEmpty()) {
        windowTitle = DEFAULT_TITLE;//from  w w  w  . jav a 2  s .  co  m
    }
    Window.setTitle(windowTitle);
    waveFrame.setTitleText(waveTitle);
}

From source file:org.waveprotocol.box.webclient.client.WindowTitleHandler.java

License:Apache License

@Override
public void onClosed(WaveContext wave) {
    Window.setTitle(DEFAULT_TITLE);
}

From source file:org.zanata.webtrans.client.AppPresenter.java

License:Open Source License

@Override
protected void onBind() {

    registerHandler(eventBus.addHandler(NotificationEvent.getType(), new NotificationEventHandler() {

        @Override/*from   w w  w .  j av a 2  s .com*/
        public void onNotification(NotificationEvent event) {
            display.setNotificationMessage(event.getMessage());
        }
    }));

    Window.enableScrolling(false);

    documentListPresenter.bind();
    translationPresenter.bind();
    transFilterPresenter.bind();

    display.setDocumentListView(documentListPresenter.getDisplay().asWidget());
    display.setTranslationView(translationPresenter.getDisplay().asWidget());
    display.setFilterView(transFilterPresenter.getDisplay().asWidget());

    display.showInMainView(MainView.Documents);

    registerHandler(eventBus.addHandler(DocumentSelectionEvent.getType(), new DocumentSelectionHandler() {
        @Override
        public void onDocumentSelected(DocumentSelectionEvent event) {
            if (selectedDocument == null || !event.getDocument().getId().equals(selectedDocument)) {
                display.setSelectedDocument(event.getDocument());
            }
            display.showInMainView(MainView.Editor);
        }
    }));

    registerHandler(display.getDocumentsLink().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            display.showInMainView(MainView.Documents);
        }
    }));

    registerHandler(display.getSignOutLink().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Application.redirectToLogout();
        }
    }));

    registerHandler(display.getLeaveWorkspaceLink().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Application.closeWindow();
            // As the editor was created at new window, it should be closed
            // rather than redirected to project home.
            // Application.redirectToZanataProjectHome(workspaceContext.getWorkspaceId());
        }
    }));

    display.setUserLabel(identity.getPerson().getName());

    display.setWorkspaceNameLabel(workspaceContext.getWorkspaceName());

    Window.setTitle(
            messages.windowTitle(workspaceContext.getWorkspaceName(), workspaceContext.getLocaleName()));
}

From source file:stroom.dashboard.client.main.DashboardAppPresenter.java

License:Apache License

@Inject
public DashboardAppPresenter(final EventBus eventBus, final DashboardAppView view,
        final DashboardAppProxy proxy, final ClientSecurityContext securityContext,
        final ClientDispatchAsync dispatcher, final DashboardPresenter dashboardPresenter) {
    super(eventBus, view, proxy);
    this.securityContext = securityContext;
    this.dashboardPresenter = dashboardPresenter;

    eventBus.addHandler(CurrentUserChangedEvent.getType(), event -> {
        RootLayoutPanel.get().clear();/*from   w w w. ja v  a  2 s .  c  o m*/
        RootPanel.get().clear();

        final String type = Window.Location.getParameter("type");
        final String uuid = Window.Location.getParameter("uuid");
        params = Window.Location.getParameter("params");

        if (type == null || uuid == null) {
            AlertEvent.fireError(this, "No dashboard uuid has been specified", null);

        } else {
            final DocRef docRef = new DocRef(type, uuid);
            dispatcher.execute(new EntityServiceLoadAction<>(docRef, null),
                    new AsyncCallbackAdaptor<Dashboard>() {
                        @Override
                        public void onSuccess(final Dashboard dashboard) {
                            onLoadSuccess(dashboard);
                        }

                        @Override
                        public void onFailure(final Throwable throwable) {
                            onLoadFailure(throwable);
                        }
                    });
        }
    });

    dashboardPresenter.addDirtyHandler(event -> {
        if (dashboard != null) {
            if (event.isDirty()) {
                Window.setTitle("* " + dashboard.getName());
            } else {
                Window.setTitle(dashboard.getName());
            }
        }
    });

    Window.addWindowClosingHandler(event -> {
        if (dashboardPresenter.isDirty()) {
            String name = "";
            if (dashboard != null) {
                name = "'" + dashboard.getName() + "'";
            }

            event.setMessage("Dashboard " + name + " has unsaved changes. Are you sure you want to close it?");
        }
    });
}

From source file:stroom.dashboard.client.main.DashboardAppPresenter.java

License:Apache License

private void onLoadSuccess(final Dashboard dashboard) {
    if (dashboard == null) {
        AlertEvent.fireError(this, "No dashboard uuid has been specified", null);

    } else {//from ww w. j a va2 s.  c o  m
        this.dashboard = dashboard;

        setInSlot(CONTENT, dashboardPresenter);
        RevealRootContentEvent.fire(DashboardAppPresenter.this, DashboardAppPresenter.this);
        RootPanel.get("logo").setVisible(false);

        dashboardPresenter.setParams(params);
        dashboardPresenter.read(dashboard);
        Window.setTitle(dashboard.getName());
    }
}

From source file:thothbot.parallax.demo.client.Demo.java

License:Open Source License

/**
 * Set the content to the {@link ContentWidget}.
 * //from ww w.ja  va  2s .c o m
 * @param content
 *            the {@link ContentWidget} to display
 */
private void displayContentWidget(final ContentWidget content) {
    if (content == null)
        return;

    shell.setContent(content);
    Window.setTitle("Parallax demo: " + content.getName());
}