Directory

← Back

spring-touchkit - Addon

Integration of Spring framework and Vaadin TouchKit

Author

Rating

This addon combines the Spring framework and Vaadin TouchKit.

The Spring integration is mainly done by the Spring-Stuff addon, just a custom SpringTouchApplication was added.

Please have a look at the demo-application and the manual provided in the GIT repository.

Sample code

/**
 * 
 */
package de.flexguse.vaadin.addon.spring.touchkit.demo;

import org.springframework.web.context.ConfigurableWebApplicationContext;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;

import de.flexguse.vaadin.addon.spring.touchkit.SpringTouchkitApplication;

/**
 * DemoApplication for mobile application just to show Spring works with a
 * Touchkit application.
 * 
 * @author Christoph Guse, info@flexguse.de
 * 
 */
public class DemoMobileApplication extends SpringTouchkitApplication {

    private static final long serialVersionUID = -1620529949585068850L;

    private String notificationText;

    /**
     * @return the notificationText
     */
    public String getNotificationText() {
	return notificationText;
    }

    /**
     * @param notificationText
     *            the notificationText to set
     */
    public void setNotificationText(String notificationText) {
	this.notificationText = notificationText;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.dellroad.stuff.vaadin.touchkit.SpringTouchkitApplication#
     * onBrowserDetailsReady()
     */
    @Override
    public void onBrowserDetailsReady() {

	Button button = new Button("click me");

	button.addListener(new Button.ClickListener() {

	    private static final long serialVersionUID = 1000238561242401395L;

	    @Override
	    public void buttonClick(ClickEvent event) {
		getMainWindow().showNotification(getNotificationText());

	    }
	});

	getMainWindow().addComponent(button);

    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * org.dellroad.stuff.vaadin.SpringContextApplication#initSpringApplication
     * (org.springframework.web.context.ConfigurableWebApplicationContext)
     */
    @Override
    protected void initSpringApplication(
	    ConfigurableWebApplicationContext context) {

	/*
	 * Initialise the application. Don't forget to run the init method in
	 * the super class, otherwise you get an error the Vaadin Application
	 * Window can't be found.
	 */
	super.initSpringApplication(context);

    }

}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

initital version

Released
2012-07-01
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.0+
Vaadin 7.0+
Browser
Browser Independent

spring-touchkit - Addon - Vaadin Add-on Directory

Integration of Spring framework and Vaadin TouchKit spring-touchkit - Addon - Vaadin Add-on Directory
This addon combines the Spring framework and Vaadin TouchKit. The Spring integration is mainly done by the Spring-Stuff addon, just a custom SpringTouchApplication was added. Please have a look at the demo-application and the manual provided in the GIT repository.
Online