// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/LocalResourceWatcher.java
// public interface LocalResourceWatcher {
// 	public void addLocalResource(File file);
// 	public void removeLocalResource(File file);
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/SimpleFileMenu.java
// public class SimpleFileMenu extends DynamicMenuImpl implements ApplicationMenu{
// 	private static final long serialVersionUID=4968428219495753712L;
// 	
// 	private MenuItem fileMenuItem;
// 	private MenuItem editMenuItem;
// 	private MenuItem viewMenuItem;
// 
// 	private MenuItem restartFileMenuItem;
// 	
// 	public SimpleFileMenu(){
// 		super();
// 		setup();
// 	}
// 
// 	@Override
// 	public MenuItem getFileMenu(){
// 		return fileMenuItem;
// 	}
// 
// 	@Override
// 	public MenuItem getEditMenu() {
// 		return editMenuItem;
// 	}
// 
// 	@Override
// 	public MenuItem getViewMenu() {
// 		return viewMenuItem;
// 	}
// 
// 	@Override
// 	public MenuBar getMenuBar() {
// 		return this;
// 	}
// 
// 	@Override
// 	public void setup() {
// 		fileMenuItem=addItem("File",null);
// 		editMenuItem=addItem("Edit",null);
// 		viewMenuItem=addItem("View",null);
// 		
// 		fileMenuItem.setVisible(false);
// 		editMenuItem.setVisible(false);
// 		viewMenuItem.setVisible(false);
// 		
// 		restartFileMenuItem=getFileMenu().addItem("Restart", new Command(){
// 			private static final long serialVersionUID = -5533996368035711854L;
// 
// 			@Override
// 			public void menuSelected(MenuItem selectedItem){
// 				URI currentLocation = UI.getCurrent().getPage().getLocation();
// 				UI.getCurrent().getPage().setLocation(currentLocation.toString() + "?restartApplication");
// 				UI.getCurrent().getPage().setLocation(currentLocation);
// 			}
// 		});
// 		
// 		setWidth(100.0f, Unit.PERCENTAGE);
// 	}
// 
// 	@Override
// 	public MenuItem getRestartFileMenuItem() {
// 		return restartFileMenuItem;
// 	}
// 
// 	@Override
// 	public void appendFinalItems() {
// 		// TODO Auto-generated method stub
// 		
// 	}
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanCanvas.java
// public interface GlycanCanvasUpdateListener {
// 	public void glycanCanvasUpdated();
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanCanvas.java
// public interface NotationChangedListener {
// 	public void notationChanged(String notation);
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanCanvas.java
// public interface ResidueHistoryListener{
// 	public void respondToResidueHistoryChanged(Vector<String> residueHistory);
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/menu/ApplicationMenu.java
// public interface ApplicationMenu extends DynamicMenu{
// 	public MenuBar.MenuItem getFileMenu();
// 	public MenuBar.MenuItem getRestartFileMenuItem();
// 	public MenuBar.MenuItem getEditMenu();
// 	public MenuBar.MenuItem getViewMenu();
// 	public MenuBar getMenuBar();
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.eurocarbdb.application.glycanbuilder.BuilderWorkspace;
import org.eurocarbdb.application.glycanbuilder.Residue;
import ac.uk.icl.dell.vaadin.LocalResourceWatcher;
import ac.uk.icl.dell.vaadin.SimpleFileMenu;
import ac.uk.icl.dell.vaadin.glycanbuilder.GlycanCanvas.GlycanCanvasUpdateListener;
import ac.uk.icl.dell.vaadin.glycanbuilder.GlycanCanvas.NotationChangedListener;
import ac.uk.icl.dell.vaadin.glycanbuilder.GlycanCanvas.ResidueHistoryListener;
import ac.uk.icl.dell.vaadin.menu.ApplicationMenu;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.Panel;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window.ResizeEvent;
	private void initFileMenu(){
		fileMenu=theAppMenu.getFileMenu();
		
		theAppMenu.saveState(fileMenu, this);
		
		theCanvas.appendExportMenu(fileMenu,theAppMenu.getRestartFileMenuItem());
		theCanvas.appendImportMenu(fileMenu,theAppMenu.getRestartFileMenuItem());
		
		fileMenu.setVisible(true);
	}
	
	public MenuItem getFileMenu(){
		return fileMenu;
	}
	
	public MenuBar getMenuBar(){
		return theAppMenu.getMenuBar();
	}
	
	private void initStructureMenu(){
		MenuBar dockMenuBar=theAppMenu.getMenuBar();
		
		//structureItem=dockMenuBar.addItemAfter("Structure", null, null, theAppMenu.getViewMenu());
		structureItem=dockMenuBar.addItem("Structure", null);
		
		theCanvas.appendStructureMenu(structureItem);
		menuItems.add(structureItem);
	}
	
	private void initViewMenu(){
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/LocalResourceWatcher.java
// public interface LocalResourceWatcher {
// 	public void addLocalResource(File file);
// 	public void removeLocalResource(File file);
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/SimpleFileMenu.java
// public class SimpleFileMenu extends DynamicMenuImpl implements ApplicationMenu{
// 	private static final long serialVersionUID=4968428219495753712L;
// 	
// 	private MenuItem fileMenuItem;
// 	private MenuItem editMenuItem;
// 	private MenuItem viewMenuItem;
// 
// 	private MenuItem restartFileMenuItem;
// 	
// 	public SimpleFileMenu(){
// 		super();
// 		setup();
// 	}
// 
// 	@Override
// 	public MenuItem getFileMenu(){
// 		return fileMenuItem;
// 	}
// 
// 	@Override
// 	public MenuItem getEditMenu() {
// 		return editMenuItem;
// 	}
// 
// 	@Override
// 	public MenuItem getViewMenu() {
// 		return viewMenuItem;
// 	}
// 
// 	@Override
// 	public MenuBar getMenuBar() {
// 		return this;
// 	}
// 
// 	@Override
// 	public void setup() {
// 		fileMenuItem=addItem("File",null);
// 		editMenuItem=addItem("Edit",null);
// 		viewMenuItem=addItem("View",null);
// 		
// 		fileMenuItem.setVisible(false);
// 		editMenuItem.setVisible(false);
// 		viewMenuItem.setVisible(false);
// 		
// 		restartFileMenuItem=getFileMenu().addItem("Restart", new Command(){
// 			private static final long serialVersionUID = -5533996368035711854L;
// 
// 			@Override
// 			public void menuSelected(MenuItem selectedItem){
// 				URI currentLocation = UI.getCurrent().getPage().getLocation();
// 				UI.getCurrent().getPage().setLocation(currentLocation.toString() + "?restartApplication");
// 				UI.getCurrent().getPage().setLocation(currentLocation);
// 			}
// 		});
// 		
// 		setWidth(100.0f, Unit.PERCENTAGE);
// 	}
// 
// 	@Override
// 	public MenuItem getRestartFileMenuItem() {
// 		return restartFileMenuItem;
// 	}
// 
// 	@Override
// 	public void appendFinalItems() {
// 		// TODO Auto-generated method stub
// 		
// 	}
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanCanvas.java
// public interface GlycanCanvasUpdateListener {
// 	public void glycanCanvasUpdated();
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanCanvas.java
// public interface NotationChangedListener {
// 	public void notationChanged(String notation);
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanCanvas.java
// public interface ResidueHistoryListener{
// 	public void respondToResidueHistoryChanged(Vector<String> residueHistory);
// }
// 
// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/menu/ApplicationMenu.java
// public interface ApplicationMenu extends DynamicMenu{
// 	public MenuBar.MenuItem getFileMenu();
// 	public MenuBar.MenuItem getRestartFileMenuItem();
// 	public MenuBar.MenuItem getEditMenu();
// 	public MenuBar.MenuItem getViewMenu();
// 	public MenuBar getMenuBar();
// }


// Path: glycanbuilderv/src/ac/uk/icl/dell/vaadin/glycanbuilder/GlycanBuilder.java
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.eurocarbdb.application.glycanbuilder.BuilderWorkspace;
import org.eurocarbdb.application.glycanbuilder.Residue;
import ac.uk.icl.dell.vaadin.LocalResourceWatcher;
import ac.uk.icl.dell.vaadin.SimpleFileMenu;
import ac.uk.icl.dell.vaadin.glycanbuilder.GlycanCanvas.GlycanCanvasUpdateListener;
import ac.uk.icl.dell.vaadin.glycanbuilder.GlycanCanvas.NotationChangedListener;
import ac.uk.icl.dell.vaadin.glycanbuilder.GlycanCanvas.ResidueHistoryListener;
import ac.uk.icl.dell.vaadin.menu.ApplicationMenu;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.Panel;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window.ResizeEvent;

	private void initFileMenu(){
		fileMenu=theAppMenu.getFileMenu();
		
		theAppMenu.saveState(fileMenu, this);
		
		theCanvas.appendExportMenu(fileMenu,theAppMenu.getRestartFileMenuItem());
		theCanvas.appendImportMenu(fileMenu,theAppMenu.getRestartFileMenuItem());
		
		fileMenu.setVisible(true);
	}
	
	public MenuItem getFileMenu(){
		return fileMenu;
	}
	
	public MenuBar getMenuBar(){
		return theAppMenu.getMenuBar();
	}
	
	private void initStructureMenu(){
		MenuBar dockMenuBar=theAppMenu.getMenuBar();
		
		//structureItem=dockMenuBar.addItemAfter("Structure", null, null, theAppMenu.getViewMenu());
		structureItem=dockMenuBar.addItem("Structure", null);
		
		theCanvas.appendStructureMenu(structureItem);
		menuItems.add(structureItem);
	}
	
	private void initViewMenu(){
		MenuItem structureItem=theAppMenu.getViewMenu();