// Path: pigeon-common/src/main/java/com/trivago/mail/pigeon/bean/RecipientGroup.java
// public class RecipientGroup extends AbstractBean
// {
// 	public static final String ID = "group_id";
// 
// 	public static final String NAME = "name";
// 
// 	public static final String DATE = "date";
// 
// 	public RecipientGroup(final Node underlayingNode)
// 	{
// 		this.dataNode = underlayingNode;
// 	}
// 
// 	public RecipientGroup(final long groupId)
// 	{
// 		dataNode = ConnectionFactory.getGroupIndex().get(IndexTypes.GROUP_ID, groupId).getSingle();
// 		if (dataNode == null)
// 		{
// 			Transaction tx = ConnectionFactory.getDatabase().beginTx();
// 			try
// 			{
// 				dataNode = ConnectionFactory.getDatabase().createNode();
// 				writeProperty(ID, groupId);
// 				writeProperty("type", getClass().getName());
// 				writeProperty(NAME, "DefaultGroup");
// 				ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.GROUP_ID, groupId);
// 				ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.TYPE, getClass().getName());
// 				ConnectionFactory.getDatabase().getReferenceNode().createRelationshipTo(dataNode, RelationTypes.GROUP_REFERENCE);
// 
// 				tx.success();
// 			}
// 			catch (Exception e)
// 			{
// 				log.error(e);
// 				tx.failure();
// 			}
// 			finally
// 			{
// 				tx.finish();
// 			}
// 		}
// 	}
// 
// 	public RecipientGroup(final long groupId, final String name)
// 	{
// 		Transaction tx = ConnectionFactory.getDatabase().beginTx();
// 		try
// 		{
// 			dataNode = ConnectionFactory.getDatabase().createNode();
// 			writeProperty(ID, groupId);
// 			writeProperty("type", getClass().getName());
// 			writeProperty(NAME, name);
// 			ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.GROUP_ID, groupId);
// 			ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.TYPE, getClass().getName());
// 			ConnectionFactory.getDatabase().getReferenceNode().createRelationshipTo(dataNode, RelationTypes.GROUP_REFERENCE);
// 
// 			tx.success();
// 		}
// 		catch (Exception e)
// 		{
// 			log.error(e);
// 			tx.failure();
// 		}
// 		finally
// 		{
// 			tx.finish();
// 		}
// 
// 	}
// 
// 	public Node getDataNode()
// 	{
// 		return dataNode;
// 	}
// 
// 	public long getId()
// 	{
// 		return getProperty(Long.class, ID, false);
// 	}
// 
// 	public String getName()
// 	{
// 		return getProperty(String.class, NAME);
// 	}
// 
// 	public Relationship addRecipient(Recipient recipient)
// 	{
// 		Transaction tx = ConnectionFactory.getDatabase().beginTx();
// 		Relationship relation = null;
// 		try
// 		{
// 			Node recipientNode = recipient.getDataNode();
// 			relation = dataNode.createRelationshipTo(recipientNode, RelationTypes.BELONGS_TO_GROUP);
// 			relation.setProperty(DATE, new Date().getTime());
// 			tx.success();
// 
// 		}
// 		catch (Exception e)
// 		{
// 			log.error(e);
// 			tx.failure();
// 		}
// 		finally
// 		{
// 			tx.finish();
// 		}
// 		return relation;
// 	}
// 
// 	public Iterable<Relationship> getRecipients()
// 	{
// 		return dataNode.getRelationships(RelationTypes.BELONGS_TO_GROUP);
// 	}
// 
// 	public static IndexHits<Node> getAll()
// 	{
// 		return ConnectionFactory.getGroupIndex().get("type", RecipientGroup.class.getName());
// 	}
// 
// 	public void setName(String name)
// 	{
// 		writeProperty(NAME, name);
// 	}
// }


import com.trivago.mail.pigeon.bean.RecipientGroup;
import com.vaadin.data.util.BeanContainer;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.*;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.index.IndexHits;
import java.util.ArrayList;
import java.util.List;
/**
 * Copyright (C) 2011-2012 trivago GmbH <mario.mueller@trivago.com>, <christian.krause@trivago.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.trivago.mail.pigeon.web.components.groups;



public class GroupList extends CustomComponent
{
	private Table viewTable;

// Path: pigeon-common/src/main/java/com/trivago/mail/pigeon/bean/RecipientGroup.java
// public class RecipientGroup extends AbstractBean
// {
// 	public static final String ID = "group_id";
// 
// 	public static final String NAME = "name";
// 
// 	public static final String DATE = "date";
// 
// 	public RecipientGroup(final Node underlayingNode)
// 	{
// 		this.dataNode = underlayingNode;
// 	}
// 
// 	public RecipientGroup(final long groupId)
// 	{
// 		dataNode = ConnectionFactory.getGroupIndex().get(IndexTypes.GROUP_ID, groupId).getSingle();
// 		if (dataNode == null)
// 		{
// 			Transaction tx = ConnectionFactory.getDatabase().beginTx();
// 			try
// 			{
// 				dataNode = ConnectionFactory.getDatabase().createNode();
// 				writeProperty(ID, groupId);
// 				writeProperty("type", getClass().getName());
// 				writeProperty(NAME, "DefaultGroup");
// 				ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.GROUP_ID, groupId);
// 				ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.TYPE, getClass().getName());
// 				ConnectionFactory.getDatabase().getReferenceNode().createRelationshipTo(dataNode, RelationTypes.GROUP_REFERENCE);
// 
// 				tx.success();
// 			}
// 			catch (Exception e)
// 			{
// 				log.error(e);
// 				tx.failure();
// 			}
// 			finally
// 			{
// 				tx.finish();
// 			}
// 		}
// 	}
// 
// 	public RecipientGroup(final long groupId, final String name)
// 	{
// 		Transaction tx = ConnectionFactory.getDatabase().beginTx();
// 		try
// 		{
// 			dataNode = ConnectionFactory.getDatabase().createNode();
// 			writeProperty(ID, groupId);
// 			writeProperty("type", getClass().getName());
// 			writeProperty(NAME, name);
// 			ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.GROUP_ID, groupId);
// 			ConnectionFactory.getGroupIndex().add(this.dataNode, IndexTypes.TYPE, getClass().getName());
// 			ConnectionFactory.getDatabase().getReferenceNode().createRelationshipTo(dataNode, RelationTypes.GROUP_REFERENCE);
// 
// 			tx.success();
// 		}
// 		catch (Exception e)
// 		{
// 			log.error(e);
// 			tx.failure();
// 		}
// 		finally
// 		{
// 			tx.finish();
// 		}
// 
// 	}
// 
// 	public Node getDataNode()
// 	{
// 		return dataNode;
// 	}
// 
// 	public long getId()
// 	{
// 		return getProperty(Long.class, ID, false);
// 	}
// 
// 	public String getName()
// 	{
// 		return getProperty(String.class, NAME);
// 	}
// 
// 	public Relationship addRecipient(Recipient recipient)
// 	{
// 		Transaction tx = ConnectionFactory.getDatabase().beginTx();
// 		Relationship relation = null;
// 		try
// 		{
// 			Node recipientNode = recipient.getDataNode();
// 			relation = dataNode.createRelationshipTo(recipientNode, RelationTypes.BELONGS_TO_GROUP);
// 			relation.setProperty(DATE, new Date().getTime());
// 			tx.success();
// 
// 		}
// 		catch (Exception e)
// 		{
// 			log.error(e);
// 			tx.failure();
// 		}
// 		finally
// 		{
// 			tx.finish();
// 		}
// 		return relation;
// 	}
// 
// 	public Iterable<Relationship> getRecipients()
// 	{
// 		return dataNode.getRelationships(RelationTypes.BELONGS_TO_GROUP);
// 	}
// 
// 	public static IndexHits<Node> getAll()
// 	{
// 		return ConnectionFactory.getGroupIndex().get("type", RecipientGroup.class.getName());
// 	}
// 
// 	public void setName(String name)
// 	{
// 		writeProperty(NAME, name);
// 	}
// }


// Path: pigeon-web/src/main/java/com/trivago/mail/pigeon/web/components/groups/GroupList.java
import com.trivago.mail.pigeon.bean.RecipientGroup;
import com.vaadin.data.util.BeanContainer;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.*;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.index.IndexHits;
import java.util.ArrayList;
import java.util.List;

/**
 * Copyright (C) 2011-2012 trivago GmbH <mario.mueller@trivago.com>, <christian.krause@trivago.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.trivago.mail.pigeon.web.components.groups;



public class GroupList extends CustomComponent
{
	private Table viewTable;

	private BeanContainer<Long, RecipientGroup> beanContainer;