All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.swm.gwt.client.history.HistorySupport Maven / Gradle / Ivy

There is a newer version: 3.1
Show newest version
package de.swm.gwt.client.history;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;

import de.swm.gwt.client.eventbus.IDispatcher;
import de.swm.gwt.client.eventbus.IEvent;



/**
 * Support fuer event-Forwarding ueber History-Tokens.
 * 
 * @author wiese.daniel 
* copyright (C) 2011, SWM Services GmbH * * @param * Haupt-Event Klasse * @param * eine optionale Sub-Event Klasse * */ public class HistorySupport & IEvent, Z extends Enum & IEvent> implements ValueChangeHandler { private final HistoryTokenParser parser; /** * Default constructor. * * @param dispacher * der anwendungsweite dispatcher * @param plattformEventClass * der Haupt-Event Klasse * @param optionalSubEventClass * eine optionale Sub-Event Klasse. */ public HistorySupport(IDispatcher dispacher, Class plattformEventClass, Class optionalSubEventClass) { this.parser = new HistoryTokenParser(dispacher, plattformEventClass, optionalSubEventClass); } @Override public void onValueChange(ValueChangeEvent event) { final String historyValue = event.getValue(); handleHistoryEvent(historyValue); } /** * History event mit dem Toen als String. * * @param historyValue * der history token */ public void handleHistoryEvent(final String historyValue) { if (historyValue != null) { GWT.log("History-Change-Event: " + historyValue); this.parser.parseTokenAndFireEvents(historyValue); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy