Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Mihai Ruiu gabrielruiu

  • Karlsruhe, Germany
View GitHub Profile
View gist:dbe7dfb5d6910ce4a541
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
View gist:111badd44ad3b21bb4f3
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
View Driver
package com.gabrielruiu.test;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
View gist:10261502
public class RunApp {
private List<String> expiredCCList;
private List<String> stolenCCList;
public Main {
populateExpiredList();
populateStolenList();
@gabrielruiu
gabrielruiu / RestrictingUpload
Created Apr 3, 2014
Upload component (from Vaadin 7.1.13) that remembers the files it has uploaded and asks, in case a duplicate file is uploaded, if we wish to overwrite it.
View RestrictingUpload
import com.vaadin.ui.Upload;
import org.apache.commons.io.IOUtils;
import org.vaadin.dialogs.ConfirmDialog;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
View ImageReplacerFieldGroup
/**
* Showcasing a custom FieldGroupGieldFactory that generates an UploadField(from https://vaadin.com/directory#addon/easyuploads)
* if the FieldGroup is trying to bind to a byte[] object property.
* The image instance is updated each time a new image is uploaded
*
* Ruiu Gabriel Mihai (gabriel.ruiu@mail.com)
*/
public class ImageReplacerFieldGroup extends FormLayout {
public ImageReplacerFieldGroup() {