Commits

Alireza Savand committed 8d48426

initialed for non sake :|

Comments (0)

Files changed (5)

WebContent/META-INF/MANIFEST.MF

+Manifest-Version: 1.0
+Class-Path: 
+

WebContent/WEB-INF/lib/vaadin-6.7.7.jar

Binary file added.

WebContent/WEB-INF/web.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
+  <display-name>AdvanceAddressBook</display-name>
+  <context-param>
+  	<description>
+  	Vaadin production mode</description>
+  	<param-name>productionMode</param-name>
+  	<param-value>false</param-value>
+  </context-param>
+  <servlet>
+  	<servlet-name>AdvanceAddressBook Application</servlet-name>
+  	<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
+  	<init-param>
+  		<description>
+  		Vaadin application class to start</description>
+  		<param-name>application</param-name>
+  		<param-value>com.example.advanceaddressbook.AdvanceAddressBookApplication</param-value>
+  	</init-param>
+  </servlet>
+  <servlet-mapping>
+  	<servlet-name>AdvanceAddressBook Application</servlet-name>
+  	<url-pattern>/*</url-pattern>
+  </servlet-mapping>
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+    <welcome-file>index.htm</welcome-file>
+    <welcome-file>index.jsp</welcome-file>
+    <welcome-file>default.html</welcome-file>
+    <welcome-file>default.htm</welcome-file>
+    <welcome-file>default.jsp</welcome-file>
+  </welcome-file-list>
+</web-app>

src/com/example/advanceaddressbook/AdvanceAddressBookApplication.java

+package com.example.advanceaddressbook;
+
+import com.example.advanceaddressbook.ui.NavigationTree;
+import com.vaadin.Application;
+import com.vaadin.ui.*;
+
+public class AdvanceAddressBookApplication extends Application {
+	
+	private Button newContact = new Button("Add Contact");
+	private Button search = new Button("Search");
+	private Button share = new Button("Share");
+	private Button help = new Button("Help");
+	private HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel();
+	private NavigationTree tree = new NavigationTree();
+	
+	@Override
+	public void init() {
+		buildMainLayout();
+		setTheme("runo");
+	}
+	
+	private void buildMainLayout() {
+		setMainWindow(new Window("Advance Address Book Demo Application"));
+		horizontalSplit.setFirstComponent(tree);
+		VerticalLayout layout = new VerticalLayout();
+		layout.setSizeFull();
+		
+		layout.addComponent(createToolbar());
+		layout.addComponent(horizontalSplit);
+		
+		/* Allocate all available extra space to the horizontal split panel */
+		layout.setExpandRatio(horizontalSplit, 1);
+		/* Set the initial split position so we can have a 200 pixel menu to the left */
+		horizontalSplit.setSplitPosition(200, HorizontalSplitPanel.UNITS_PIXELS);
+		
+		getMainWindow().setContent(layout);
+		
+	}
+
+	private Component createToolbar() {
+		HorizontalLayout lo = new HorizontalLayout();
+		lo.addComponent(newContact);
+		lo.addComponent(search);
+		lo.addComponent(share);
+		lo.addComponent(help);
+		
+		return lo;
+	}
+
+}

src/com/example/advanceaddressbook/ui/NavigationTree.java

+package com.example.advanceaddressbook.ui;
+
+import com.vaadin.ui.Tree;
+
+public class NavigationTree extends Tree {
+	public static final Object SHOW_ALL = "Show All";
+	public static final Object SEARCH = "Search";
+	
+	public NavigationTree() {
+		addItem(SHOW_ALL);
+		addItem(SEARCH);
+	}
+}