Example usage for com.google.gwt.user.client History fireCurrentHistoryState

List of usage examples for com.google.gwt.user.client History fireCurrentHistoryState

Introduction

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

Prototype

public static void fireCurrentHistoryState() 

Source Link

Document

Fire ValueChangeHandler#onValueChange(ValueChangeEvent) events with the current history state.

Usage

From source file:br.org.olimpiabarbacena.client.Menu.java

License:Apache License

public Menu(Principal principal) {
    this.principal = principal;
    initWidget(uiBinder.createAndBindUi(this));

    // If the application starts with no history token, redirect to a new
    // 'acervo' state.
    String initToken = History.getToken();
    if ((initToken.length() == 0) || (initToken.equals("acervo"))) {
        History.newItem("acervo");
        onLinkAcervoClick(null);//from  www  .  ja  v a  2s. com
    } else if (initToken.equals("membro")) {
        onLinkMembroClick(null);
    }

    // Now that we've setup our listener, fire the initial history state.
    History.fireCurrentHistoryState();
}

From source file:burrito.client.crud.CrudPanel.java

License:Apache License

public CrudPanel() {
    History.addValueChangeHandler(this);
    wrapper.add(top, DockPanel.NORTH);/*from  w  w w.j ava  2 s .  c om*/
    content.addStyleName("k5-CrudPanel-content");
    top.addStyleName("k5-CrudPanel-top");
    wrapper.add(content, DockPanel.CENTER);

    initWidget(wrapper);
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

        @Override
        public void execute() {
            History.fireCurrentHistoryState();
        }
    });
    addStyleName("k5-CrudPanel");
    setWidth("100%");
}

From source file:burrito.client.sitelet.SiteletAdminPanel.java

License:Apache License

public SiteletAdminPanel(String containerName) {
    this.containerName = containerName;
    wrapper.add(new VerticalSpacer(20));
    wrapper.add(contentPlaceHolder);//  w  w w  . j  a v  a2s. c om
    contentPlaceHolder.addStyleName("k5-SiteletAdminPanel-content");
    initWidget(wrapper);
    addStyleName("k5-SiteletAdminPanel");
    setWidth("100%");
    History.addValueChangeHandler(this);
    History.fireCurrentHistoryState();
}

From source file:cc.alcina.framework.gwt.client.util.ClientUtils.java

License:Apache License

public static void fireHistoryToken(String token) {
    if (token == null) {
        return;/*from   w  w  w .  jav  a 2 s.  c o m*/
    }
    if (token.equals(History.getToken())) {
        History.fireCurrentHistoryState();
    }
    History.newItem(token);
}

From source file:cc.alcina.framework.gwt.client.util.ClientUtils.java

License:Apache License

public static void refireHistoryTokenIfSame(String token) {
    if (token == null) {
        return;// w  w w  .  j a va2  s  .c o m
    }
    if (token.equals(History.getToken())) {
        History.fireCurrentHistoryState();
    }
    // do nothing if we've moved on
}

From source file:cc.kune.wave.client.WebClient.java

License:Apache License

/**
 * This is the entry point method./*from www  .ja v  a2 s.  c  o m*/
 *
 * @param eventBus the event bus
 * @param profiles the profiles
 * @param tokenMatcher the token matcher
 * @param kuneSession the kune session
 * @param waveUnsavedIndicator the wave unsaved indicator
 * @param contentService the content service
 * @param colorPicker the color picker
 */
@Inject
public WebClient(final EventBus eventBus, final KuneWaveProfileManager profiles,
        final cc.kune.core.client.state.Session kuneSession, StateManager stateManager,
        final CustomSavedStateIndicator waveUnsavedIndicator, final ContentServiceAsync contentService,
        final Provider<AurorisColorPicker> colorPicker, SearchPanelView searchPanel,
        CustomEditToolbar customEditToolbar) {
    this.eventBus = eventBus;
    this.profiles = profiles;
    this.kuneSession = kuneSession;
    this.stateManager = stateManager;
    this.waveUnsavedIndicator = waveUnsavedIndicator;
    this.contentService = contentService;
    this.colorPicker = colorPicker;
    this.customEditToolbar = customEditToolbar;
    this.searchPanel = searchPanel;
    ErrorHandler.install();
    eventBus.addHandler(StackErrorEvent.getType(), new StackErrorEvent.StackErrorHandler() {
        @Override
        public void onStackError(final StackErrorEvent event) {
            getStackTraceAsync(event.getException(), new Accessor<SafeHtml>() {
                @Override
                public void use(final SafeHtml stack) {
                    final String stackAsString = stack.asString().replace("<br>", "\n");
                    NotifyUser.logError(stackAsString);
                    cc.kune.common.client.log.Log.error("Stack: " + stackAsString);
                }
            });
        }
    });

    ClientEvents.get().addWaveCreationEventHandler(new WaveCreationEventHandler() {

        @Override
        public void onCreateRequest(final WaveCreationEvent event, final Set<ParticipantId> participantSet) {
            LOG.info("WaveCreationEvent received");
            if (channel == null) {
                throw new DefaultException("Spaghetti attack.  Create occured before login");
            }
            openWave(WaveRef.of(idGenerator.newWaveId()), true, participantSet);
        }
    });

    //setupConnectionIndicator();

    // Done in StateManager
    HistorySupport.init(new HistoryProvider() {
        @Override
        public String getToken() {
            final String currentToken = History.getToken();
            String waveToken = currentToken;
            // FIXME what about preview?
            if (TokenMatcher.isGroupToken(currentToken) || TokenMatcher.isHomeToken(currentToken)) {
                waveToken = kuneSession.getContentState().getWaveRef();
                LOG.info("Kune URL: " + currentToken + " = " + waveToken);
            }
            return waveToken;
        }
    });

    loginImpl();

    setupUi();

    //WaveClientUtils.addListener(stateManager, wave, waveHolder, waveFrame);

    if (TokenMatcher.isWaveToken(History.getToken())) {
        History.fireCurrentHistoryState();
    }
    LOG.info("SimpleWebClient.onModuleLoad() done");

    eventBus.fireEvent(new OnWaveClientStartEvent(this));
}

From source file:com.agnie.gwt.common.client.mvp.AppController.java

License:Open Source License

public void go() {
    if ("".equals(History.getToken())) {
        History.newItem(new Place<PLACE>(getDefaultPlace()).toString());
    } else {/*from   w w w .  j a  va2 s.c om*/
        History.fireCurrentHistoryState();
    }
}

From source file:com.ait.lienzo.ks.client.ContentPanel.java

License:Open Source License

public final void run() {
    String name = StringOps.toTrimOrNull(History.getToken());

    if ((null != name) && (ViewFactoryInstance.get().isDefined(name))) {
        History.fireCurrentHistoryState();
    } else {/*from  ww  w.java  2s .  c om*/
        History.newItem(WELCOME);
    }
}

From source file:com.brainz.wokhei.client.about.AboutModulePart.java

@Override
public void loadModulePart() {

    History.addValueChangeHandler(this);

    HarnessStringsFromHTML();/*from w  ww .  ja v a2 s .  co  m*/

    //MAIN LAYOUT
    VerticalPanel leftColumnPanel = new VerticalPanel();
    leftColumnPanel.setWidth("280px");
    leftColumnPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);

    VerticalPanel rightColumnPanel = new VerticalPanel();
    rightColumnPanel.setWidth("400px");
    rightColumnPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);

    DOM.setStyleAttribute(_text.getElement(), "whiteSpace", "pre");
    _text.setWidth("370px");
    _text.setWordWrap(true);
    HorizontalPanel main = new HorizontalPanel();
    main.add(leftColumnPanel);
    main.add(new Image("../images/stuff2.png"));
    main.add(getWhiteSpace(30));
    main.add(rightColumnPanel);

    //RIGHT COLUMN 
    _title.setStyleName("sectionTitle");
    _title.addStyleName("fontAR");
    _title.setText(_aboutUsTitle);
    _text.setStyleName("sectionText");
    _text.setHTML(_aboutUsText);

    _contactUsPanel = getContactUsPanel();
    _contactUsPanel.setVisible(false);

    _licensesPanel = getLicensesPanel();
    _licensesPanel.setVisible(false);

    _panels.add(_contactUsPanel);
    _panels.add(_licensesPanel);

    rightColumnPanel.add(_title);
    rightColumnPanel.add(getWhiteSpace(20));
    rightColumnPanel.add(_text);
    rightColumnPanel.add(_contactUsPanel);
    rightColumnPanel.add(_licensesPanel);

    //LEFT COLUMN
    Label aboutWokhei = new Label(_aboutTitle);
    aboutWokhei.setStyleName("pageTitle");
    aboutWokhei.addStyleName("fontAR");

    VerticalPanel menu = new VerticalPanel();
    menu.setSpacing(10);

    addMenuItem(menu, _aboutUsTitle, _aboutUsText, "aboutUs");
    addMenuItem(menu, _whatWokheiTitle, _whatWokheiText, "whatWokhei");
    addMenuItem(menu, _differentWokheiTitle, _differentWokheiText, "whatDifferent");
    addMenuItem(menu, _licensesTitle, _licensesPanel, "licenses");
    addMenuItem(menu, _restaurantTitle, _restaurantText, "whyRestaurant");
    addMenuItem(menu, _networkTitle, _networkText, "network");
    addMenuItem(menu, _contactUsTitle, _contactUsPanel, "contactUs");

    leftColumnPanel.add(aboutWokhei);
    leftColumnPanel.add(getWhiteSpace(10));
    leftColumnPanel.add(menu);

    RootPanel.get("aboutBodyPart").add(main);
    applyCufon();

    History.fireCurrentHistoryState();
}

From source file:com.bramosystems.oss.player.showcase.client.Showcase.java

License:Apache License

@Override
public void onModuleLoad() {
    Bundle.bundle.css().ensureInjected();

    RootPanel.get("loading").setVisible(false);
    RootPanel.get("app-pane").add(root);

    History.addValueChangeHandler(stage);
    History.addValueChangeHandler(menu);
    History.fireCurrentHistoryState();
}