Skip to content

Instantly share code, notes, and snippets.

View alejandro-du's full-sized avatar
🦭
MariaDB is much more than a fork of MySQL

Alejandro Duarte alejandro-du

🦭
MariaDB is much more than a fork of MySQL
View GitHub Profile
@alejandro-du
alejandro-du / vaadinBootstrap.js
Last active January 26, 2017 11:07
Function to "deatach" apps when required
(function() {
var apps = {};
var themesLoaded = {};
var widgetsets = {};
var log;
if (typeof console === "undefined" || !window.location.search.match(/[&?]debug(&|$)/)) {
//If no console.log present, just use a no-op
log = function() {};
@alejandro-du
alejandro-du / gist:3b417f3c5c83bf15571c59f0158c1672
Created May 2, 2017 09:56
Vaadin 8.1 - Grid Drag and Drop example
package com.example;
import com.vaadin.shared.ui.grid.DropMode;
import com.vaadin.ui.Grid;
import com.vaadin.ui.GridDragSource;
import com.vaadin.ui.GridDropTarget;
import com.vaadin.ui.VerticalLayout;
import java.util.List;
package com.example;
import com.vaadin.icons.VaadinIcons;
import com.vaadin.ui.Button;
import com.vaadin.ui.Grid;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.renderers.ComponentRenderer;
import com.vaadin.ui.themes.ValoTheme;
/**
@alejandro-du
alejandro-du / gist:2b1de232dc6b5c251e4191595ede070b
Last active June 19, 2017 12:30
Vaadin 8.1 - TreeGrid example
package com.example;
import com.vaadin.ui.TreeGrid;
import com.vaadin.ui.VerticalLayout;
/**
* @author Alejandro Duarte.
*/
public class TreeGridExample extends VerticalLayout {
package com.example;
import com.vaadin.data.Binder;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.*;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@alejandro-du
alejandro-du / vaadin-date-picker-example.html
Created February 12, 2018 18:44
<vaadin-date-picker> example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="./bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="./bower_components/vaadin-date-picker/vaadin-date-picker.html">
</head>
@alejandro-du
alejandro-du / lumo-example.html
Last active February 12, 2018 22:39
Lumo example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="./bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="./bower_components/vaadin-date-picker/vaadin-date-picker.html" />
<custom-style>
@alejandro-du
alejandro-du / MainView.java
Created February 13, 2018 20:25
Grid example
package com.vaadin.starter.skeleton;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.theme.lumo.Lumo;
@Route("")
@Theme(Lumo.class)
package com.vaadin.starter.skeleton;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.component.html.Div;
@Tag("juicy-ace-editor")
@HtmlImport("bower_components/juicy-ace-editor/juicy-ace-editor.html")
public class JuicyAceEditor extends Div {
@alejandro-du
alejandro-du / VaadinUI.java
Last active March 29, 2018 15:03
Getting WARNING level validation results with Binder in Vaadin 8
package com.vaadin.example;
import com.vaadin.data.Binder;
import com.vaadin.data.ValidationResult;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.ErrorLevel;
import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;