// Path: forgetIT/src/forgetit/common/Category.java
// public enum Category {
// 	APPOINTMENT,
// 	NOTE,
// 	TODO;
// }
// 
// Path: forgetIT/src/forgetit/common/Entity.java
// @javax.persistence.Entity
// public class Entity implements Serializable {
// 
// 	private int id;
// 	private String title;
// 	private String description;
// 
// 	private Status status;
// 
// 	private Function priority;
// 
// 	private Date startDate;
// 
// 	private Date endDate;
// 
// 	private List<Tag> tags;
// 
// 	private List<Entity> dependencies; // All notes, that have to happen before
// 	private Category category;
// 
// 	public Entity() {
// 
// 		this.title = "";
// 		this.description = "";
// 		this.status = Status.IDLE;
// 		this.priority = new Function();
// 		this.startDate = new Date();
// 		this.endDate = new Date();
// 		this.tags = new LinkedList<Tag>();
// 	}
// 
// 	public String getTitle() {
// 
// 		return title;
// 	}
// 
// 	public void setTitle(String title) {
// 
// 		this.title = title;
// 	}
// 
// 	public String getDescription() {
// 
// 		return description;
// 	}
// 
// 	public void setDescription(String description) {
// 
// 		this.description = description;
// 	}
// 
// 	public Status getStatus() {
// 
// 		return status;
// 	}
// 
// 	public void setStatus(Status status) {
// 
// 		this.status = status;
// 	}
// 
// 	@OneToOne(mappedBy = "entity_id")
// 	public Function getPriority() {
// 
// 		if (priority == null) {
// 			return new Function();
// 		}
// 		return priority;
// 	}
// 
// 	public void setPriority(Function priority) {
// 
// 		this.priority = priority;
// 	}
// 
// 	@OneToOne(mappedBy = "entity_id")
// 	public Date getStartDate() {
// 
// 		return startDate;
// 	}
// 
// 	public void setStartDate(Date startDate) {
// 
// 		this.startDate = startDate;
// 	}
// 
// 	@OneToOne(mappedBy = "entity_id")
// 	public Date getEndDate() {
// 
// 		return endDate;
// 	}
// 
// 	public void setEndDate(Date endDate) {
// 
// 		this.endDate = endDate;
// 	}
// 
// 	@ManyToMany(targetEntity = forgetit.common.Tag.class, cascade = { CascadeType.ALL, CascadeType.PERSIST,
// 			CascadeType.MERGE })
// 	@JoinTable(name = "ENTITY_TAG", joinColumns = @JoinColumn(name = "ENTITY_ID"), inverseJoinColumns = @JoinColumn(name = "TAG_ID"))
// 	public List<Tag> getTags() {
// 
// 		return tags;
// 	}
// 
// 	public void setTags(List<Tag> tags) {
// 
// 		this.tags = tags;
// 	}
// 
// 	@OneToMany
// 	public List<Entity> getDependencies() {
// 
// 		return dependencies;
// 	}
// 
// 	public void setDependencies(List<Entity> dependencies) {
// 
// 		this.dependencies = dependencies;
// 	}
// 
// 	@Id
// 	@GeneratedValue
// 	public int getId() {
// 
// 		return id;
// 	}
// 
// 	public Category getCategory() {
// 
// 		return category;
// 	}
// 
// 	public void setCategory(Category category) {
// 
// 		this.category = category;
// 	}
// 
// 	public void setId(int id) {
// 
// 		this.id = id;
// 	}
// 
// }


import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import forgetit.common.Category;
import forgetit.common.Entity;
/*
 * Copyright 2011 DHBW Stuttgart Campus Horb
 *
 * 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 forgetit.gui.views;




/**
 * The view for notes
 * 
 * The outer design (borders, titles, ...) of this view is dependent on StandardView.
 * Through IEntitiesView this view can be refreshed by GraphicsController.
 * 
 * @author ChornHulio (<a href="mailto:[chornhulio@web.de]">chornhulio@web.de</a>)
 * @since 0.1
 */
public class ViewNotes extends StandardView implements IEntitiesView {

	Composite parent;
	Table table;

	public ViewNotes(Composite parent) {
		super(parent, "Notes");
		this.parent = parent;
		this.table = null;
		initGui();
	}

	private void initGui() {
		GridLayout layout = new GridLayout();
		layout.numColumns = 1;
		content.setLayout(layout);
		
		// init a new table
		table = new Table (content, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
		table.setLinesVisible (true);
		table.setHeaderVisible (true);
		table.setVisible(false);
		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
		table.setLayoutData(gridData);
		
		// set titles of the table
		String[] titles = {"Title", "Description"};
		for (int i=0; i < titles.length; i++) {
			TableColumn column = new TableColumn (table, SWT.NONE);
			column.setText (titles [i]);
		}
	}

	@Override
// Path: forgetIT/src/forgetit/common/Category.java
// public enum Category {
// 	APPOINTMENT,
// 	NOTE,
// 	TODO;
// }
// 
// Path: forgetIT/src/forgetit/common/Entity.java
// @javax.persistence.Entity
// public class Entity implements Serializable {
// 
// 	private int id;
// 	private String title;
// 	private String description;
// 
// 	private Status status;
// 
// 	private Function priority;
// 
// 	private Date startDate;
// 
// 	private Date endDate;
// 
// 	private List<Tag> tags;
// 
// 	private List<Entity> dependencies; // All notes, that have to happen before
// 	private Category category;
// 
// 	public Entity() {
// 
// 		this.title = "";
// 		this.description = "";
// 		this.status = Status.IDLE;
// 		this.priority = new Function();
// 		this.startDate = new Date();
// 		this.endDate = new Date();
// 		this.tags = new LinkedList<Tag>();
// 	}
// 
// 	public String getTitle() {
// 
// 		return title;
// 	}
// 
// 	public void setTitle(String title) {
// 
// 		this.title = title;
// 	}
// 
// 	public String getDescription() {
// 
// 		return description;
// 	}
// 
// 	public void setDescription(String description) {
// 
// 		this.description = description;
// 	}
// 
// 	public Status getStatus() {
// 
// 		return status;
// 	}
// 
// 	public void setStatus(Status status) {
// 
// 		this.status = status;
// 	}
// 
// 	@OneToOne(mappedBy = "entity_id")
// 	public Function getPriority() {
// 
// 		if (priority == null) {
// 			return new Function();
// 		}
// 		return priority;
// 	}
// 
// 	public void setPriority(Function priority) {
// 
// 		this.priority = priority;
// 	}
// 
// 	@OneToOne(mappedBy = "entity_id")
// 	public Date getStartDate() {
// 
// 		return startDate;
// 	}
// 
// 	public void setStartDate(Date startDate) {
// 
// 		this.startDate = startDate;
// 	}
// 
// 	@OneToOne(mappedBy = "entity_id")
// 	public Date getEndDate() {
// 
// 		return endDate;
// 	}
// 
// 	public void setEndDate(Date endDate) {
// 
// 		this.endDate = endDate;
// 	}
// 
// 	@ManyToMany(targetEntity = forgetit.common.Tag.class, cascade = { CascadeType.ALL, CascadeType.PERSIST,
// 			CascadeType.MERGE })
// 	@JoinTable(name = "ENTITY_TAG", joinColumns = @JoinColumn(name = "ENTITY_ID"), inverseJoinColumns = @JoinColumn(name = "TAG_ID"))
// 	public List<Tag> getTags() {
// 
// 		return tags;
// 	}
// 
// 	public void setTags(List<Tag> tags) {
// 
// 		this.tags = tags;
// 	}
// 
// 	@OneToMany
// 	public List<Entity> getDependencies() {
// 
// 		return dependencies;
// 	}
// 
// 	public void setDependencies(List<Entity> dependencies) {
// 
// 		this.dependencies = dependencies;
// 	}
// 
// 	@Id
// 	@GeneratedValue
// 	public int getId() {
// 
// 		return id;
// 	}
// 
// 	public Category getCategory() {
// 
// 		return category;
// 	}
// 
// 	public void setCategory(Category category) {
// 
// 		this.category = category;
// 	}
// 
// 	public void setId(int id) {
// 
// 		this.id = id;
// 	}
// 
// }


// Path: forgetIT/src/forgetit/gui/views/ViewNotes.java
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import forgetit.common.Category;
import forgetit.common.Entity;

/*
 * Copyright 2011 DHBW Stuttgart Campus Horb
 *
 * 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 forgetit.gui.views;




/**
 * The view for notes
 * 
 * The outer design (borders, titles, ...) of this view is dependent on StandardView.
 * Through IEntitiesView this view can be refreshed by GraphicsController.
 * 
 * @author ChornHulio (<a href="mailto:[chornhulio@web.de]">chornhulio@web.de</a>)
 * @since 0.1
 */
public class ViewNotes extends StandardView implements IEntitiesView {

	Composite parent;
	Table table;

	public ViewNotes(Composite parent) {
		super(parent, "Notes");
		this.parent = parent;
		this.table = null;
		initGui();
	}

	private void initGui() {
		GridLayout layout = new GridLayout();
		layout.numColumns = 1;
		content.setLayout(layout);
		
		// init a new table
		table = new Table (content, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
		table.setLinesVisible (true);
		table.setHeaderVisible (true);
		table.setVisible(false);
		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
		table.setLayoutData(gridData);
		
		// set titles of the table
		String[] titles = {"Title", "Description"};
		for (int i=0; i < titles.length; i++) {
			TableColumn column = new TableColumn (table, SWT.NONE);
			column.setText (titles [i]);
		}
	}

	@Override
	public void refreshView(List<Entity> entities) {