Skip to content

Instantly share code, notes, and snippets.

Avatar

Matti Tahvonen mstahv

View GitHub Profile
View SpringDataVaadinUtil.java
import java.util.stream.Collectors;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Order;
import com.vaadin.flow.data.provider.Query;
import com.vaadin.flow.data.provider.SortDirection;
public class SpringDataVaadinUtil {
View MainView.java
package com.example.demo;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
@mstahv
mstahv / Google2APi.java
Last active Nov 4, 2018 — forked from aceyin/Google2APi.java
Google OAuth2.0 for scribe-java
View Google2APi.java
package org.scribe.builder.api;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.scribe.exceptions.OAuthException;
import org.scribe.extractors.AccessTokenExtractor;
import org.scribe.model.OAuthConfig;
import org.scribe.model.OAuthConstants;
import org.scribe.model.OAuthRequest;
@mstahv
mstahv / MyUI.java
Created Mar 22, 2016
Yet another example to add lang attribute to html tag, this time with Viritin add-on
View MyUI.java
package org.test;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
@mstahv
mstahv / MyUI.java
Created Mar 21, 2016
Example how to add lang attribute to Vaadin app
View MyUI.java
package org.test;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.BootstrapFragmentResponse;
import com.vaadin.server.BootstrapListener;
import com.vaadin.server.BootstrapPageResponse;
import com.vaadin.server.VaadinRequest;
@mstahv
mstahv / settings.xml
Created Nov 4, 2015
An example of liferay profile
View settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>liferay</id>
<properties>
<liferayinstall>/Users/mattitahvonenitmill/Applications/liferay-portal-6.2-ce-ga4</liferayinstall>
<plugin.type>portlet</plugin.type>
@mstahv
mstahv / MyUI.java
Created Oct 2, 2015
An example how to use ContextMenu add-on together with V-Leaflet
View MyUI.java
package org.bluemix.challenge;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.Page;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
@mstahv
mstahv / MyUI.java
Last active Oct 1, 2015
Example to make text war in a Vaadin Table
View MyUI.java
package org.bluemix.mavenproject7;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.annotations.Widgetset;
import com.vaadin.data.Property;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.server.VaadinRequest;