diff options
871 files changed, 144 insertions, 22111 deletions
diff --git a/build/build.xml b/build/build.xml index a20f81fceb..38a1a3d871 100644 --- a/build/build.xml +++ b/build/build.xml @@ -188,7 +188,6 @@ <!-- Called only when building installation packages. --> <target name="package-init"> - <!-- <property name="build.sampler.disabled" value="false"/> --> </target> <target name="init" depends="check-java-version, init-platform"> @@ -669,46 +668,103 @@ NOTE: Replaces <version></version> tags with build version tag for some "textual" files --> <target name="preprocess-src"> + <!-- + Source directories in the project are + * src (Vaadin core) + * demo/src (Demos and examples) + * tests/src (Test cases) + + These are copied to + * {$result-path}/src/core + * {$result-path}/src/demo + * {$result-path}/src/tests + + Java/HTML/CSS/XML files are filtered so the license is added and the version is set. + Other files are just copied. + + If build.include.tests is not set, then "{$result-path}/src/tests" is created but no files are copied to it. + --> + <loadfile property="ITMillApache2LicenseForJavaFiles" srcFile="build/ITMillApache2LicenseForJavaFiles.txt" /> <mkdir dir="${result-path}/src" /> + + <mkdir dir="${result-path}/src/core" /> + <mkdir dir="${result-path}/src/demo" /> + <mkdir dir="${result-path}/src/tests" /> + + <patternset id="preprocessable-files"> + <include name="**/*.java" /> + <include name="**/*.html" /> + <include name="**/*.css" /> + <include name="**/*.xml" /> + </patternset> + <patternset id="non-preprocessable-files"> + <exclude name="**/.svn" /> + <exclude name="**/*.java" /> + <exclude name="**/*.html" /> + <exclude name="**/*.css" /> + <exclude name="**/*.xml" /> + </patternset> + <filterset id="version-and-license"> + <filter token="ITMillApache2LicenseForJavaFiles" value="${ITMillApache2LicenseForJavaFiles}" /> + <filter token="VERSION" value="${version.full}" /> + </filterset> + <echo>Copying src directory and processing copied files.</echo> <echo>Replacing <version> tag with build version for java/html/css/xml files.</echo> - <copy todir="${result-path}/src"> - <filterset> - <filter token="ITMillApache2LicenseForJavaFiles" value="${ITMillApache2LicenseForJavaFiles}" /> - <filter token="VERSION" value="${version.full}" /> - </filterset> + <copy todir="${result-path}/src/core"> + <filterset refid="version-and-license"/> <fileset dir="src"> - <patternset> - <include name="**/*.java" /> - <include name="**/*.html" /> - <include name="**/*.css" /> - <include name="**/*.xml" /> - <exclude name="**/tests/**" unless="build.include.tests"/> - <exclude name="**/demo/sampler/**" if="build.sampler.disabled" /> - </patternset> + <patternset refid="preprocessable-files" /> </fileset> </copy> + <copy todir="${result-path}/src/demo"> + <filterset refid="version-and-license"/> + <fileset dir="demo/src"> + <patternset refid="preprocessable-files" /> + </fileset> + </copy> + + + <antcontrib:if> + <isset property="build.include.tests"/> + <then> + <copy todir="${result-path}/src/tests"> + <filterset refid="version-and-license"/> + <fileset dir="tests/src"> + <patternset refid="preprocessable-files" /> + </fileset> + </copy> + </then> + </antcontrib:if> + <!-- Unify mix usage of mac/Linux/Win characters --> <echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo> <fixcrlf srcdir="${result-path}/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" /> <!-- Add other files such as images, these are not filtered or processed by fixcrlf task --> <echo>Copying non java/html/css/xml files such as images.</echo> - <copy todir="${result-path}/src"> + <copy todir="${result-path}/src/core"> <fileset dir="src"> - <patternset> - <exclude name="**/.svn" /> - <exclude name="**/*.java" /> - <exclude name="**/*.html" /> - <exclude name="**/*.css" /> - <exclude name="**/*.xml" /> - <exclude name="**/tests/**" unless="build.include.tests"/> - <exclude name="**/demo/sampler/**" if="build.sampler.disabled" /> - </patternset> - </fileset> + <patternset refid="non-preprocessable-files" /> + </fileset> + </copy> + <copy todir="${result-path}/src/demo"> + <fileset dir="demo/src"> + <patternset refid="non-preprocessable-files" /> + </fileset> </copy> + <antcontrib:if> + <isset property="build.include.tests"/> + <then> + <copy todir="${result-path}/src/tests"> + <fileset dir="tests/src"> + <patternset refid="non-preprocessable-files" /> + </fileset> + </copy> + </then> + </antcontrib:if> </target> @@ -737,9 +793,8 @@ <!-- Add demo sources --> <echo>Adding demo sources to WebContent/WEB-INF/src</echo> <copy todir="${output-dir}/WebContent/WEB-INF/src"> - <fileset dir="${result-path}/src"> - <include name="${toolkit-package}/demo/**/*" /> - <exclude name="${toolkit-package}/demo/sampler/**" if="build.sampler.disabled" /> + <fileset dir="${result-path}/src/demo"> + <include name="**/*" /> </fileset> </copy> @@ -757,7 +812,6 @@ <exclude name="VAADIN/themes/tests-magi/**/*" /> <exclude name="VAADIN/themes/tests-featurebrowser/**/*" /> <exclude name="VAADIN/themes/tests*/**/*"/> - <exclude name="VAADIN/themes/sampler/**" if="build.sampler.disabled" /> <include name="demo/**/*" /> <include name="WEB-INF/lib/hsqldb.jar" /> @@ -797,12 +851,14 @@ <target name="compile-java" depends="init, unpack-gwt, check-servlet-version, compile-fileupload, webcontent"> <echo>Compiling src (server-side)</echo> - <!-- Compile --> + + <!-- Compile all sources at the same time as they depend on each other --> <mkdir dir="${result-path}/classes" /> <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> - <src path="${result-path}/src"/> - <!-- This seems to be included by default: include name="${toolkit-package}/**"/ --> - <exclude name="${toolkit-package}/demo/sampler/**" if="build.sampler.disabled" /> + <src path="${result-path}/src/core"/> + <src path="${result-path}/src/demo"/> + <src path="${result-path}/src/tests"/> + <exclude name="${toolkit-package}/tests/**" unless="build.include.tests"/> </javac> </target> @@ -849,7 +905,7 @@ <target name="compile-widgetset-generator-only" depends="init, preprocess-src, compile-java"> <mkdir dir="${result-path}/classes"/> <javac source="1.5" target="1.5" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> - <src path="${result-path}/src"/> + <src path="${result-path}/src/core"/> <include name="com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java" /> <!-- <exclude name="**"/> --> <classpath> @@ -864,45 +920,45 @@ <!-- The widgetset generator is currently compiled along with rest of server-side Java. --> <target name="compile-widgetset-generator" depends="init, preprocess-src, compile-java"/> - <target name="compile-widgetset-default"> - <echo>Widget set output directory: ${widgetsets-output-dir}</echo> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.terminal.gwt.DefaultWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/classes" /> - <pathelement location="${result-path}/src" /> - </classpath> - </java> + + <path id="widgetset-compile-classpath"> + <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> + <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> + <pathelement location="${result-path}/classes" /> + <pathelement location="${result-path}/src/core" /> + <pathelement location="${result-path}/src/demo" /> + </path> + + <target name="compile-widgetset" description="Compiles the widgetset given as the first parameter"> + <fail unless="widgetset" message="No widgetset parameter set"/> + <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo> + <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> + <classpath refid="widgetset-compile-classpath"/> + + <arg value="-war" /> + <arg value="${widgetsets-output-dir}" /> + <arg value="-style" /> + <arg value="OBF" /> + <arg value="${widgetset}" /> + + <jvmarg value="-Xss8M"/> + <jvmarg value="-Djava.awt.headless=true"/> + </java> <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled DefaultWidgetSet</echo> + + <echo>Compiled ${widgetset}</echo> + </target> + + <target name="compile-widgetset-default"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.terminal.gwt.DefaultWidgetSet"/> + </antcall> </target> - + <target name="compile-widgetset-portal-default"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.portal.gwt.PortalDefaultWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled PortalDefaultWidgetSet</echo> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/> + </antcall> </target> <target name="compile-widgetset-reserver"> @@ -923,7 +979,8 @@ <classpath> <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> + <pathelement location="${result-path}/src/core" /> + <pathelement location="${result-path}/src/demo" /> <!-- demo jars --> <pathelement location="${googlemaps-jar}" /> <!-- demo widgetset sources --> @@ -935,73 +992,22 @@ <echo>Compiled ReservationWidgetSet</echo> </target> - <!-- Building Sampler for installation package is disabled. --> - <target name="compile-widgetset-sampler" unless="build.sampler.disabled"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.demo.sampler.gwt.SamplerWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <!-- demo widgetset sources --> - <pathelement path="${output-dir}/WebContent/WEB-INF/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled SamplerWidgetSet</echo> - </target> - - <target name="compile-widgetset-coverflow"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.demo.coverflow.gwt.CoverflowWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <!-- demo widgetset sources --> - <pathelement path="${output-dir}/WebContent/WEB-INF/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled CoverflowWidgetSet</echo> - </target> + <target name="compile-widgetset-sampler"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.demo.sampler.gwt.SamplerWidgetSet"/> + </antcall> + </target> + <target name="compile-widgetset-coverflow"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.demo.coverflow.gwt.CoverflowWidgetSet"/> + </antcall> + </target> + <target name="compile-widgetset-colorpicker"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet"/> + </antcall> + </target> - <target name="compile-widgetset-colorpicker"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <!-- demo widgetset sources --> - <pathelement path="${output-dir}/WebContent/WEB-INF/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled ColorPickerWidgetSet</echo> - </target> - <!-- Builds the client-side engine, i.e., the widgetsets sequentially. --> <!-- Notice that antcall does not fulfill dependencies. --> <target name="compile-client-side-sequential" unless="build.parallel"> @@ -1236,11 +1242,8 @@ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="javadoc" depends="init, preprocess-src"> <javadoc destdir="${output-dir}/WebContent/docs/api" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath.client-side"> - <packageset dir="${result-path}/src"> + <packageset dir="${result-path}/src/core"> <include name="${toolkit-package}/**" /> - <exclude name="${toolkit-package}/demo/**" /> - <!-- <exclude name="${toolkit-package}/tests/**" /> --> - <exclude name="${toolkit-package}/automatedtests/**" /> </packageset> <doctitle>${javadoc.doctitle}</doctitle> <!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> --> diff --git a/src/com/vaadin/demo/Calc.java b/src/com/vaadin/demo/Calc.java deleted file mode 100644 index d2a0d3e25a..0000000000 --- a/src/com/vaadin/demo/Calc.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.vaadin.demo; - -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -// Calculator is created by extending Application-class. Application is -// deployed by adding ApplicationServlet to web.xml and this class as -// "application" parameter to the servlet. -@SuppressWarnings("serial") -public class Calc extends com.vaadin.Application { - - // Calculation data model is automatically stored in the user session - private double current = 0.0; - private double stored = 0.0; - private char lastOperationRequested = 'C'; - - // User interface components - private final Label display = new Label("0.0"); - private final GridLayout layout = new GridLayout(4, 5); - - // Application initialization creates UI and connects it to business logic - @Override - public void init() { - - // Place the layout to the browser main window - setMainWindow(new Window("Calculator Application", layout)); - - // Create and add the components to the layout - layout.addComponent(display, 0, 0, 3, 0); - for (String caption : new String[] { "7", "8", "9", "/", "4", "5", "6", - "*", "1", "2", "3", "-", "0", "=", "C", "+" }) { - Button button = new Button(caption, new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - - // On button click, calculate and show the result - display.setValue(calculate(event.getButton())); - } - }); - layout.addComponent(button); - } - } - - // Calculator "business logic" implemented here to keep the example minimal - private double calculate(Button buttonClicked) { - char requestedOperation = buttonClicked.getCaption().charAt(0); - if ('0' <= requestedOperation && requestedOperation <= '9') { - current = current * 10 - + Double.parseDouble("" + requestedOperation); - return current; - } - switch (lastOperationRequested) { - case '+': - stored += current; - break; - case '-': - stored -= current; - break; - case '/': - stored /= current; - break; - case '*': - stored *= current; - break; - case 'C': - stored = current; - break; - } - lastOperationRequested = requestedOperation; - current = 0.0; - if (requestedOperation == 'C') { - stored = 0.0; - } - return stored; - } -} diff --git a/src/com/vaadin/demo/HelloWorld.java b/src/com/vaadin/demo/HelloWorld.java deleted file mode 100644 index 4a1042709d..0000000000 --- a/src/com/vaadin/demo/HelloWorld.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.vaadin.demo; - -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class HelloWorld extends com.vaadin.Application { - - /** - * Init is invoked on application load (when a user accesses the application - * for the first time). - */ - @Override - public void init() { - - // Main window is the primary browser window - final Window main = new Window("Hello window"); - setMainWindow(main); - - // "Hello world" text is added to window as a Label component - main.addComponent(new Label("Hello World!")); - } -} diff --git a/src/com/vaadin/demo/PortletDemo.java b/src/com/vaadin/demo/PortletDemo.java deleted file mode 100644 index 6e3c3d6756..0000000000 --- a/src/com/vaadin/demo/PortletDemo.java +++ /dev/null @@ -1,155 +0,0 @@ -/**
- *
- */
-package com.vaadin.demo;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.gwt.server.PortletApplicationContext;
-import com.vaadin.terminal.gwt.server.PortletApplicationContext.PortletListener;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-
-/**
- * @author marc
- *
- */
-@SuppressWarnings("serial")
-public class PortletDemo extends Application {
-
- Window main = new Window();
- TextField tf = new TextField("Some value");
- Label userInfo = new Label();
- Link portletEdit = new Link();
- Link portletMax = new Link();
- Link someAction = null;
-
- @Override
- public void init() {
- main = new Window();
- setMainWindow(main);
-
- userInfo.setCaption("User info");
- userInfo.setContentMode(Label.CONTENT_PREFORMATTED);
- main.addComponent(userInfo);
-
- tf.setEnabled(false);
- tf.setImmediate(true);
- main.addComponent(tf);
-
- portletEdit.setEnabled(false);
- main.addComponent(portletEdit);
- portletMax.setEnabled(false);
- main.addComponent(portletMax);
-
- if (getContext() instanceof PortletApplicationContext) {
- PortletApplicationContext ctx = (PortletApplicationContext) getContext();
- ctx.addPortletListener(this, new DemoPortletListener());
- } else {
- getMainWindow().showNotification("Not inited via Portal!",
- Notification.TYPE_ERROR_MESSAGE);
- }
-
- }
-
- private class DemoPortletListener implements PortletListener {
-
- public void handleActionRequest(ActionRequest request,
- ActionResponse response) {
-
- main.addComponent(new Label("Action received"));
-
- }
-
- @SuppressWarnings("unchecked")
- public void handleRenderRequest(RenderRequest request,
- RenderResponse response) {
- // Portlet up-and-running, enable stuff
- portletEdit.setEnabled(true);
- portletMax.setEnabled(true);
-
- // Editable if we're in editmode
- tf.setEnabled((request.getPortletMode() == PortletMode.EDIT));
-
- // Show notification about current mode and state
- getMainWindow().showNotification(
- "Portlet status",
- "Mode: " + request.getPortletMode() + " State: "
- + request.getWindowState(),
- Notification.TYPE_WARNING_MESSAGE);
-
- // Display current user info
- Map uinfo = (Map) request.getAttribute(PortletRequest.USER_INFO);
- if (uinfo != null) {
- String s = "";
- for (Iterator it = uinfo.keySet().iterator(); it.hasNext();) {
- Object key = it.next();
- Object val = uinfo.get(key);
- s += key + ": " + val + "\n";
- }
- if (request.isUserInRole("administrator")) {
- s += "(administrator)";
- }
- userInfo.setValue(s);
- } else {
- userInfo.setValue("-");
- }
-
- // Create Edit/Done link (actionUrl)
- PortletURL url = response.createActionURL();
- try {
- url
- .setPortletMode((request.getPortletMode() == PortletMode.VIEW ? PortletMode.EDIT
- : PortletMode.VIEW));
- portletEdit.setResource(new ExternalResource(url.toString()));
- portletEdit
- .setCaption((request.getPortletMode() == PortletMode.VIEW ? "Edit"
- : "Done"));
- } catch (Exception e) {
- portletEdit.setEnabled(false);
- }
- // Create Maximize/Normal link (actionUrl)
- url = response.createActionURL();
- try {
- url
- .setWindowState((request.getWindowState() == WindowState.NORMAL ? WindowState.MAXIMIZED
- : WindowState.NORMAL));
- portletMax.setResource(new ExternalResource(url.toString()));
- portletMax
- .setCaption((request.getWindowState() == WindowState.NORMAL ? "Maximize"
- : "Back to normal"));
- } catch (Exception e) {
- portletMax.setEnabled(false);
- }
-
- if (someAction == null) {
- url = response.createActionURL();
- try {
- someAction = new Link("An action", new ExternalResource(url
- .toString()));
- main.addComponent(someAction);
- } catch (Exception e) {
- // Oops
- System.err.println("Could not create someAction: " + e);
- }
-
- }
-
- }
- }
-}
diff --git a/src/com/vaadin/demo/SimpleAddressBook.java b/src/com/vaadin/demo/SimpleAddressBook.java deleted file mode 100644 index 22f9c171ed..0000000000 --- a/src/com/vaadin/demo/SimpleAddressBook.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.vaadin.demo; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Button; -import com.vaadin.ui.Form; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class SimpleAddressBook extends Application { - - private static String[] fields = { "First Name", "Last Name", "Company", - "Mobile Phone", "Work Phone", "Home Phone", "Work Email", - "Home Email", "Street", "Zip", "City", "State", "Country" }; - private static String[] visibleCols = new String[] { "Last Name", - "First Name", "Company" }; - - private Table contactList = new Table(); - private Form contactEditor = new Form(); - private HorizontalLayout bottomLeftCorner = new HorizontalLayout(); - private Button contactRemovalButton; - private IndexedContainer addressBookData = createDummyData(); - - @Override - public void init() { - initLayout(); - initContactAddRemoveButtons(); - initAddressList(); - initFilteringControls(); - } - - private void initLayout() { - SplitPanel splitPanel = new SplitPanel( - SplitPanel.ORIENTATION_HORIZONTAL); - setMainWindow(new Window("Address Book", splitPanel)); - VerticalLayout left = new VerticalLayout(); - left.setSizeFull(); - left.addComponent(contactList); - contactList.setSizeFull(); - left.setExpandRatio(contactList, 1); - splitPanel.addComponent(left); - splitPanel.addComponent(contactEditor); - contactEditor.setSizeFull(); - contactEditor.getLayout().setMargin(true); - contactEditor.setImmediate(true); - bottomLeftCorner.setWidth("100%"); - left.addComponent(bottomLeftCorner); - } - - private void initContactAddRemoveButtons() { - // New item button - bottomLeftCorner.addComponent(new Button("+", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Object id = contactList.addItem(); - contactList.setValue(id); - } - })); - - // Remove item button - contactRemovalButton = new Button("-", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - contactList.removeItem(contactList.getValue()); - contactList.select(null); - } - }); - contactRemovalButton.setVisible(false); - bottomLeftCorner.addComponent(contactRemovalButton); - } - - private String[] initAddressList() { - contactList.setContainerDataSource(addressBookData); - contactList.setVisibleColumns(visibleCols); - contactList.setSelectable(true); - contactList.setImmediate(true); - contactList.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Object id = contactList.getValue(); - contactEditor.setItemDataSource(id == null ? null : contactList - .getItem(id)); - contactRemovalButton.setVisible(id != null); - } - }); - return visibleCols; - } - - private void initFilteringControls() { - for (final String pn : visibleCols) { - final TextField sf = new TextField(); - bottomLeftCorner.addComponent(sf); - sf.setWidth("100%"); - sf.setValue(pn); - sf.setImmediate(true); - bottomLeftCorner.setExpandRatio(sf, 1); - sf.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - addressBookData.removeContainerFilters(pn); - if (sf.toString().length() > 0 && !pn.equals(sf.toString())) { - addressBookData.addContainerFilter(pn, sf.toString(), - true, false); - } - getMainWindow().showNotification( - "" + addressBookData.size() + " matches found"); - } - }); - } - } - - private static IndexedContainer createDummyData() { - - String[] fnames = { "Peter", "Alice", "Joshua", "Mike", "Olivia", - "Nina", "Alex", "Rita", "Dan", "Umberto", "Henrik", "Rene", - "Lisa", "Marge" }; - String[] lnames = { "Smith", "Gordon", "Simpson", "Brown", "Clavel", - "Simons", "Verne", "Scott", "Allison", "Gates", "Rowling", - "Barks", "Ross", "Schneider", "Tate" }; - - IndexedContainer ic = new IndexedContainer(); - - for (String p : fields) { - ic.addContainerProperty(p, String.class, ""); - } - - for (int i = 0; i < 1000; i++) { - Object id = ic.addItem(); - ic.getContainerProperty(id, "First Name").setValue( - fnames[(int) (fnames.length * Math.random())]); - ic.getContainerProperty(id, "Last Name").setValue( - lnames[(int) (lnames.length * Math.random())]); - } - - return ic; - } - -} diff --git a/src/com/vaadin/demo/VaadinTunesLayout.java b/src/com/vaadin/demo/VaadinTunesLayout.java deleted file mode 100644 index e9066d8993..0000000000 --- a/src/com/vaadin/demo/VaadinTunesLayout.java +++ /dev/null @@ -1,334 +0,0 @@ -package com.vaadin.demo; - -import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Slider; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Window.Notification; - -/** - * Sample application layout, similar (almost identical) to Apple iTunes. - * - * @author IT Mill Ltd. - * - */ -@SuppressWarnings("serial") -public class VaadinTunesLayout extends Application { - - @Override - public void init() { - - /* - * We'll build the whole UI here, since the application will not contain - * any logic. Otherwise it would be more practical to separate parts of - * the UI into different classes and methods. - */ - - // Main (browser) window, needed in all Vaadin applications - VerticalLayout rootLayout = new VerticalLayout(); - final Window root = new Window("VaadinTunes", rootLayout); - - /* - * We'll attach the window to the browser view already here, so we won't - * forget it later. - */ - setMainWindow(root); - - root - .showNotification( - "This is an example of how you can do layouts in Vaadin.<br/>It is not a working sound player.", - Notification.TYPE_HUMANIZED_MESSAGE); - - // Our root window contains one VerticalLayout, let's make - // sure it's 100% sized, and remove unwanted margins - rootLayout.setSizeFull(); - rootLayout.setMargin(false); - - // Top area, containing playback and volume controls, play status, view - // modes and search - HorizontalLayout top = new HorizontalLayout(); - top.setWidth("100%"); - top.setMargin(false, true, false, true); // Enable horizontal margins - top.setSpacing(true); - - // Let's attach that one straight away too - root.addComponent(top); - - // Create the placeholders for all the components in the top area - HorizontalLayout playback = new HorizontalLayout(); - HorizontalLayout volume = new HorizontalLayout(); - HorizontalLayout status = new HorizontalLayout(); - HorizontalLayout viewmodes = new HorizontalLayout(); - ComboBox search = new ComboBox(); - - // Add the components and align them properly - top.addComponent(playback); - top.addComponent(volume); - top.addComponent(status); - top.addComponent(viewmodes); - top.addComponent(search); - top.setComponentAlignment(playback, "middle"); - top.setComponentAlignment(volume, "middle"); - top.setComponentAlignment(status, "middle center"); - top.setComponentAlignment(viewmodes, "middle"); - top.setComponentAlignment(search, "middle"); - - /* - * We want our status area to expand if the user resizes the root - * window, and we want it to accommodate as much space as there is - * available. All other components in the top layout should stay fixed - * sized, so we don't need to specify any expand ratios for them (they - * will automatically revert to zero after the following line). - */ - top.setExpandRatio(status, 1.0F); - - // Playback controls - Button prev = new NativeButton("Previous"); - Button play = new NativeButton("Play/pause"); - Button next = new NativeButton("Next"); - playback.addComponent(prev); - playback.addComponent(play); - playback.addComponent(next); - // Set spacing between the buttons - playback.setSpacing(true); - - // Volume controls - Button mute = new NativeButton("mute"); - Slider vol = new Slider(); - vol.setOrientation(Slider.ORIENTATION_HORIZONTAL); - vol.setWidth("100px"); - Button max = new NativeButton("max"); - volume.addComponent(mute); - volume.addComponent(vol); - volume.addComponent(max); - - // Status area - status.setWidth("80%"); - status.setSpacing(true); - - Button toggleVisualization = new NativeButton("Mode"); - Label timeFromStart = new Label("0:00"); - - // We'll need another layout to show currently playing track and - // progress - VerticalLayout trackDetails = new VerticalLayout(); - trackDetails.setWidth("100%"); - Label track = new Label("Track Name"); - Label album = new Label("Album Name - Artist"); - track.setWidth(null); - album.setWidth(null); - Slider progress = new Slider(); - progress.setOrientation(Slider.ORIENTATION_HORIZONTAL); - progress.setWidth("100%"); - trackDetails.addComponent(track); - trackDetails.addComponent(album); - trackDetails.addComponent(progress); - trackDetails.setComponentAlignment(track, "center"); - trackDetails.setComponentAlignment(album, "center"); - - Label timeToEnd = new Label("-4:46"); - Button jumpToTrack = new NativeButton("Show"); - - // Place all components to the status layout and align them properly - status.addComponent(toggleVisualization); - status.setComponentAlignment(toggleVisualization, "middle"); - status.addComponent(timeFromStart); - status.setComponentAlignment(timeFromStart, "bottom"); - status.addComponent(trackDetails); - status.addComponent(timeToEnd); - status.setComponentAlignment(timeToEnd, "bottom"); - status.addComponent(jumpToTrack); - status.setComponentAlignment(jumpToTrack, "middle"); - - // Then remember to specify the expand ratio - status.setExpandRatio(trackDetails, 1.0F); - - // View mode buttons - Button viewAsTable = new NativeButton("Table"); - Button viewAsGrid = new NativeButton("Grid"); - Button coverflow = new NativeButton("Coverflow"); - viewmodes.addComponent(viewAsTable); - viewmodes.addComponent(viewAsGrid); - viewmodes.addComponent(coverflow); - - /* - * That covers the top bar. Now let's move on to the sidebar and track - * listing - */ - - // We'll need one splitpanel to separate the sidebar and track listing - SplitPanel bottom = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - root.addComponent(bottom); - - // The splitpanel is by default 100% x 100%, but we'll need to adjust - // our main window layout to accomodate the height - ((VerticalLayout) root.getContent()).setExpandRatio(bottom, 1.0F); - - // Give the sidebar less space than the listing - bottom.setSplitPosition(200, SplitPanel.UNITS_PIXELS); - - // Let's add some content to the sidebar - // First, we need a layout to but all components in - VerticalLayout sidebar = new VerticalLayout(); - sidebar.setSizeFull(); - bottom.setFirstComponent(sidebar); - - /* - * Then we need some labels and buttons, and an album cover image The - * labels and buttons go into their own vertical layout, since we want - * the 'sidebar' layout to be expanding (cover image in the bottom). - * VerticalLayout is by default 100% wide. - */ - VerticalLayout selections = new VerticalLayout(); - Label library = new Label("Library"); - Button music = new NativeButton("Music"); - music.setWidth("100%"); - - Label store = new Label("Store"); - Button vaadinTunesStore = new NativeButton("VaadinTunes Store"); - vaadinTunesStore.setWidth("100%"); - Button purchased = new NativeButton("Purchased"); - purchased.setWidth("100%"); - - Label playlists = new Label("Playlists"); - Button genius = new NativeButton("Geniues"); - genius.setWidth("100%"); - Button recent = new NativeButton("Recently Added"); - recent.setWidth("100%"); - - // Lets add them to the 'selections' layout - selections.addComponent(library); - selections.addComponent(music); - selections.addComponent(store); - selections.addComponent(vaadinTunesStore); - selections.addComponent(purchased); - selections.addComponent(playlists); - selections.addComponent(genius); - selections.addComponent(recent); - - // Then add the selections to the sidebar, and set it expanding - sidebar.addComponent(selections); - sidebar.setExpandRatio(selections, 1.0F); - - // Then comes the cover artwork (we'll add the actual image in the - // themeing section) - Embedded cover = new Embedded("Currently Playing"); - sidebar.addComponent(cover); - - /* - * And lastly, we need the track listing table It should fill the whole - * left side of our bottom layout - */ - Table listing = new Table(); - listing.setSizeFull(); - listing.setSelectable(true); - bottom.setSecondComponent(listing); - - // Add the table headers - listing.addContainerProperty("Name", String.class, ""); - listing.addContainerProperty("Time", String.class, "0:00"); - listing.addContainerProperty("Artist", String.class, ""); - listing.addContainerProperty("Album", String.class, ""); - listing.addContainerProperty("Genre", String.class, ""); - listing.addContainerProperty("Rating", NativeSelect.class, - new NativeSelect()); - - // Lets populate the table with random data - String[] tracks = new String[] { "Red Flag", "Millstone", - "Not The Sun", "Breath", "Here We Are", "Deep Heaven", - "Her Voice Resides", "Natural Tan", "End It All", "Kings", - "Daylight Slaving", "Mad Man", "Resolve", "Teargas", - "African Air", "Passing Bird" }; - String[] times = new String[] { "4:12", "6:03", "5:43", "4:32", "3:42", - "4:45", "2:56", "9:34", "2:10", "3:44", "5:49", "6:30", "5:18", - "7:42", "3:13", "2:52" }; - String[] artists = new String[] { "Billy Talent", "Brand New", - "Breaking Benjamin", "Becoming The Archetype", - "Bullet For My Valentine", "Chasing Victory", "Chimaira", - "Danko Jones", "Deadlock", "Deftones", "From Autumn To Ashes", - "Haste The Day", "Four Year Strong", "In Flames", "Kemopetrol", - "John Legend" }; - String[] albums = new String[] { "Once Again", "The Caitiff Choir", - "The Devil And God", "Light Grenades", "Dicthonomy", - "Back In Black", "Dreamer", "Come Clarity", "Year Zero", - "Frames", "Fortress", "Phobia", "The Poison", "Manifesto", - "White Pony", "The Big Dirty" }; - String[] genres = new String[] { "Rock", "Metal", "Hardcore", "Indie", - "Pop", "Alternative", "Blues", "Jazz", "Hip Hop", - "Electronica", "Punk", "Hard Rock", "Dance", "R'n'B", "Gospel", - "Country" }; - for (int i = 0; i < 1000; i++) { - NativeSelect s = new NativeSelect(); - s.addItem("1 star"); - s.addItem("2 stars"); - s.addItem("3 stars"); - s.addItem("4 stars"); - s.addItem("5 stars"); - s.select(i % 5 + " stars"); - final int index = i % 16; - listing.addItem(new Object[] { tracks[index], times[index], - artists[index], albums[index], genres[index], s }, i); - } - - // We'll align the track time column to right as well - listing.setColumnAlignment("Time", Table.ALIGN_RIGHT); - - // TODO the footer - - // Now what's left to do? Themeing of course. - setTheme("vaadintunes"); - - /* - * Let's give a namespace to our application window. This way, if - * someone uses the same theme for different applications, we don't get - * unwanted style conflicts. - */ - root.setStyleName("tTunes"); - - top.setStyleName("top"); - top.setHeight("75px"); // Same as the background image height - - playback.setStyleName("playback"); - playback.setMargin(false, true, false, false); // Add right-side margin - play.setStyleName("play"); - next.setStyleName("next"); - prev.setStyleName("prev"); - playback.setComponentAlignment(prev, "middle"); - playback.setComponentAlignment(next, "middle"); - - volume.setStyleName("volume"); - mute.setStyleName("mute"); - max.setStyleName("max"); - vol.setWidth("78px"); - - status.setStyleName("status"); - status.setMargin(true); - status.setHeight("46px"); // Height of the background image - - toggleVisualization.setStyleName("toggle-vis"); - jumpToTrack.setStyleName("jump"); - - viewAsTable.setStyleName("viewmode-table"); - viewAsGrid.setStyleName("viewmode-grid"); - coverflow.setStyleName("viewmode-coverflow"); - - sidebar.setStyleName("sidebar"); - - music.setStyleName("selected"); - - cover.setSource(new ThemeResource("images/album-cover.jpg")); - // Because this is an image, it will retain it's aspect ratio - cover.setWidth("100%"); - } - -} diff --git a/src/com/vaadin/demo/colorpicker/ColorPicker.java b/src/com/vaadin/demo/colorpicker/ColorPicker.java deleted file mode 100644 index f423815060..0000000000 --- a/src/com/vaadin/demo/colorpicker/ColorPicker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.colorpicker; - -import java.util.Map; - -import com.vaadin.demo.colorpicker.gwt.client.ui.VColorPicker; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.ClientWidget; - -@SuppressWarnings("serial") -@ClientWidget(VColorPicker.class) -public class ColorPicker extends AbstractField { - - public ColorPicker() { - super(); - setValue(new String("white")); - } - - /** The property value of the field is a String. */ - @Override - public Class<?> getType() { - return String.class; - } - - /** Set the currently selected color. */ - public void setColor(String newcolor) { - // Sets the color name as the property of the component. - // Setting the property will automatically cause repainting of - // the component with paintContent(). - setValue(newcolor); - } - - /** Retrieve the currently selected color. */ - public String getColor() { - return (String) getValue(); - } - - /** Paint (serialize) the component for the client. */ - @Override - public void paintContent(PaintTarget target) throws PaintException { - // Superclass writes any common attributes in the paint target. - super.paintContent(target); - - // Add the currently selected color as a variable in the paint - // target. - target.addVariable(this, "colorname", getColor()); - } - - /** Deserialize changes received from client. */ - @SuppressWarnings("unchecked") - @Override - public void changeVariables(Object source, Map variables) { - // Sets the currently selected color - if (variables.containsKey("colorname") && !isReadOnly()) { - final String newValue = (String) variables.get("colorname"); - // Changing the property of the component will - // trigger a ValueChangeEvent - setValue(newValue, true); - } - } -} diff --git a/src/com/vaadin/demo/colorpicker/ColorPickerApplication.java b/src/com/vaadin/demo/colorpicker/ColorPickerApplication.java deleted file mode 100644 index f604702a24..0000000000 --- a/src/com/vaadin/demo/colorpicker/ColorPickerApplication.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.colorpicker; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -/** - * Demonstration application that shows how to use a simple custom client-side - * GWT component, the ColorPicker. - */ -@SuppressWarnings("serial") -public class ColorPickerApplication extends com.vaadin.Application { - Window main = new Window("Color Picker Demo"); - - /* The custom component. */ - ColorPicker colorselector = new ColorPicker(); - - /* Another component. */ - Label colorname; - - @Override - public void init() { - setMainWindow(main); - - // Listen for value change events in the custom component, - // triggered when user clicks a button to select another color. - colorselector.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - // Provide some server-side feedback - colorname.setValue("Selected color: " - + colorselector.getColor()); - } - }); - main.addComponent(colorselector); - - // Add another component to give feedback from server-side code - colorname = new Label("Selected color: " + colorselector.getColor()); - main.addComponent(colorname); - - // Server-side manipulation of the component state - final Button button = new Button("Set to white"); - button.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - colorselector.setColor("white"); - } - }); - main.addComponent(button); - } -} diff --git a/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml b/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml deleted file mode 100644 index 27ddc1d60f..0000000000 --- a/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml +++ /dev/null @@ -1,8 +0,0 @@ -<module> - <!-- Inherit DefaultWidgetSet -->
- <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" /> -
- <!-- WidgetSet default theme --> - <stylesheet src="colorpicker/styles.css"/> - -</module> diff --git a/src/com/vaadin/demo/colorpicker/gwt/client/ui/GwtColorPicker.java b/src/com/vaadin/demo/colorpicker/gwt/client/ui/GwtColorPicker.java deleted file mode 100644 index 83c74d4fe4..0000000000 --- a/src/com/vaadin/demo/colorpicker/gwt/client/ui/GwtColorPicker.java +++ /dev/null @@ -1,105 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.colorpicker.gwt.client.ui; - -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Element; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.ClickListener; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Grid; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.Widget; - -/** - * A regular GWT component without integration with Vaadin. - */ -@SuppressWarnings("deprecation") -public class GwtColorPicker extends Composite implements ClickListener { - - /** Currently selected color name to give client-side feedback to the user. */ - protected Label currentcolor = new Label(); - - public GwtColorPicker() { - // Create a 4x4 grid of buttons with names for 16 colors - final Grid grid = new Grid(4, 4); - final String[] colors = new String[] { "aqua", "black", "blue", - "fuchsia", "gray", "green", "lime", "maroon", "navy", "olive", - "purple", "red", "silver", "teal", "white", "yellow" }; - int colornum = 0; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++, colornum++) { - // Create a button for each color - final Button button = new Button(colors[colornum]); - button.addClickListener(this); - - // Put the button in the Grid layout - grid.setWidget(i, j, button); - - // Set the button background colors. - DOM.setStyleAttribute(button.getElement(), "background", - colors[colornum]); - - // For dark colors, the button label must be in white. - if ("black navy maroon blue purple".indexOf(colors[colornum]) != -1) { - DOM - .setStyleAttribute(button.getElement(), "color", - "white"); - } - } - } - - // Create a panel with the color grid and currently selected color - // indicator - final HorizontalPanel panel = new HorizontalPanel(); - panel.add(grid); - panel.add(currentcolor); - - // Set the class of the color selection feedback box to allow CSS - // styling. - // We need to obtain the DOM element for the current color label. - // This assumes that the <td> element of the HorizontalPanel is - // the parent of the label element. Notice that the element has no - // parent - // before the widget has been added to the horizontal panel. - final Element panelcell = DOM.getParent(currentcolor.getElement()); - DOM.setElementProperty(panelcell, "className", - "colorpicker-currentcolorbox"); - - // Set initial color. This will be overridden with the value read from - // server. - setColor("white"); - - // Composite GWT widgets must call initWidget(). - initWidget(panel); - } - - /** Handles click on a color button. */ - public void onClick(Widget sender) { - // Use the button label as the color name to set - setColor(((Button) sender).getText()); - } - - /** Sets the currently selected color. */ - public void setColor(String newcolor) { - // Give client-side feedback by changing the color name in the label - currentcolor.setText(newcolor); - - // Obtain the DOM elements. This assumes that the <td> element - // of the HorizontalPanel is the parent of the label element. - final Element nameelement = currentcolor.getElement(); - final Element cell = DOM.getParent(nameelement); - - // Give feedback by changing the background color - DOM.setStyleAttribute(cell, "background", newcolor); - DOM.setStyleAttribute(nameelement, "background", newcolor); - if ("black navy maroon blue purple".indexOf(newcolor) != -1) { - DOM.setStyleAttribute(nameelement, "color", "white"); - } else { - DOM.setStyleAttribute(nameelement, "color", "black"); - } - } -} diff --git a/src/com/vaadin/demo/colorpicker/gwt/client/ui/VColorPicker.java b/src/com/vaadin/demo/colorpicker/gwt/client/ui/VColorPicker.java deleted file mode 100644 index e225dbe268..0000000000 --- a/src/com/vaadin/demo/colorpicker/gwt/client/ui/VColorPicker.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.colorpicker.gwt.client.ui; - -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.Paintable; -import com.vaadin.terminal.gwt.client.UIDL; - -public class VColorPicker extends GwtColorPicker implements Paintable { - - /** Set the CSS class name to allow styling. */ - public static final String CLASSNAME = "example-colorpicker"; - - /** Component identifier in UIDL communications. */ - String uidlId; - - /** Reference to the server connection object. */ - ApplicationConnection client; - - /** - * The constructor should first call super() to initialize the component and - * then handle any initialization relevant to Vaadin. - */ - public VColorPicker() { - // The superclass has a lot of relevant initialization - super(); - - // This method call of the Paintable interface sets the component - // style name in DOM tree - setStyleName(CLASSNAME); - } - - /** - * This method must be implemented to update the client-side component from - * UIDL data received from server. - * - * This method is called when the page is loaded for the first time, and - * every time UI changes in the component are received from the server. - */ - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - // This call should be made first. Ensure correct implementation, - // and let the containing layout manage caption, etc. - if (client.updateComponent(this, uidl, true)) { - return; - } - - // Save reference to server connection object to be able to send - // user interaction later - this.client = client; - - // Save the UIDL identifier for the component - uidlId = uidl.getId(); - - // Get value received from server and actualize it in the GWT component - setColor(uidl.getStringVariable("colorname")); - } - - /** Override the method to communicate the new value to server. */ - @Override - public void setColor(String newcolor) { - // Ignore if no change - if (newcolor.equals(currentcolor.getText())) { - return; - } - - // Let the original implementation to do whatever it needs to do - super.setColor(newcolor); - - // Updating the state to the server can not be done before - // the server connection is known, i.e., before updateFromUIDL() - // has been called. - if (uidlId == null || client == null) { - return; - } - - // Communicate the user interaction parameters to server. This call will - // initiate an AJAX request to the server. - client.updateVariable(uidlId, "colorname", newcolor, true); - } -} diff --git a/src/com/vaadin/demo/colorpicker/gwt/public/colorpicker/styles.css b/src/com/vaadin/demo/colorpicker/gwt/public/colorpicker/styles.css deleted file mode 100644 index 4c3455ae53..0000000000 --- a/src/com/vaadin/demo/colorpicker/gwt/public/colorpicker/styles.css +++ /dev/null @@ -1,26 +0,0 @@ -/* Set style for the color picker table. - This assumes that the Grid layout is rendered as a HTML <table>.*/ -table.example-colorpicker { - border-collapse: collapse; - border: 0px; -} - -/* Set color picker button style. - This does not make assumptions about the HTML element tree as it only uses - the logical class names.*/ -.example-colorpicker .gwt-Button { - height: 60px; - width: 60px; - border: none; - padding: 0px; -} - -/* Set style for the right-hand box that shows the currently selected color. - While this may work for other implementations of the HorizontalPanel as well, - it somewhat assumes that the layout is rendered as a table where cells - are <td> elements. */ -.colorpicker-currentcolorbox { - width: 240px; - text-align: center; - vertical-align: middle !important; -} diff --git a/src/com/vaadin/demo/coverflow/Coverflow.java b/src/com/vaadin/demo/coverflow/Coverflow.java deleted file mode 100644 index 6d274ca054..0000000000 --- a/src/com/vaadin/demo/coverflow/Coverflow.java +++ /dev/null @@ -1,108 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.coverflow; - -import com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.ClientWidget; - -@SuppressWarnings( { "serial", "unchecked" }) -@ClientWidget(VCoverflow.class) -public class Coverflow extends AbstractSelect { - - private String backgroundGradientStart = "FFFFFF"; - private String backgroundGradientEnd = "EEEEEE"; - private boolean scrollbarVisibility = true; - - /** - * Paints the uidl - * - * @param PaintTarget - * target - * @throws PaintException - */ - @Override - public void paintContent(PaintTarget target) throws PaintException { - // Superclass writes any common attributes in the paint target. - super.paintContent(target); - - target.addAttribute("backgroundGradientStart", backgroundGradientStart); - target.addAttribute("backgroundGradientEnd", backgroundGradientEnd); - target.addAttribute("scrollbarVisibility", scrollbarVisibility); - } - - /** - * The user can specify a background gradient for the coverflow. The input - * values are RGB values for the start and end gradients. - * - * @param int startR - * @param int startG - * @param int startB - * @param int endR - * @param int endG - * @param int endB - */ - public void setBackgroundColor(int startR, int startG, int startB, - int endR, int endG, int endB) { - backgroundGradientStart = ""; - backgroundGradientEnd = ""; - - // Convert all integers to hexadecimal format and make sure they are two - // characters long (in other words, add a zero in front if the value is - // less than 16 => 0x0F) - if (startR < 16) { - backgroundGradientStart += "0"; - } - backgroundGradientStart += Integer.toHexString(Math.max(Math.min( - startR, 255), 0)); - - if (startG < 16) { - backgroundGradientStart += "0"; - } - backgroundGradientStart += Integer.toHexString(Math.max(Math.min( - startG, 255), 0)); - - if (startB < 16) { - backgroundGradientStart += "0"; - } - backgroundGradientStart += Integer.toHexString(Math.max(Math.min( - startB, 255), 0)); - - if (endR < 16) { - backgroundGradientEnd += "0"; - } - backgroundGradientEnd += Integer.toHexString(Math.max(Math.min(endR, - 255), 0)); - - if (endG < 16) { - backgroundGradientEnd += "0"; - } - backgroundGradientEnd += Integer.toHexString(Math.max(Math.min(endG, - 255), 0)); - - if (endB < 16) { - backgroundGradientEnd += "0"; - } - backgroundGradientEnd += Integer.toHexString(Math.max(Math.min(endB, - 255), 0)); - - requestRepaint(); - } - - /** - * The user can toggle the visibility of the scrollbar - * - * @param boolean visible - */ - public void setScrollbarVisibility(boolean visible) { - if (scrollbarVisibility != visible) { - scrollbarVisibility = visible; - requestRepaint(); - } - } - -} diff --git a/src/com/vaadin/demo/coverflow/CoverflowApplication.html b/src/com/vaadin/demo/coverflow/CoverflowApplication.html deleted file mode 100644 index 1149357aa5..0000000000 --- a/src/com/vaadin/demo/coverflow/CoverflowApplication.html +++ /dev/null @@ -1,149 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html><head> -<title></title> - <style type="text/css"> - <!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }--> - </style> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -</head><body> - - -<!-- ======================================================== --> -<!-- = Java Sourcecode to HTML automatically converted code = --> -<!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = --> -<!-- = Further information: http://www.java2html.de = --> -<div align="left" class="java"> -<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff"> - <tr> - <!-- start source code --> - <td nowrap="nowrap" valign="top" align="left"> - <code> -<font color="#7f0055"><b>package </b></font><font color="#000000">com.vaadin.demo.coverflow;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.BufferedReader;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.FileInputStream;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.FileReader;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.IOException;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.InputStream;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.InputStreamReader;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.Reader;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.io.StringReader;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.net.URL;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">java.nio.CharBuffer;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.data.Property;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.terminal.Resource;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.terminal.Sizeable;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.terminal.ThemeResource;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.Button;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.Embedded;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.ExpandLayout;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.Label;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.Window;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.Button.ClickEvent;</font><br /> -<font color="#7f0055"><b>import </b></font><font color="#000000">com.vaadin.ui.Layout.AlignmentHandler;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#7f0055"><b>public class </b></font><font color="#000000">CoverflowApplication </font><font color="#7f0055"><b>extends </b></font><font color="#000000">com.vaadin.Application </font><font color="#000000">{</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#000000">Coverflow covers = </font><font color="#7f0055"><b>new </b></font><font color="#000000">Coverflow</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">init</font><font color="#000000">() {</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#000000">setMainWindow</font><font color="#000000">(</font><font color="#7f0055"><b>new </b></font><font color="#000000">Window</font><font color="#000000">(</font><font color="#2a00ff">"Coverflow"</font><font color="#000000">, createMainLayout</font><font color="#000000">()))</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#000000">setTheme</font><font color="#000000">(</font><font color="#2a00ff">"black"</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#000000">addSlidesToCoverflow</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>private </b></font><font color="#000000">ExpandLayout createMainLayout</font><font color="#000000">() {</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#3f7f5f">// Initialize coverflow component</font><br /> -<font color="#ffffff"> </font><font color="#000000">covers.setHeight</font><font color="#000000">(</font><font color="#990000">150</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">covers.setWidth</font><font color="#000000">(</font><font color="#990000">100</font><font color="#000000">, Sizeable.UNITS_PERCENTAGE</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">covers.setBackgroundColor</font><font color="#000000">(</font><font color="#990000">0</font><font color="#000000">, </font><font color="#990000">0</font><font color="#000000">, </font><font color="#990000">0</font><font color="#000000">, </font><font color="#990000">100</font><font color="#000000">, </font><font color="#990000">100</font><font color="#000000">, </font><font color="#990000">100</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#3f7f5f">// Initialize visible slide viewer</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>final </b></font><font color="#000000">Embedded visibleSlide = </font><font color="#7f0055"><b>new </b></font><font color="#000000">Embedded</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">visibleSlide.setHeight</font><font color="#000000">(</font><font color="#990000">100</font><font color="#000000">, Sizeable.UNITS_PERCENTAGE</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#3f7f5f">// Listen to coverflow changes as change slides when needed</font><br /> -<font color="#ffffff"> </font><font color="#000000">covers.addListener</font><font color="#000000">(</font><font color="#7f0055"><b>new </b></font><font color="#000000">Property.ValueChangeListener</font><font color="#000000">() {</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">valueChange</font><font color="#000000">(</font><font color="#000000">Property.ValueChangeEvent event</font><font color="#000000">) {</font><br /> -<font color="#ffffff"> </font><font color="#000000">visibleSlide.setSource</font><font color="#000000">((</font><font color="#000000">Resource</font><font color="#000000">) </font><font color="#000000">covers.getValue</font><font color="#000000">())</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"> </font><font color="#000000">})</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#3f7f5f">// Show sources button</font><br /> -<font color="#ffffff"> </font><font color="#000000">Button showSrc = </font><font color="#7f0055"><b>new </b></font><font color="#000000">Button</font><font color="#000000">(</font><font color="#2a00ff">"src"</font><font color="#000000">, </font><font color="#7f0055"><b>new </b></font><font color="#000000">Button.ClickListener</font><font color="#000000">() {</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>public </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">buttonClick</font><font color="#000000">(</font><font color="#000000">ClickEvent event</font><font color="#000000">) {</font><br /> -<font color="#ffffff"> </font><font color="#000000">Window srcWindow = </font><font color="#7f0055"><b>new </b></font><font color="#000000">Window</font><font color="#000000">(</font><font color="#2a00ff">"Source code"</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">srcWindow.setWidth</font><font color="#000000">(</font><font color="#990000">700</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">srcWindow.setHeight</font><font color="#000000">(</font><font color="#990000">500</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">Label l = </font><font color="#7f0055"><b>new </b></font><font color="#000000">Label</font><font color="#000000">(</font><font color="#000000">getSourceCodeForThisClass</font><font color="#000000">()</font><font color="#000000">,</font><br /> -<font color="#ffffff"> </font><font color="#000000">Label.CONTENT_XHTML</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">srcWindow.addComponent</font><font color="#000000">(</font><font color="#000000">l</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">getMainWindow</font><font color="#000000">()</font><font color="#000000">.addWindow</font><font color="#000000">(</font><font color="#000000">srcWindow</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"> </font><font color="#000000">})</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#3f7f5f">// Initialize main layout</font><br /> -<font color="#ffffff"> </font><font color="#000000">ExpandLayout layout = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ExpandLayout</font><font color="#000000">(</font><br /> -<font color="#ffffff"> </font><font color="#000000">ExpandLayout.ORIENTATION_VERTICAL</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.addComponent</font><font color="#000000">(</font><font color="#000000">showSrc</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.setComponentAlignment</font><font color="#000000">(</font><font color="#000000">showSrc, AlignmentHandler.ALIGNMENT_RIGHT,</font><br /> -<font color="#ffffff"> </font><font color="#000000">AlignmentHandler.ALIGNMENT_TOP</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.addComponent</font><font color="#000000">(</font><font color="#000000">visibleSlide</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.setComponentAlignment</font><font color="#000000">(</font><font color="#000000">visibleSlide,</font><br /> -<font color="#ffffff"> </font><font color="#000000">AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER,</font><br /> -<font color="#ffffff"> </font><font color="#000000">AlignmentHandler.ALIGNMENT_TOP</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.addComponent</font><font color="#000000">(</font><font color="#000000">covers</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.setComponentAlignment</font><font color="#000000">(</font><font color="#000000">covers,</font><br /> -<font color="#ffffff"> </font><font color="#000000">AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER,</font><br /> -<font color="#ffffff"> </font><font color="#000000">AlignmentHandler.ALIGNMENT_TOP</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.expand</font><font color="#000000">(</font><font color="#000000">visibleSlide</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">layout.setSizeFull</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">layout;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>private </b></font><font color="#000000">String getSourceCodeForThisClass</font><font color="#000000">() {</font><br /> -<font color="#ffffff"> </font><font color="#000000">String code = </font><font color="#2a00ff">"Could not find source-file"</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>try </b></font><font color="#000000">{</font><br /> -<font color="#ffffff"> </font><font color="#000000">InputStream is = </font><font color="#7f0055"><b>this</b></font><font color="#000000">.getClass</font><font color="#000000">()</font><font color="#000000">.getResource</font><font color="#000000">(</font><br /> -<font color="#ffffff"> </font><font color="#2a00ff">"CoverflowApplication.html"</font><font color="#000000">)</font><font color="#000000">.openStream</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">BufferedReader r = </font><font color="#7f0055"><b>new </b></font><font color="#000000">BufferedReader</font><font color="#000000">(</font><font color="#7f0055"><b>new </b></font><font color="#000000">InputStreamReader</font><font color="#000000">(</font><font color="#000000">is</font><font color="#000000">))</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">StringBuffer buf = </font><font color="#7f0055"><b>new </b></font><font color="#000000">StringBuffer</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">String line;</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>while </b></font><font color="#000000">((</font><font color="#000000">line = r.readLine</font><font color="#000000">()) </font><font color="#000000">!= </font><font color="#7f0055"><b>null</b></font><font color="#000000">) {</font><br /> -<font color="#ffffff"> </font><font color="#000000">buf.append</font><font color="#000000">(</font><font color="#000000">line</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"> </font><font color="#000000">code = buf.toString</font><font color="#000000">()</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">} </font><font color="#7f0055"><b>catch </b></font><font color="#000000">(</font><font color="#000000">IOException ignored</font><font color="#000000">) {</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>return </b></font><font color="#000000">code;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"></font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>private </b></font><font color="#7f0055"><b>void </b></font><font color="#000000">addSlidesToCoverflow</font><font color="#000000">() {</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>for </b></font><font color="#000000">(</font><font color="#7f0055"><b>int </b></font><font color="#000000">i = </font><font color="#990000">1</font><font color="#000000">; i <= </font><font color="#990000">22</font><font color="#000000">; i++</font><font color="#000000">) {</font><br /> -<font color="#ffffff"> </font><font color="#000000">String head = </font><font color="#2a00ff">"../../../IMAGES/"</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">String tail = </font><font color="#2a00ff">"slideshow-example.0" </font><font color="#000000">+ </font><font color="#000000">((</font><font color="#000000">i < </font><font color="#990000">10</font><font color="#000000">) </font><font color="#000000">? </font><font color="#2a00ff">"0" </font><font color="#000000">: </font><font color="#2a00ff">""</font><font color="#000000">) </font><font color="#000000">+ i</font><br /> -<font color="#ffffff"> </font><font color="#000000">+ </font><font color="#2a00ff">".jpg"</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">ThemeResource slide = </font><font color="#7f0055"><b>new </b></font><font color="#000000">ThemeResource</font><font color="#000000">(</font><font color="#000000">head + tail</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">covers.addItem</font><font color="#000000">(</font><font color="#000000">slide</font><font color="#000000">)</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">covers.setItemIcon</font><font color="#000000">(</font><font color="#000000">slide,</font><br /> -<font color="#ffffff"> </font><font color="#7f0055"><b>new </b></font><font color="#000000">ThemeResource</font><font color="#000000">(</font><font color="#000000">head + </font><font color="#2a00ff">"thumbs/" </font><font color="#000000">+ tail</font><font color="#000000">))</font><font color="#000000">;</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#ffffff"> </font><font color="#000000">}</font><br /> -<font color="#000000">}</font></code> - - </td> - <!-- end source code --> - </tr> -</table> -</div> -<!-- = END of automatically generated HTML code = --> -<!-- ======================================================== --> - - -</body></html>
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/CoverflowApplication.java b/src/com/vaadin/demo/coverflow/CoverflowApplication.java deleted file mode 100644 index 850737f544..0000000000 --- a/src/com/vaadin/demo/coverflow/CoverflowApplication.java +++ /dev/null @@ -1,116 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.coverflow; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -import com.vaadin.data.Property; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class CoverflowApplication extends com.vaadin.Application { - - Coverflow covers = new Coverflow(); - - @Override - public void init() { - - setMainWindow(new Window("Coverflow", createMainLayout())); - - setTheme("coverflow"); - - addSlidesToCoverflow(); - } - - private VerticalLayout createMainLayout() { - - // Initialize coverflow component - covers.setHeight("150px"); - covers.setWidth("100%"); - covers.setBackgroundColor(0, 0, 0, 100, 100, 100); - - // Initialize visible slide viewer - Panel slidePanel = new Panel(); - slidePanel.setStyleName(Panel.STYLE_LIGHT); - slidePanel.setSizeFull(); - final Embedded visibleSlide = new Embedded(); - visibleSlide.setHeight("480px"); - slidePanel.addComponent(visibleSlide); - ((VerticalLayout) slidePanel.getContent()).setComponentAlignment( - visibleSlide, "center"); - - // Listen to coverflow changes as change slides when needed - covers.addListener(new Property.ValueChangeListener() { - public void valueChange(Property.ValueChangeEvent event) { - visibleSlide.setSource((Resource) covers.getValue()); - } - }); - - // Show sources button - Button showSrc = new Button("Show source", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Window srcWindow = new Window("Source code"); - srcWindow.setWidth("700px"); - srcWindow.setHeight("500px"); - Label l = new Label(getSourceCodeForThisClass(), - Label.CONTENT_XHTML); - srcWindow.addComponent(l); - getMainWindow().addWindow(srcWindow); - } - }); - showSrc.setStyleName(Button.STYLE_LINK); - // Initialize main layout - VerticalLayout layout = new VerticalLayout(); - layout.addComponent(showSrc); - layout.setComponentAlignment(showSrc, Alignment.TOP_RIGHT); - layout.addComponent(slidePanel); - layout.addComponent(covers); - layout.setExpandRatio(slidePanel, 1); - layout.setSizeFull(); - - return layout; - } - - private String getSourceCodeForThisClass() { - String code = "Could not find source-file"; - try { - InputStream is = this.getClass().getResource( - "CoverflowApplication.html").openStream(); - BufferedReader r = new BufferedReader(new InputStreamReader(is)); - StringBuffer buf = new StringBuffer(); - String line; - while ((line = r.readLine()) != null) { - buf.append(line); - } - code = buf.toString(); - } catch (IOException ignored) { - } - return code; - } - - private void addSlidesToCoverflow() { - for (int i = 0; i < 20; i++) { - String head = "images/"; - String tail = "slideshow-example.0" + ((i < 10) ? "0" : "") + i - + ".jpg"; - ThemeResource slide = new ThemeResource(head + tail); - covers.addItem(slide); - covers.setItemIcon(slide, - new ThemeResource(head + "thumbs/" + tail)); - } - } -} diff --git a/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml b/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml deleted file mode 100644 index 21e8f26236..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml +++ /dev/null @@ -1,5 +0,0 @@ -<module> - <!-- Inherit the NoEntry version to avoid multiple entrypoints --> - <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" /> - -</module> diff --git a/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java b/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java deleted file mode 100644 index fb54a1445c..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java +++ /dev/null @@ -1,334 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.coverflow.gwt.client.ui; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.HTML; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.Paintable; -import com.vaadin.terminal.gwt.client.UIDL; - -public class VCoverflow extends Composite implements Paintable { - private String uidlId; - protected ApplicationConnection client; - private ArrayList<HashMap<String, String>> coverList = new ArrayList<HashMap<String, String>>(); - - private Object _selected; - private boolean flashInited = false; - private HTML flash; - private boolean scrollbarVisibility = true; - private String backgroundGradientStart; - private String backgroundGradientEnd; - private boolean colorChanged = false; - private boolean sbVisibilityChanged = false; - private HashMap<String, String> keyMap = new HashMap<String, String>(); - - /** - * Constructor - */ - public VCoverflow() { - flash = new HTML(); - - initWidget(flash); - } - - /** - * This method accepts parses the uidl sent by the server - * - * @param UIDL - * uidl - * @param ApplicationConnection - * client - */ - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - // Store variables - uidlId = uidl.getId(); - this.client = client; - String tempColor; - - if (client.updateComponent(this, uidl, true)) { - return; - } - - // Has the scrollbar's visibility status changed? - if (uidl.hasAttribute("scrollbarVisibility")) { - boolean tempVis = uidl.getBooleanAttribute("scrollbarVisibility"); - if (scrollbarVisibility != tempVis) { - scrollbarVisibility = tempVis; - sbVisibilityChanged = true; - } - } - - // Has the start gradient changed? - if (uidl.hasAttribute("backgroundGradientStart")) { - tempColor = uidl.getStringAttribute("backgroundGradientStart") - .toString(); - if (tempColor != backgroundGradientStart) { - backgroundGradientStart = tempColor; - colorChanged = true; - } - } - - // Has the end gradient changed? - if (uidl.hasAttribute("backgroundGradientEnd")) { - tempColor = uidl.getStringAttribute("backgroundGradientEnd") - .toString(); - if (tempColor != backgroundGradientEnd) { - backgroundGradientEnd = tempColor; - colorChanged = true; - } - } - - final UIDL images = uidl.getChildUIDL(0); - - // Check which covers should be removed. This array list contains all - // current - // covers. We remove from this list all covers which are sent with the - // repainted - // uidl. All remaining covers in this list should be "old" ones and are - // should - // be deleted. - - ArrayList<HashMap<String, String>> newList = new ArrayList<HashMap<String, String>>(); - - // Iterate through all option elements - for (final Iterator<Object> i = images.getChildIterator(); i.hasNext();) { - final UIDL imgUidl = (UIDL) i.next(); - - // Make sure all required attributes exist - if (imgUidl.hasAttribute("caption") && imgUidl.hasAttribute("key") - && imgUidl.hasAttribute("icon")) { - HashMap<String, String> set = new HashMap<String, String>(); - - // Update the key map - keyMap.put(imgUidl.getStringAttribute("caption"), imgUidl - .getStringAttribute("key")); - - // Get information - - set.put("icon", client.translateVaadinUri(imgUidl - .getStringAttribute("icon"))); - set.put("caption", imgUidl.getStringAttribute("caption")); - - newList.add(set); - - // Is the current cover selected? - if (imgUidl.hasAttribute("selected")) { - _selected = imgUidl.getStringAttribute("caption"); - } - } - } - - // Deleted items - ArrayList<HashMap<String, String>> intersectList = new ArrayList<HashMap<String, String>>(); - intersectList.addAll(coverList); - intersectList.removeAll(newList); - - if (flashInited) { - for (int i = 0; i < intersectList.size(); i++) { - HashMap<String, String> cover = intersectList.get(i); - removeCover(uidlId, cover.get("caption")); - } - } - - // Added items - intersectList = new ArrayList<HashMap<String, String>>(); - intersectList.addAll(newList); - intersectList.removeAll(coverList); - - if (flashInited) { - for (int i = 0; i < intersectList.size(); i++) { - HashMap<String, String> cover = intersectList.get(i); - addCover(uidlId, cover.get("caption"), cover.get("icon")); - } - } - - coverList = newList; - - // Has the flash been initialized? - if (!flashInited) { - colorChanged = false; - setFlash(); - initializeMethods(uidlId); - } - - // Inform flash of the selected cover - if (_selected != null && flashInited) { - selectCover(uidlId, _selected.toString()); - } - - if (colorChanged && flashInited) { - setBackgroundColor(uidlId, backgroundGradientStart, - backgroundGradientEnd); - colorChanged = false; - } - - if (sbVisibilityChanged && flashInited) { - toggleScrollbarVisibility(uidlId, scrollbarVisibility); - sbVisibilityChanged = false; - } - - } - - /** - * Inform the server which cover is selected - * - * @param String - * coverKey - */ - public void setCover(String coverId) { - if (uidlId == null || client == null) { - return; - } - - client.updateVariable(uidlId, "selected", new String[] { keyMap - .get(coverId) }, true); - } - - /** - * Initialize the native javascript functions needed for the flash <-> GWT - * communication - * - * @param String - * id - */ - public native void initializeMethods(String id) /*-{ - var app = this; - - if($wnd.vaadin.coverflow == null) - var coverflow = []; - else - var coverflow = $wnd.vaadin.coverflow; - - coverflow['getCovers_' + id] = function() { - app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::getCovers()(); - }; - - coverflow['setCurrent_' + id] = function(selected) { - app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::setCover(Ljava/lang/String;)(selected); - }; - - $wnd.vaadin.coverflow = coverflow; - }-*/; - - /** - * This function sends all covers to the flash. We cannot do this directly - * in the updateFromUIDL method, because we cannot be sure if the flash has - * been loaded into the browser. The flash will call for this method when - * it's ready. - */ - public void getCovers() { - // Loop through all stored covers - for (int i = 0; i < coverList.size(); i++) { - HashMap<String, String> set = coverList.get(i); - - try { - // Add the cover - addCover(uidlId, set.get("caption"), set.get("icon")); - } catch (Exception e) { - // Do not add covers lacking obligatory data - } - } - // The flash calls for this method, therefore we can be sure that the - // flash has been loaded - // into the browser. - flashInited = true; - - // Set selected cover - if (_selected != null) { - selectCover(uidlId, _selected.toString()); - } - } - - /** - * This function is a native javascript function which adds covers to the - * actual flash. This method works as a bridge between GWT and flash. - * - * @param id - * @param key - * @param caption - * @param icon - */ - public native void addCover(String id, String caption, String icon) /*-{ - try { - $doc['fxcoverflow' + id].addCover(caption.toString(), icon.toString()); - } - catch(e) { - $wnd.alert(e.message); - } - - }-*/; - - /** - * This function tells the flash which cover should be selected. - * - * @param id - * @param key - */ - public native void selectCover(String id, String key) /*-{ - $doc["fxcoverflow" + id].selectCover(key.toString()); - }-*/; - - public native void setBackgroundColor(String id, String startGradient, - String endGradient) /*-{ - $doc["fxcoverflow" + id].setBackgroundColor("0x" + startGradient.toString(), "0x" + endGradient.toString()); - }-*/; - - public native void toggleScrollbarVisibility(String id, boolean visibility) /*-{ - $doc["fxcoverflow" + id].toggleScrollbarVisibility(visibility); - }-*/; - - public native void removeCover(String id, String key) /*-{ - $doc["fxcoverflow" + id].removeCover(key); - }-*/; - - /** - * Set the HTML coding of the flash movie. This isn't done until the - * updateFromUIDL method is called for the first time. The reason is that we - * use an id from the UIDL to uniquely identify all instances of this - * widget. - */ - private void setFlash() { - String html = "<object id=\"fxcoverflow" - + uidlId - + "\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"100%\"" - + " height=\"100%\" codebase=\"http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\">" - + "<param name=\"movie\" value=\"" - + GWT.getModuleBaseURL() - + "coverflowflash.swf\">" - + "<param name=\"quality\" value=\"high\">" - + "<param name=\"flashVars\" value=\"pid=" - + uidlId - + "&sbVis=" - + scrollbarVisibility - + "&bgS=0x" - + backgroundGradientStart - + "&bgE=0x" - + backgroundGradientEnd - + "\" />" - + "<embed name=\"fxcoverflow" - + uidlId - + "\" flashVars=\"pid=" - + uidlId - + "&sbVis=" - + scrollbarVisibility - + "&bgS=0x" - + backgroundGradientStart - + "&bgE=0x" - + backgroundGradientEnd - + "\" src=\"" - + GWT.getModuleBaseURL() - + "coverflowflash.swf\" width=\"100%\" height=\"100%\" " - + "quality=\"high\" " - + "pluginspage=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">" - + "</embed>" + "</object>"; - flash.setHTML(html); - } -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/Cover.as b/src/com/vaadin/demo/coverflow/gwt/flex/Cover.as deleted file mode 100644 index 61b08ead48..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/Cover.as +++ /dev/null @@ -1,392 +0,0 @@ -package { - import flash.events.Event; - import flash.display.Loader; - import flash.display.DisplayObject; - import flash.system.LoaderContext; - import flash.display.Bitmap; - import flash.display.BitmapData; - import flash.net.URLRequest; - import mx.controls.Alert; - - import flash.system.Security; - import flash.system.ApplicationDomain; - - import mx.controls.Image; - import mx.core.UIComponent; - import flash.geom.Matrix; - import flash.display.Sprite; - import flash.display.Shape; - import flash.display.Graphics; - import flash.display.GradientType; - import flash.geom.Rectangle; - import flash.geom.Point; - - import sandy.util.*; - - public class Cover extends UIComponent { - // Cover information - private var _caption:String; - private var _uri:String; - private var _imageLoaded:Boolean = false; - - // Actual content information - private var _bitmapData:BitmapData; - private var _bitmap:Bitmap; - private var _img:Image; - private var _distortedShape:Shape; - private var _reflectionBitmap:Bitmap; - private var _reflectionShape:Shape; - - - // Distort information - private var _realAngle:Number = -1; - private var _realScale:Number = -1; - private var _angle:Number = 0; - private var _scale:Number = 1; - private static const perspectiveConstant:Number = .15; - - - // Position information - private var _x:int; - private var _y:int; - - /** - * Constructor - */ - public function Cover(caption:String, uri:String) { - super(); - - // Set this element's size to 100% x 100% - super.percentHeight = 100; - super.percentWidth = 100; - - // Store input data - this._caption = caption; - this._uri = uri; - - // Initialize default image - this._img = new Image(); - this._img.percentHeight = 100; - this._img.percentWidth = 100; - this._bitmapData = new BitmapData(100,100,false, 0xffff0000); - - _distortedShape = new Shape(); - addChild(_distortedShape); - - _reflectionShape = new Shape(); - addChild(_reflectionShape); - - // Create the default image - this._img.source = this.getBitmap(); - - addChildAt(_img, 0); - } - - /** - * Load an image if it hasn't been loaded yet - */ - public function loadImage():void { - if(!_imageLoaded) { - // Create a loader to load the image - var request:URLRequest = new URLRequest(this._uri); - var imageLoader:Loader = new Loader(); - - // Check for restrictions - var imgLdrContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain); - imgLdrContext.checkPolicyFile = true; - - // Set an event listener - imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded); - - // Load the image - imageLoader.load(request, imgLdrContext); - } - } - - /** - * Event handler for image load completion - * @param Event event - */ - private function imgLoaded(event:Event):void { - // Check if we got the image - try { - removeChild(_img); - this._bitmapData = Bitmap(event.currentTarget.content).bitmapData; - - // Set new source for the image - this._img.source = this.getBitmap(); - addChildAt(_img, 0); - - _imageLoaded = true; - invalidateDisplayList(); - } - catch(error:Error) { - // An error occured - Alert.show(error.toString()); - } - } - - /** - * Measure the size of the image - */ - override protected function measure():void { - if(_img != null) - { - measuredHeight = _img.getExplicitOrMeasuredHeight(); - measuredWidth = _img.getExplicitOrMeasuredWidth(); - } - } - - /** - * Update the image on the display - */ - override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { - // Do this if and only iff the angle or the scale has changed. Otherwise we do not - // want to re-draw the image, only move it. - if(_img && (_realAngle != _angle || _realScale != _scale)) - { - var contentWidth:Number = _img.getExplicitOrMeasuredWidth(); - var contentHeight:Number= _img.getExplicitOrMeasuredHeight(); - - _img.setActualSize(contentWidth,contentHeight); - - _realAngle = _angle; - _realScale = _scale; - - // Distort the image - distortImage(_bitmap, _distortedShape, false); - - // Create a reflection - createReflectionBitmap(_bitmap); - } - } - - /** - * This function distorts the target according to its angle - * @param Bitmap bm - The bitmap of the object which is being distorted - * @param Shape target - The target where the distorted image is stored - * @param Boolean refelection - Is this target a reflection? - */ - private function distortImage(bm:Bitmap, target:Shape, reflection:Boolean):void { - // Turn the angle into a value between 0 and 1 - var k:Number = (Math.abs(_angle)/90); - k = Math.sqrt(k); - - var vShear:Number = (_angle >= 0)? k*-perspectiveConstant : k*perspectiveConstant; - var verticalOffset:Number; - - // How much is the width of the image scaled - var hScale:Number = 1 - k; - - // How much lower/higher are the corners "further away" than the one "closer" - verticalOffset = (_img.getExplicitOrMeasuredHeight()*vShear); - - // Is this image a reflection? If yes, then the vertical offset distortion is made in another direction - if(reflection) - verticalOffset *= -1; - - // Initialize the distortion class - var distort:DistortImage = new DistortImage(); - distort.container = target; - distort.target = bm; - distort.smooth = true; - distort.initialize( 5, 5, null ); - - // Distort the images to the left - if(_angle > 0) { - distort.setTransform( - 0,0, - _img.getExplicitOrMeasuredWidth()*hScale,-verticalOffset, - _img.getExplicitOrMeasuredWidth()*hScale,_img.getExplicitOrMeasuredHeight()+verticalOffset, - 0,_img.getExplicitOrMeasuredHeight() - ); - } - // Distort the images to the right - else if(_angle < 0) { - distort.setTransform( - 0,verticalOffset, - _img.getExplicitOrMeasuredWidth()*hScale,0, - _img.getExplicitOrMeasuredWidth()*hScale,_img.getExplicitOrMeasuredHeight(), - 0,_img.getExplicitOrMeasuredHeight()-verticalOffset - ); - } - distort.render(); - - // We use the original image as a reference, but do not want to show it on the screen - _img.visible = false; - - // Align the distorted image correctly - var m:Matrix = target.transform.matrix; - m.tx = 0 - _img.width/2* hScale; - target.transform.matrix = m; - } - - /** - * This function creates a reflection of the target object - * @param DisplayObject target - */ - private function createReflectionBitmap(target:DisplayObject):void { - // Size of the fade - var fadeSize:Number = 0.4; - - // Create a rectangle - var box:Rectangle = new Rectangle(0, 0, target.width, target.height); - - // Create a matrix for the gradient - var gradientMatrix: Matrix = new Matrix(); - // Create a shape object for the gradient - var gradientShape: Shape = new Shape(); - // Apply a gradient on the matrix - gradientMatrix.createGradientBox(target.width, target.height * fadeSize, Math.PI/2, 0, target.height * (1.0 - fadeSize)); - - // Fill the shape with the gradient - gradientShape.graphics.beginGradientFill(GradientType.LINEAR, [0xFFFFFF, 0xFFFFFF], [0, 1], [0, 255], gradientMatrix); - gradientShape.graphics.drawRect(0, target.height * (1.0 - fadeSize), target.width, target.height * fadeSize); - gradientShape.graphics.endFill(); - - // Bitmap representation of the gradient - var gradientBm:BitmapData = new BitmapData(target.width, target.height, true, 0x00000000); - gradientBm.draw(gradientShape, new Matrix()); - - var targetBm:BitmapData = new BitmapData(target.width, target.height, true, 0x00000000); - targetBm.fillRect(box, 0x00000000); - targetBm.draw(target, new Matrix()); - - var reflectionData:BitmapData = new BitmapData(target.width, target.height, true, 0x00000000); - reflectionData.fillRect(box, 0x00000000); - reflectionData.copyPixels(targetBm, box, new Point(), gradientBm); - - // Store the reflection - _reflectionBitmap = new Bitmap(reflectionData); - - // Move the reflection to its correct position - var m:Matrix = _distortedShape.transform.matrix; - m.d = -1; - m.ty = _distortedShape.height*2; - _reflectionShape.transform.matrix = m; - - // Distort the reflection - distortImage(_reflectionBitmap, _reflectionShape, true); - - // Set a transparancy for the reflection - _reflectionShape.alpha = 0.4; - - } - - /** - * Get name - * @return String - */ - public function get caption():String { - return this._caption; - } - - /** - * Set name - * @param String name - */ - public function set caption(caption:String):void { - this._caption = caption; - } - - /** - * Get uri - * @return String - */ - public function get uri():String { - return this._uri; - } - - /** - * Set uri - * @param String uri - */ - public function set uri(uri:String):void { - this._uri = uri; - } - - /** - * Get the bitmap - * @return Bitmap - */ - public function getBitmap():Bitmap { - this._bitmap = new Bitmap(this._bitmapData); - return this._bitmap; - } - - /** - * Get the bitmap data - * @return BitmapData - */ - public function getBitmapData():BitmapData { - return this._bitmapData; - } - - /** - * Set the angle of the cover - * @param Number angle - */ - public function set angle(angle:Number):void { - this._angle = angle; - invalidateDisplayList(); - } - - /** - * Get the angle of the cover - * @return Number - */ - public function get angle():Number { - return this._angle; - } - - /** - * Set the x position of the cover - * @param Number x - */ - public function set xPos(x:Number):void { - this._x = x; - } - - /** - * Get the x position of the cover - * @return Number - */ - public function get xPos():Number { - return this._x; - } - - /** - * Set the y position of the cover - * @param Number y - */ - public function set yPos(y:Number):void { - this._y = y; - } - - /** - * Get the y position of the cover - * @return Number - */ - public function get yPos():Number { - return this._y; - } - - /** - * Set the scale of the cover - * @param Number scale - */ - public function set scale(scale:Number):void { - this._scale = scale; - } - - /** - * Get the scale position of the cover - * @return Number - */ - public function get scale():Number { - return this._scale; - } - - } -} -
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/Coverflow.as b/src/com/vaadin/demo/coverflow/gwt/flex/Coverflow.as deleted file mode 100644 index 130556a894..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/Coverflow.as +++ /dev/null @@ -1,598 +0,0 @@ -package { - import flash.events.Event; - import flash.events.MouseEvent; - import flash.utils.Dictionary; - import flash.geom.Matrix; - - import mx.controls.Alert; - import mx.controls.Image; - import mx.controls.HScrollBar; - import mx.core.UIComponent; - import mx.core.Application; - import mx.effects.AnimateProperty; - import mx.effects.easing.Quadratic; - import flash.external.ExternalInterface; - import mx.events.ScrollEvent; - - public class Coverflow extends UIComponent { - // The scrollbar - private var _scrollbar:HScrollBar; - - // _coverList is an array containing all the coverflow objects - private var _coverList:Array = new Array(); - - // Which element is selected - private var _selected:int = -1; - - // Which element is currently being showed - private var _current:Number = 0; - - // How much space (in pixels) is there between each cover - private var _coverSpacing:int = 40; - - // A map between covers and their positions in the coverflow - private var _coverMap:Dictionary; - - // The angle in which the child covers are distorted - private static const _angle:int = 35; - - // The size of the child covers. The default value is 0.8 which means that - // the child covers are 80% of their maximum size - private static const _childScale:Number = 0.8; - - // All covers are scaled to the maximum. These two variables tell us how - // big a cover can be in maximum - private var _maxWidth:int; - private var _maxHeight:int; - - // An object which takes care of animations - private var _animation:AnimateProperty; - - // An object for event handling - private var _eventHandler:EventHandler = new EventHandler(); - - // The unique identifier of this instance of the widget - private var _pid:String; - - // Has the cover list's content changed? - private var _listChanged:Boolean = false; - - /** - * Constructor - */ - public function Coverflow():void { - super(); - - // Initialize the scrollbar - _scrollbar = new HScrollBar(); - _scrollbar.x = 0; - // Add an action listener to the scrollbar which detects when the - // scrollbar's position has been changed. This event should also - // change the selected cover's value - _scrollbar.addEventListener(ScrollEvent.SCROLL, function ():void { selectedCover = Math.round(_scrollbar.scrollPosition); }); - - // Maximize the size of the component - this.percentHeight = 100; - this.percentWidth = 100; - - } - - /** - * This function is called when the flash has finished loading. This - * function will intialize the communication interface between flash - * and GWT. - */ - private function init():void { - // Are we even able to initialize a external communication interface? - if (ExternalInterface.available) { - // These two methods are made available for javascript (they - // can be directly called within javascript code) - ExternalInterface.addCallback("addCover", this.addCover); - ExternalInterface.addCallback("selectCover", this.externalSetCover); - ExternalInterface.addCallback("setBackgroundColor", this.setBackgroundColor); - ExternalInterface.addCallback("toggleScrollbarVisibility", this.toggleScrollbarVisibility); - ExternalInterface.addCallback("removeCover", this.removeCover); - - // Try to call a javascript function - try { - // The function we want to call is getCovers. It tells javascript - // that the flash is now ready to accept information of the covers. - // The name of the function we're about to call is dynamic, meaning - // it is unique for every instance of this widget - ExternalInterface.call("vaadin.coverflow['getCovers_" + _pid + "']"); - } catch (error:SecurityError) { - Alert.show("A SecurityError occurred: " + error.message + "\n"); - } catch (error:Error) { - Alert.show("An Error occurred: " + error.message + "\n"); - } - } else { - Alert.show("External interface is not available for this container."); - } - } - - /** - * Adds a new cover to the coverflow list - * @param String name - * @param String uri - */ - private function addCover(name:String, uri:String):void { - // Create an instance of the cover object - var cover:Cover = new Cover(name.toString(), uri.toString()); - - // Mark the list as being modified - _listChanged = true; - - // Load the image - cover.loadImage(); - // Add the cover to our array - _coverList.push(cover); - commitProperties(); - } - - /** - * Measure the size of this component - */ - override protected function measure():void { - super.measure(); - - // What is the maximum size of a cover? It is either 3/4 of the height of the component - // or 1/3 of the width - which ever is smaller. - _maxHeight = _maxWidth = Math.round(Math.min(this.width/3,this.height/4*3)); - } - - /** - * Creates the child elements (covers) - */ - override protected function createChildren():void { - super.createChildren(); - - for(var i:int = 0; i < _coverList.lenght; i++) - addChild(_coverList[i]); - - invalidateDisplayList(); - } - - /** - * Something has changed - */ - override protected function commitProperties():void { - // Remove all old covers - for(i = numChildren-1;i>=0;i--) { - removeChildAt(numChildren-1); - } - - // Create a new mapping between the covers and their position - _coverMap = new Dictionary(true); - - // Loop through the coverlist array - for(var i:int = 0;i<_coverList.length;i++) { - var cover:Cover = _coverList[i]; - // Make sure the cover is loaded - cover.loadImage(); - - // Add an event listener to the cover. We want to know when - // a cover is being clicked. - cover.addEventListener(MouseEvent.CLICK,selectEvent,false,0,true); - // Add the cover to the flash movie - addChildAt(cover,i); - - // Add this cover to the map - _coverMap[cover] = i; - } - - // Add the scrollbar on top of all other elements - addChild(_scrollbar); - - // Update the scrollbar's details - invalidateScrollbar(); - - // update screen - invalidateDisplayList(); - } - - /** - * This function draws the actual content of the flash movie - */ - override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { - if(_selected < 0) { - selectedCover = 0; - return; - } - - // Measure the size of the component - measure(); - // Update the scrollbar's details - invalidateScrollbar(); - - // Check if there are any new covers added to our array - if(_listChanged) { - _eventHandler.dispatchEvent(new Event(EventHandler.DATA_CHANGED)); - _listChanged = false; - } - - // If no covers exist, then do nothing - if(_coverList.length == 0) - return; - - - var cover:Cover; - var index:int = 0; - var m:Matrix; - - // Loop through all covers - for(var i:int=0; i < _coverList.length; i++) { - cover = _coverList[i]; - - // Calculate in which layer position the cover should be - index = (i <= Math.floor(_current))? i : _coverList.length-1-i; - - // Set the real size of the cover - cover.setActualSize(cover.getExplicitOrMeasuredWidth(),cover.getExplicitOrMeasuredHeight()); - - // Calculate in which angle the cover should be at this specific moment - calculateAngle(cover, i); - - // Set the covers layer position - setChildIndex(cover,index); - - // Calculate the cover's size (scale) - calculateScale(cover, i); - - // ...and finally calculate its position (horizontal position, that is) - calculatePosition(cover, i); - - // Resize the cover according to its scale value - m = cover.transform.matrix; - m.a = m.d = cover.scale; - cover.transform.matrix = m; - - // Move the cover to its correct position - cover.move(cover.xPos, cover.yPos); - - } - // Set selected cover on top of all other covers - setChildIndex(_coverList[Math.floor(_current)],_coverList.length-1); - } - - /** - * This function calulcates the position of a cover at any given moment. - * @param Cover c - Which cover is being processed - * @param int index - what is the cover's index (horizontal order number) - */ - private function calculatePosition(c:Cover, index:int):void { - // All covers are aligned so, that their bottom is at 3/4's height of the - // actual flash movie - c.yPos = Math.round(unscaledHeight/4*3-c.getExplicitOrMeasuredHeight()*c.scale); - - // Calculate the position difference between the currently selected item and - // this items index - var diff:Number = _current-index; - - // We want to know the previous and next positions of the item - var prevPos:Number; - var nextPos:Number; - - // We are currently processing a cover which comes from the left to the center (selected) - if(index == Math.floor(_current)) { - // Calculate the previous position - prevPos = unscaledWidth/2 - _maxWidth/2 - _coverSpacing; - // The next position is in the center of the screen - nextPos = unscaledWidth/2; - // Now calculate in which state of the animation we are - c.xPos = nextPos-diff*(nextPos-prevPos); - } - // Same as above, except now we come from right to center - else if(index == Math.ceil(_current)) { - prevPos = unscaledWidth/2; - nextPos = unscaledWidth/2 +_maxWidth/2 + _coverSpacing; - c.xPos = prevPos-diff*(nextPos-prevPos); - } - // Child covers to the left - else if(index < Math.floor(_current)){ - c.xPos = unscaledWidth/2 - _maxWidth/2 - diff*_coverSpacing; - } - // ..and child covers to the right - else { - c.xPos = unscaledWidth/2 +_maxWidth/2 - diff*_coverSpacing; - } - } - - /** - * Calulcates the angle of a cover at any given moment - * @param Cover c - * @param int index - */ - private function calculateAngle(c:Cover, index:int):void { - // This function has the same principle as the the function above - - var diff:Number; - - if(index == Math.floor(_current)) { - diff = _current-Math.floor(_current); - c.angle = _angle*diff; - } - else if(index == Math.ceil(_current)) { - diff = _current-Math.ceil(_current); - c.angle = _angle*diff; - } - else if(index < Math.floor(_current)) - c.angle = _angle; - else - c.angle = -_angle; - } - - /** - * Calculates the size (scale) of a cover at any given moment - * @param Cover c - * @param int index - */ - private function calculateScale(c:Cover, index:int):void { - // Almost same as calculatePosition, except that now we are - // calculating the scaled size of the cover - - var diff:Number = _current-index; - var scalePrev:Number; - var scaleNext:Number; - - if(index == Math.floor(_current)) { - scalePrev = maxScale(c.width, c.height)*_childScale; - scaleNext = maxScale(c.width, c.height); - c.scale = scaleNext-diff*(scaleNext-scalePrev); - } - else if(index == Math.ceil(_current)) { - scalePrev = maxScale(c.width, c.height); - scaleNext = maxScale(c.width, c.height)*_childScale; - c.scale = scalePrev-diff*(scaleNext-scalePrev); - } - else - c.scale = maxScale(c.width, c.height)*_childScale; - - - } - - /** - * Calculate the maximum scale of a cover - * @param Number w - The actual width of the cover - * @param Number h - The actual height of the cover - * @return Number - */ - private function maxScale(w:Number, h:Number):Number { - // The width of the cover is bigger than the height. This means that - // the width will be the restricting factor of this cover's size. - // Therefore we calculate the maximum size of this cover (result given - // as a scale) - if(w > h) - return _maxWidth/w; - - // Height is bigger than width. Same logic as above. - else - return _maxHeight/h; - } - - /** - * What happens when a user clicks on a cover? - * @param MouseEvent e - */ - private function selectEvent(e:MouseEvent):void { - // Use the mapping between the covers and their positions to - // find out which is the index of the cover that was clicked. - // Set this index as the new selected cover. - selectedCover = _coverMap[e.currentTarget]; - } - - /** - * Set the selected cover - * @param int index - */ - public function set selectedCover(index:int):void { - // The selected cover is already selected. Do nothing - if(index == _selected) - return; - - // Validate the index, make sure it's within the coverList's range - if(index >= 0 && index < _coverList.length) { - _selected = index; - - // Animate the changes - animateChange(); - } - } - - /** - * Returns the selected cover - * @return int - */ - public function get selectedCover():int { - return _selected; - } - - /** - * Set the current cover (which cover is actually being shown at this very moment. - * Note that the value can be a decimal value, because the selected cover can be for - * example 3.2, which means that it has moved 20% between the positions 3 and 4. - * @param Number i - */ - public function set current(i:Number):void { - // If ExternalInterface is available and the current cover - // is same as the currently selected cover (in other words, - // the animation has finished), then send the selected cover's - // key to GWT which will then forward it to the server. - if (ExternalInterface.available && i == _selected) { - ExternalInterface.call("vaadin.coverflow['setCurrent_" + _pid + "']",_coverList[_selected].caption); - - // Send an event which notifies the scrollbar that the selected cover has changed. - _eventHandler.dispatchEvent(new Event(EventHandler.CURRENT_CHANGED)); - } - - // Update value - _current = i; - // Update display - invalidateDisplayList(); - } - - /** - * Get the value of current - * @return Number - */ - public function get current():Number { - return _current; - } - - /** - * This is a function where an external source can set the selected cover - * (in our case, it could be another widget which is connected to our - * coverflow). - * - * @param String index - */ - private function externalSetCover(id:String):void { - var cover:Cover; - for(var i:int=0; i < _coverList.length; i++) { - cover = _coverList[i]; - - if(cover.caption == id) { - selectedCover = i; - break; - } - } - } - - /** - * With this function we can remove any cover from the cover flow in run time - * - * @param String id - */ - private function removeCover(id:String):void { - var cover:Cover; - - // Loop through all covers and search the correct one - for(var i:int=0; i < _coverList.length; i++) { - cover = _coverList[i]; - - // If the cover's name matches with the given id, then delete it - if(cover.caption == id) { - // First we will however check if we are removing the last - // which is also currently selected - if(i == _coverList.length-1 && i == _selected) { - // Select the previous cover - selectedCover = i-1; - - // Jump to the end of the animation - if(_animation != null && _animation.isPlaying) - _animation.end(); - } - - // Mark the list as having changes - _listChanged = true; - - // Remove the cover from the list - _coverList.splice(i,1); - - // Update - commitProperties(); - break; - } - } - } - - /** - * Gives a references to the event handler - * @return EventHandler - */ - public function get eventHandler():EventHandler { - return _eventHandler; - } - - /** - * Tells us how many covers there are currently added - * @return int - */ - public function get coverCount():int { - return _coverList.length; - } - - /** - * Sets the unique identifier of this widget. This is used to create - * the dynamic function names in the external interface calls. - * @param String p - */ - public function set pid(p:String):void { - if(_pid == null) { - _pid = p; - init(); - } - } - - /** - * Set the background color of the coverflow - * @param String gradientStart - * @param String gradientEnd - */ - public function setBackgroundColor(gradientStart:String, gradientEnd:String):void { - Application.application.setStyle('backgroundGradientColors', [gradientStart, gradientEnd]); - } - - /** - * Make sure the scrollbar is up-to-date, both in size and position wise - */ - private function invalidateScrollbar():void { - _scrollbar.width = unscaledWidth; - _scrollbar.y = unscaledHeight-_scrollbar.getExplicitOrMeasuredHeight()/2; - _scrollbar.maxScrollPosition = coverCount-1; - _scrollbar.scrollPosition = _selected; - _scrollbar.pageSize = 1; - _scrollbar.invalidateDisplayList(); - } - - /** - * Change the visibility status of the scrollbar - * @param String visibility - */ - public function toggleScrollbarVisibility(visibility:String):void { - // Input is a string, because javascript can call directly on this function - if(visibility == "false") - _scrollbar.visible = false; - else - _scrollbar.visible = true; - } - - /** - * Animate the state changes - */ - private function animateChange():void { - // If there already is an animation in process, stop it (jump to the end) and start the new one. - if(_animation != null && _animation.isPlaying) - _animation.end(); - - // Set up a new animation. We want the "current" value go to the "_selected" value - _animation = new AnimateProperty(this); - _animation.property = "current"; - _animation.toValue = _selected; - _animation.target = this; - - // What is the duration of the animation? We don't want the animation to go too fast or too slow. - // An animation where the selected cover is changed with only one position should be relatively - // slow, so that we actually can se an animation. Therefore we've set a minimum length of the - // animation to 400 ms. If we jump over several covers, then we want the animation to be a - // bit longer, so that the animation would be smoother. Therefore we reserve 200ms between every - // cover change. Select which ever is bigger, 400ms or difference between current and selected - // cover * 200ms. - var duration:int = Math.max(400,Math.abs(Math.ceil(_current)-_selected)*200); - - // If we do long jumps (for example by using the slider), we don't want the animation to go - // too long. Therefore we're setting a maximum length for the animation, in this case 2 seconds. - duration = Math.min(2000,duration); - _animation.duration = duration; - - // We don't want the animation to be linear, we want it to slow down in the end - _animation.easingFunction = mx.effects.easing.Quadratic.easeOut; - - // Start the animation - _animation.play(); - } - - } - - -} -
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/EventHandler.as b/src/com/vaadin/demo/coverflow/gwt/flex/EventHandler.as deleted file mode 100644 index f9d25be24d..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/EventHandler.as +++ /dev/null @@ -1,16 +0,0 @@ -package { - import flash.events.EventDispatcher; - import flash.events.Event; - - /** - * This is a simple class created for event handling. Basically it just - * dispatches some custom events related to state changes within the coverflow. - */ - public class EventHandler extends EventDispatcher { - // Events - public static var DATA_CHANGED:String = "data_changed"; - public static var CURRENT_CHANGED:String = "current_changed"; - - - } -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/coverflowflash.mxml b/src/com/vaadin/demo/coverflow/gwt/flex/coverflowflash.mxml deleted file mode 100644 index 612e8ba52f..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/coverflowflash.mxml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<mx:Application - xmlns:mx="http://www.adobe.com/2006/mxml" - horizontalAlign="center" verticalAlign="middle" - creationComplete="{ init(); }" - xmlns:custom="*" - paddingLeft="0" - paddingTop="10" - paddingBottom="0" - paddingRight="0" - > - - <mx:Script> - <![CDATA[ - import mx.controls.Alert; - - private var coverflow:Coverflow = new Coverflow(); - - private function init():void { - coverflow.setBackgroundColor(Application.application.parameters.bgS, Application.application.parameters.bgE); - coverflow.toggleScrollbarVisibility(Application.application.parameters.sbVis); - coverflow.pid = Application.application.parameters.pid; - - container.addChild(coverflow); - - } - - ]]> - </mx:Script> - - <mx:Box width="100%" height="100%" id="container" /> -</mx:Application> - diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/DistortImage.as b/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/DistortImage.as deleted file mode 100644 index 101e9e217c..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/DistortImage.as +++ /dev/null @@ -1,306 +0,0 @@ -/* -# ***** BEGIN LICENSE BLOCK ***** -Copyright the original author or authors. -Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (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.mozilla.org/MPL/MPL-1.1.html -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. - -# ***** END LICENSE BLOCK ***** -*/ - - -/* -**************************** -* From a first idea and first implementation of Andre Michelle www.andre-michelle.com -* @version 2.0 -* @author Thomas Pfeiffer - kiroukou - http://www.thomas-pfeiffer.info -* @author Richard Lester - RichL -* @author Didier Brun - foxy - http://www.foxaweb.com -* @author Alex Uhlmann -* @website: http://sandy.media-box.net -* @description: Tesselate a movieclip into several triangles to allow free transform distorsion. -*/ -package sandy.util -{ - import flash.display.BitmapData; - import flash.display.DisplayObject; - import flash.display.Shape; - import flash.display.Sprite; - import flash.geom.Matrix; - import flash.geom.Rectangle; - - public class DistortImage - { - public var smooth : Boolean; - // -- texture to distort - public var texture:BitmapData; - // -- container Sprite or Shape : the display object containing the distorted picture drawn via graphics. - - private var _container:Object; - public function get container() : Object - { - return _container; - } - - public function set container( value : Object ) : void - { - if( ( value is Shape ) || ( value is Sprite ) ) - { - _container = value; - } - else - { - throw new Error('container must be flash.display.Shape or flash.display.Sprite'); - } - } - - // -- target Object : either a BitmapData or a sprite - public var target:Object; - // -- arrays of differents datas types - public var points:Array; - - ///////////////////////// - /// PRIVATE PROPERTIES // - ///////////////////////// - private var offsetRect:Rectangle; - private var _w:Number; - private var _h:Number; - private var _xMin:Number; - private var _xMax:Number; - private var _yMin:Number - private var _yMax:Number; - // -- picture segmentation properties - private var _hseg:Number; - private var _vseg:Number; - private var _hsLen:Number; - private var _vsLen:Number; - private var _tri:Array; - private var _aMcs:Array; - - public function DistortImage() - { - smooth = true; - } - - /* - * @param vseg Number : the vertical precision - * @param hseg Number : the horizontal precision - * @param offsetRect Rectangle : optional, the real bounds to use. - * @throws: An error if target property isn't a BitmapData or a DisplayObject - */ - public function initialize( vseg: Number, hseg: Number, offsetRect: Rectangle = null ) : void - { - if( target is BitmapData ) - { - texture = target as BitmapData; - _w = texture.width; - _h = texture.height; - } - else if( target is DisplayObject ) - { - renderVector( offsetRect ); - } - else - { - throw new Error('target must be flash.display.BitmapData or flash.display.DisplayObject'); - } - _vseg = vseg || 0; - _hseg = hseg || 0; - - // -- - _aMcs = new Array(); - points = new Array(); - _tri = new Array(); - // -- - __init(); - } - - public function render() : void - { - __render(); - } - - /** - * setTransform - * - * @param x0 Number the horizontal coordinate of the first point - * @param y0 Number the vertical coordinate of the first point - * @param x1 Number the horizontal coordinate of the second point - * @param y1 Number the vertical coordinate of the second point - * @param x2 Number the horizontal coordinate of the third point - * @param y2 Number the vertical coordinate of the third point - * @param x3 Number the horizontal coordinate of the fourth point - * @param y3 Number the vertical coordinate of the fourth point - * - * @description : Distort the bitmap to adjust it to those points. - */ - public function setTransform( x0:Number , y0:Number , - x1:Number , y1:Number , - x2:Number , y2:Number , - x3:Number , y3:Number ): void - { - var w:Number = _w; - var h:Number = _h; - var dx30:Number = x3 - x0; - var dy30:Number = y3 - y0; - var dx21:Number = x2 - x1; - var dy21:Number = y2 - y1; - var l:int = points.length; - while( --l > -1 ) - { - var point:SandyPoint = points[ l ]; - var gx:Number = ( point.x - _xMin ) / w; - var gy:Number = ( point.y - _yMin ) / h; - var bx:Number = x0 + gy * ( dx30 ); - var by:Number = y0 + gy * ( dy30 ); - - point.sx = bx + gx * ( ( x1 + gy * ( dx21 ) ) - bx ); - point.sy = by + gx * ( ( y1 + gy * ( dy21 ) ) - by ); - } - __render(); - } - - - - ///////////////////////// - /// PRIVATE METHODS /// - ///////////////////////// - - private function renderVector( offsetRect: Rectangle = null ) : void - { - var vector : DisplayObject = target as DisplayObject; - if( offsetRect != null ) - { - texture = new BitmapData( offsetRect.width , offsetRect.height, true, 0x00000000 ); - } - else - { - texture = new BitmapData( vector.width , vector.height, true, 0x00000000 ); - offsetRect = new Rectangle( 0, 0, texture.width, texture.height ); - } - - var m : Matrix = new Matrix(); - m.translate( offsetRect.x * -1, offsetRect.y * -1 ); - texture.draw( vector, m ); - container.transform.matrix.translate( vector.transform.matrix.tx, vector.transform.matrix.ty ); - _w = offsetRect.width; - _h = offsetRect.height; - } - - private function __init(): void - { - points = new Array(); - _tri = new Array(); - var ix:int, iy:int; - var w2: Number = _w / 2; - var h2: Number = _h / 2; - _xMin = _yMin = 0; - _xMax = _w; _yMax = _h; - _hsLen = _w / ( _hseg + 1 ); - _vsLen = _h / ( _vseg + 1 ); - var x:Number, y:Number; - var p0:SandyPoint, p1:SandyPoint, p2:SandyPoint; - - // -- we create the points - for ( ix = 0 ; ix < _hseg + 2 ; ix++ ) - { - for ( iy = 0 ; iy < _vseg + 2 ; iy++ ) - { - x = ix * _hsLen; - y = iy * _vsLen; - points.push( new SandyPoint( x, y, x, y ) ); - } - } - // -- we create the triangles - for ( ix = 0 ; ix < _vseg + 1 ; ix++ ) - { - for ( iy = 0 ; iy < _hseg + 1 ; iy++ ) - { - p0 = points[ iy + ix * ( _hseg + 2 ) ]; - p1 = points[ iy + ix * ( _hseg + 2 ) + 1 ]; - p2 = points[ iy + ( ix + 1 ) * ( _hseg + 2 ) ]; - __addTriangle( p0, p1, p2 ); - // -- - p0 = points[ iy + ( ix + 1 ) * ( _vseg + 2 ) + 1 ]; - p1 = points[ iy + ( ix + 1 ) * ( _vseg + 2 ) ]; - p2 = points[ iy + ix * ( _vseg + 2 ) + 1 ]; - __addTriangle( p0, p1, p2 ); - } - } - } - - private function __addTriangle( p0:SandyPoint, p1:SandyPoint, p2:SandyPoint ):void - { - var u0:Number, v0:Number, u1:Number, v1:Number, u2:Number, v2:Number; - var tMat:Matrix = new Matrix(); - // -- - u0 = p0.x; v0 = p0.y; - u1 = p1.x; v1 = p1.y; - u2 = p2.x; v2 = p2.y; - tMat.tx = -v0*(_w / (v1 - v0)); - tMat.ty = -u0*(_h / (u2 - u0)); - tMat.a = tMat.d = 0; - tMat.b = _h / (u2 - u0); - tMat.c = _w / (v1 - v0); - // -- - _tri.push( new Triangle( p0, p1, p2, tMat ) ); - } - - private function __render(): void - { - var vertices: Array; - var p0:SandyPoint, p1:SandyPoint, p2:SandyPoint; - var x0:Number, y0:Number; - var ih:Number = 1/_h, iw:Number = 1/_w; - var c:Object = container; c.graphics.clear(); - var a:Triangle; - var sM:Matrix = new Matrix(); - var tM:Matrix = new Matrix(); - //-- - var l:int = _tri.length; - while( --l > -1 ) - { - a = _tri[ l ]; - p0 = a.p0; - p1 = a.p1; - p2 = a.p2; - tM = a.tMat; - // -- - sM.a = ( p1.sx - ( x0 = p0.sx ) ) * iw; - sM.b = ( p1.sy - ( y0 = p0.sy ) ) * iw; - sM.c = ( p2.sx - x0 ) * ih; - sM.d = ( p2.sy - y0 ) * ih; - sM.tx = x0; - sM.ty = y0; - // -- - sM = __concat( sM, tM ); - - c.graphics.beginBitmapFill( texture, sM, false, smooth ); - c.graphics.moveTo( x0, y0 ); - c.graphics.lineTo( p1.sx, p1.sy ); - c.graphics.lineTo( p2.sx, p2.sy ); - c.graphics.endFill(); - } - } - - private function __concat( m1:Matrix, m2:Matrix ):Matrix - { - //Relies on the original triangles being right angled with p0 being the right angle. - //Therefore a = d = zero (before and after invert) - var mat : Matrix = new Matrix(); - mat.a = m1.c * m2.b; - mat.b = m1.d * m2.b; - mat.c = m1.a * m2.c; - mat.d = m1.b * m2.c; - mat.tx = m1.a * m2.tx + m1.c * m2.ty + m1.tx; - mat.ty = m1.b * m2.tx + m1.d * m2.ty + m1.ty; - return mat; - } - } -} diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/SandyPoint.as b/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/SandyPoint.as deleted file mode 100644 index 7d5c52ca0c..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/SandyPoint.as +++ /dev/null @@ -1,17 +0,0 @@ -package sandy.util
-{
- import flash.geom.Point;
-
- public class SandyPoint extends Point
- {
- public var sx : Number;
- public var sy : Number;
-
- public function SandyPoint( x : Number, y : Number, sx : Number, sy : Number )
- {
- super( x, y );
- this.sx = sx;
- this.sy = sy;
- }
- }
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/Triangle.as b/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/Triangle.as deleted file mode 100644 index 8f08fb6c76..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/flex/sandy/util/Triangle.as +++ /dev/null @@ -1,20 +0,0 @@ -package sandy.util
-{
- import flash.geom.Matrix;
-
- public class Triangle
- {
- public var p0 : SandyPoint;
- public var p1 : SandyPoint;
- public var p2 : SandyPoint;
- public var tMat : Matrix;
-
- public function Triangle( p0 : SandyPoint, p1 : SandyPoint, p2 : SandyPoint, tMat : Matrix )
- {
- this.p0 = p0;
- this.p1 = p1
- this.p2 = p2;
- this.tMat = tMat;
- }
- }
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/coverflow/gwt/public/coverflowflash.swf b/src/com/vaadin/demo/coverflow/gwt/public/coverflowflash.swf Binary files differdeleted file mode 100644 index 9735f5f0d3..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/public/coverflowflash.swf +++ /dev/null diff --git a/src/com/vaadin/demo/featurebrowser/AccordionExample.java b/src/com/vaadin/demo/featurebrowser/AccordionExample.java deleted file mode 100644 index 68cd94faf7..0000000000 --- a/src/com/vaadin/demo/featurebrowser/AccordionExample.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.demo.featurebrowser; - -import com.vaadin.ui.Accordion; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -/** - * Accordion is a derivative of TabSheet, a vertical tabbed layout that places - * the tab contents between the vertical tabs. - */ -@SuppressWarnings("serial") -public class AccordionExample extends CustomComponent { - public AccordionExample() { - // Create a new accordion - final Accordion accordion = new Accordion(); - setCompositionRoot(accordion); - - // Add a few tabs to the accordion. - for (int i = 0; i < 5; i++) { - // Create a root component for a accordion tab - VerticalLayout layout = new VerticalLayout(); - // The accordion tab label is taken from the caption of the root - // component. Notice that layouts can have a caption too. - layout.setCaption("Tab " + (i + 1)); - - accordion.addComponent(layout); - - // Add some components in each accordion tab - Label label = new Label("These are the contents of Tab " + (i + 1) - + "."); - layout.addComponent(label); - - TextField textfield = new TextField("Some text field"); - layout.addComponent(textfield); - } - } -} diff --git a/src/com/vaadin/demo/featurebrowser/ButtonExample.java b/src/com/vaadin/demo/featurebrowser/ButtonExample.java deleted file mode 100644 index f67d6f4c7b..0000000000 --- a/src/com/vaadin/demo/featurebrowser/ButtonExample.java +++ /dev/null @@ -1,140 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * Shows a few variations of Buttons and Links.
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class ButtonExample extends CustomComponent implements
- Button.ClickListener {
-
- public ButtonExample() {
-
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- final HorizontalLayout horiz = new HorizontalLayout();
- horiz.setWidth("100%");
- main.addComponent(horiz);
- final Panel basic = new Panel("Basic buttons");
- basic.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(basic);
-
- final Panel bells = new Panel("w/ bells & whistles");
- bells.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(bells);
-
- Button b = new Button("Basic button");
- b.addListener(this);
- basic.addComponent(b);
-
- b = new Button("Button w/ icon + tooltip");
- b.addListener(this);
- b.setIcon(new ThemeResource("icons/ok.png"));
- b.setDescription("This button does nothing, fast");
- bells.addComponent(b);
-
- b = new CheckBox("CheckBox - a switch-button");
- b.setImmediate(true); // checkboxes are not immediate by default
- b.addListener(this);
- basic.addComponent(b);
-
- b = new CheckBox("CheckBox w/ icon + tooltip");
- b.setImmediate(true); // checkboxes are not immediate by default
- b.addListener(this);
- b.setIcon(new ThemeResource("icons/ok.png"));
- b.setDescription("This is a CheckBox");
- bells.addComponent(b);
-
- b = new Button("Link-style button");
- b.addListener(this);
- b.setStyleName(Button.STYLE_LINK);
- basic.addComponent(b);
-
- b = new Button("Link button w/ icon + tooltip");
- b.addListener(this);
- b.setStyleName(Button.STYLE_LINK);
- b.setIcon(new ThemeResource("icons/ok.png"));
- b.setDescription("Link-style, icon+tootip, no caption");
- bells.addComponent(b);
-
- b = new Button();
- b.addListener(this);
- b.setStyleName(Button.STYLE_LINK);
- b.setIcon(new ThemeResource("icons/ok.png"));
- b.setDescription("Link-style, icon+tootip, no caption");
- basic.addComponent(b);
-
- final Panel links = new Panel("Links");
- links.setStyleName(Panel.STYLE_LIGHT);
- main.addComponent(links);
- final Label desc = new Label(
- "The main difference between a Link and"
- + " a link-styled Button is that the Link works client-"
- + " side, whereas the Button works server side.<br/> This means"
- + " that the Button triggers some event on the server,"
- + " while the Link is a normal web-link. <br/><br/>Note that for"
- + " opening new windows, the Link might be a safer "
- + " choice, since popup-blockers might interfer with "
- + " server-initiated window opening.");
- desc.setContentMode(Label.CONTENT_XHTML);
- links.addComponent(desc);
- Link l = new Link("Vaadin home", new ExternalResource(
- "http://www.vaadin.com"));
- l.setDescription("Link without target name, opens in this window");
- links.addComponent(l);
-
- l = new Link("Vaadin home (new window)", new ExternalResource(
- "http://www.vaadin.com"));
- l.setTargetName("_blank");
- l.setDescription("Link with target name, opens in new window");
- links.addComponent(l);
-
- l = new Link("Vaadin home (new window, less decor)",
- new ExternalResource("http://www.vaadin.com"));
- l.setTargetName("_blank");
- l.setTargetBorder(Link.TARGET_BORDER_MINIMAL);
- l.setTargetName("_blank");
- l
- .setDescription("Link with target name and BORDER_MINIMAL, opens in new window with less decor");
- links.addComponent(l);
-
- l = new Link("Vaadin home (new 200x200 window, no decor, icon)",
- new ExternalResource("http://www.vaadin.com"), "_blank", 200,
- 200, Link.TARGET_BORDER_NONE);
- l.setTargetName("_blank");
- l
- .setDescription("Link with target name and BORDER_NONE, opens in new window with no decor");
- l.setIcon(new ThemeResource("icons/ok.png"));
- links.addComponent(l);
-
- }
-
- public void buttonClick(ClickEvent event) {
- final Button b = event.getButton();
- getWindow().showNotification(
- "Clicked"
- + (b instanceof CheckBox ? ", value: "
- + event.getButton().getValue() : ""));
-
- }
-
-}
diff --git a/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java b/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java deleted file mode 100644 index ad840c84c3..0000000000 --- a/src/com/vaadin/demo/featurebrowser/ClientCachingExample.java +++ /dev/null @@ -1,72 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * This example is a (simple) demonstration of client-side caching. The content
- * in one tab is intentionally made very slow to produce server-side. When the
- * user changes to this tab for the first time, there will be a 3 second wait
- * before the content shows up, but the second time it shows up immediately
- * since the content has not changed and is cached client-side.
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class ClientCachingExample extends CustomComponent {
-
- private static final String msg = "This example is a (simple) demonstration of client-side caching."
- + " The content in one tab is intentionally made very slow to"
- + " 'produce' server-side. When you changes to this tab for the"
- + " first time, there will be a 3 second wait before the content"
- + " shows up, but the second time it shows up immediately since the"
- + " content has not changed and is cached client-side.";
-
- public ClientCachingExample() {
-
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- main.addComponent(new Label(msg));
-
- final TabSheet ts = new TabSheet();
- main.addComponent(ts);
-
- Layout layout = new VerticalLayout();
- layout.setMargin(true);
- Label l = new Label("This is a normal label, quick to render.");
- l.setCaption("A normal label");
- layout.addComponent(l);
-
- ts.addTab(layout, "Normal", null);
-
- layout = new VerticalLayout();
- layout.setMargin(true);
- l = new Label("Slow label - until cached client side.") {
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- try {
- Thread.sleep(3000);
- } catch (final Exception e) {
- // IGNORED
- }
- super.paintContent(target);
- }
-
- };
- l.setCaption("A slow label");
- layout.addComponent(l);
- ts.addTab(layout, "Slow", null);
-
- }
-}
diff --git a/src/com/vaadin/demo/featurebrowser/ComboBoxExample.java b/src/com/vaadin/demo/featurebrowser/ComboBoxExample.java deleted file mode 100644 index 60ccd23f27..0000000000 --- a/src/com/vaadin/demo/featurebrowser/ComboBoxExample.java +++ /dev/null @@ -1,71 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.featurebrowser; - -import java.util.Random; - -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.AbstractSelect.Filtering; - -/** - * - */ -@SuppressWarnings("serial") -public class ComboBoxExample extends CustomComponent { - - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Robert", "Paula", - "Lenny", "Kenny", "Nathan", "Nicole", "Laura", "Jos", "Josie", - "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Adams", "Black", "Wilson", "Richards", "Thompson", - "McGoff", "Halas", "Jones", "Beck", "Sheridan", "Picard", "Hill", - "Fielding", "Einstein" }; - - public ComboBoxExample() { - final VerticalLayout main = new VerticalLayout(); - main.setMargin(true); - setCompositionRoot(main); - - // starts-with filter - final ComboBox s1 = new ComboBox("Select with starts-with filter"); - s1.setFilteringMode(Filtering.FILTERINGMODE_STARTSWITH); - s1.setWidth("20em"); - Random r = new Random(5); - for (int i = 0; i < 105; i++) { - s1 - .addItem(firstnames[(int) (r.nextDouble() * (firstnames.length - 1))] - + " " - + lastnames[(int) (r.nextDouble() * (lastnames.length - 1))]); - } - s1.setImmediate(true); - main.addComponent(s1); - - // contains filter - final ComboBox s2 = new ComboBox("Select with contains filter"); - s2.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS); - s2.setWidth("20em"); - for (int i = 0; i < 500; i++) { - s2 - .addItem(firstnames[(int) (r.nextDouble() * (firstnames.length - 1))] - + " " - + lastnames[(int) (r.nextDouble() * (lastnames.length - 1))]); - } - s2.setImmediate(true); - main.addComponent(s2); - - // initially empty - final ComboBox s3 = new ComboBox("Initially empty; enter your own"); - s3.setWidth("20em"); - s3.setImmediate(true); - s3.setNewItemsAllowed(true); - main.addComponent(s3); - - } - -} diff --git a/src/com/vaadin/demo/featurebrowser/EmbeddedBrowserExample.java b/src/com/vaadin/demo/featurebrowser/EmbeddedBrowserExample.java deleted file mode 100644 index 641838dfdd..0000000000 --- a/src/com/vaadin/demo/featurebrowser/EmbeddedBrowserExample.java +++ /dev/null @@ -1,89 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.featurebrowser; - -import java.net.MalformedURLException; -import java.net.URL; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.Select; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window.Notification; - -/** - * Demonstrates the use of Embedded and "suggesting" Select by creating a simple - * web-browser. Note: does not check for recursion. - * - * @author IT Mill Ltd. - * @see com.vaadin.ui.Window - */ -@SuppressWarnings("serial") -public class EmbeddedBrowserExample extends VerticalLayout implements - Select.ValueChangeListener { - - // Default URL to open. - private static final String DEFAULT_URL = "http://www.vaadin.com/"; - - // The embedded page - Embedded emb = new Embedded(); - - public EmbeddedBrowserExample() { - this(new String[] { DEFAULT_URL, "http://www.vaadin.com/learn", - "http://www.vaadin.com/api", "http://www.vaadin.com/book" }); - } - - public EmbeddedBrowserExample(String[] urls) { - setSizeFull(); - - // create the address combobox - final Select select = new Select(); - // allow input - select.setNewItemsAllowed(true); - // no empty selection - select.setNullSelectionAllowed(false); - // no 'go' -button clicking necessary - select.setImmediate(true); - // add some pre-configured URLs - for (int i = 0; i < urls.length; i++) { - select.addItem(urls[i]); - } - // add to layout - addComponent(select); - // add listener and select initial URL - select.addListener(this); - select.setValue(urls[0]); - - select.setWidth("100%"); - - // configure the embedded and add to layout - emb.setType(Embedded.TYPE_BROWSER); - emb.setSizeFull(); - addComponent(emb); - // make the embedded as large as possible - setExpandRatio(emb, 1); - - } - - public void valueChange(ValueChangeEvent event) { - final String url = (String) event.getProperty().getValue(); - if (url != null) { - try { - // the selected url has changed, let's go there - @SuppressWarnings("unused") - URL u = new URL(url); - emb.setSource(new ExternalResource(url)); - - } catch (MalformedURLException e) { - getWindow().showNotification("Invalid address", - e.getMessage() + " (example: http://www.vaadin.com)", - Notification.TYPE_WARNING_MESSAGE); - } - - } - - } -} diff --git a/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java b/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java deleted file mode 100644 index 5b9e769015..0000000000 --- a/src/com/vaadin/demo/featurebrowser/FeatureBrowser.java +++ /dev/null @@ -1,383 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.featurebrowser; - -import java.util.HashMap; -import java.util.Iterator; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Select; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.Tree; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -/** - * - * @author IT Mill Ltd. - * @see com.vaadin.ui.Window - */ -@SuppressWarnings("serial") -public class FeatureBrowser extends com.vaadin.Application implements - Select.ValueChangeListener { - - // Property IDs - private static final Object PROPERTY_ID_CATEGORY = "Category"; - private static final Object PROPERTY_ID_NAME = "Name"; - private static final Object PROPERTY_ID_DESC = "Description"; - private static final Object PROPERTY_ID_CLASS = "Class"; - private static final Object PROPERTY_ID_VIEWED = "Viewed"; - - // Global components - private Tree tree; - private Table table; - private TabSheet ts; - - // Example "cache" - private final HashMap<Class<?>, Component> exampleInstances = new HashMap<Class<?>, Component>(); - private String section; - - // List of examples - private static final Object[][] demos = new Object[][] { - // Category, Name, Desc, Class, Viewed - // Getting started: Labels - { "Getting started", "Labels", "Some variations of Labels", - LabelExample.class }, - // Getting started: Buttons - { "Getting started", "Buttons and links", - "Various Buttons and Links", ButtonExample.class }, - // Getting started: Fields - { "Getting started", "Basic value input", - "TextFields, DateFields, and such", ValueInputExample.class }, - // - { "Getting started", "RichText", "Rich text editing", - RichTextExample.class }, - // Getting started: Selects - { "Getting started", "Choices, choices", - "Some variations of simple selects", SelectExample.class }, - // Layouts - { "Layouts", "Basic layouts", "Laying out components", - LayoutExample.class }, - // Layouts - { "Layouts", "Accordion", "Play the Accordion!", - AccordionExample.class }, - // Wrangling data: ComboBox - { "Wrangling data", "ComboBox", "ComboBox - the swiss army select", - ComboBoxExample.class }, - // Wrangling data: Table - { - "Wrangling data", - "Table (\"grid\")", - "Table with bells, whistles, editmode and actions (contextmenu)", - TableExample.class }, - // Wrangling data: Form - { "Wrangling data", "Form", "Every application needs forms", - FormExample.class }, - // Wrangling data: Tree - { "Wrangling data", "Tree", "A hierarchy of things", - TreeExample.class }, - // Misc: Notifications - { "Misc", "Notifications", "Notifications can improve usability", - NotificationExample.class }, - // Misc: Caching - { "Misc", "Client caching", "Demonstrating of client-side caching", - ClientCachingExample.class }, - // Misc: Embedded - { "Misc", "Embedding", - "Embedding resources - another site in this case", - EmbeddedBrowserExample.class }, - // Windowing - { "Misc", "Windowing", "About windowing", WindowingExample.class }, - // JavaScript API - { "Misc", "JavaScript API", "JavaScript to Vaadin communication", - JavaScriptAPIExample.class }, - // END - }; - - @Override - public void init() { - - // Need to set a theme for ThemeResources to work - setTheme("example"); - - // Create new window for the application and give the window a visible. - final Window main = new Window("Vaadin 6"); - // set as main window - setMainWindow(main); - - final SplitPanel split = new SplitPanel( - SplitPanel.ORIENTATION_HORIZONTAL); - split.setSplitPosition(200, SplitPanel.UNITS_PIXELS); - main.setContent(split); - - final HashMap<String, Object> sectionIds = new HashMap<String, Object>(); - final HierarchicalContainer container = createContainer(); - final Object rootId = container.addItem(); - Item item = container.getItem(rootId); - Property p = item.getItemProperty(PROPERTY_ID_NAME); - p.setValue("All examples"); - for (int i = 0; i < demos.length; i++) { - final Object[] demo = demos[i]; - final String section = (String) demo[0]; - Object sectionId; - if (sectionIds.containsKey(section)) { - sectionId = sectionIds.get(section); - } else { - sectionId = container.addItem(); - sectionIds.put(section, sectionId); - container.setParent(sectionId, rootId); - item = container.getItem(sectionId); - p = item.getItemProperty(PROPERTY_ID_NAME); - p.setValue(section); - } - final Object id = container.addItem(); - container.setParent(id, sectionId); - initItem(container.getItem(id), demo); - - } - - tree = new Tree(); - tree.setDebugId("FeatureBrowser: Main Tree"); - tree.setSelectable(true); - tree.setMultiSelect(false); - tree.setNullSelectionAllowed(false); - tree.setContainerDataSource(container); - tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); - tree.setItemCaptionPropertyId(PROPERTY_ID_NAME); - tree.addListener(this); - tree.setImmediate(true); - tree.expandItemsRecursively(rootId); - for (Iterator<?> i = container.getItemIds().iterator(); i.hasNext();) { - Object id = i.next(); - if (container.getChildren(id) == null) { - tree.setChildrenAllowed(id, false); - } - } - - split.addComponent(tree); - - final SplitPanel split2 = new SplitPanel(); - split2.setSplitPosition(200, SplitPanel.UNITS_PIXELS); - split.addComponent(split2); - - table = new Table(); - table.setDebugId("FeatureBrowser: Main Table"); - table.setSizeFull(); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - try { - table.setContainerDataSource((IndexedContainer) container.clone()); - } catch (final Exception e) { - e.printStackTrace(System.err); - } - // Hide some columns - table.setVisibleColumns(new Object[] { PROPERTY_ID_CATEGORY, - PROPERTY_ID_NAME, PROPERTY_ID_DESC, PROPERTY_ID_VIEWED }); - table.addListener(this); - table.setImmediate(true); - split2.addComponent(table); - - final VerticalLayout exp = new VerticalLayout(); - exp.setSizeFull(); - exp.setMargin(true); - split2.addComponent(exp); - - final HorizontalLayout wbLayout = new HorizontalLayout(); - Button b = new Button("Open in sub-window", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Component component = (Component) ts.getComponentIterator() - .next(); - String caption = ts.getTab(component).getCaption(); - try { - component = component.getClass().newInstance(); - } catch (Exception e) { - // Could not create - return; - } - Window w = new Window(caption); - w.setWidth("640px"); - if (Layout.class.isAssignableFrom(component.getClass())) { - w.setContent((Layout) component); - } else { - // w.getLayout().getSize().setSizeFull(); - w.addComponent(component); - } - getMainWindow().addWindow(w); - } - }); - b.setStyleName(Button.STYLE_LINK); - wbLayout.addComponent(b); - b = new Button("Open in native window", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Component component = (Component) ts.getComponentIterator() - .next(); - final String caption = ts.getTab(component).getCaption(); - Window w = getWindow(caption); - if (w == null) { - try { - component = component.getClass().newInstance(); - } catch (final Exception e) { - // Could not create - return; - } - w = new Window(caption); - w.setName(caption); - if (Layout.class.isAssignableFrom(component.getClass())) { - w.setContent((Layout) component); - } else { - // w.getLayout().getSize().setSizeFull(); - w.addComponent(component); - } - addWindow(w); - } - getMainWindow().open(new ExternalResource(w.getURL()), caption); - } - }); - b.setStyleName(Button.STYLE_LINK); - wbLayout.addComponent(b); - - exp.addComponent(wbLayout); - exp.setComponentAlignment(wbLayout, Alignment.TOP_RIGHT); - - ts = new TabSheet(); - ts.setSizeFull(); - ts.addTab(new Label(""), "Choose example", null); - exp.addComponent(ts); - exp.setExpandRatio(ts, 1); - - final Label status = new Label( - "<a href=\"http://www.vaadin.com/learn\">30 Seconds to Vaadin</a>" - + " | <a href=\"http://www.vaadin.com/book\">Book of Vaadin</a>"); - status.setContentMode(Label.CONTENT_XHTML); - exp.addComponent(status); - exp.setComponentAlignment(status, Alignment.MIDDLE_RIGHT); - - // select initial section ("All") - tree.setValue(rootId); - - getMainWindow() - .showNotification( - "Welcome", - "Choose an example to begin.<br/><br/>And remember to experiment!", - Window.Notification.TYPE_TRAY_NOTIFICATION); - } - - private void initItem(Item item, Object[] data) { - int p = 0; - Property prop = item.getItemProperty(PROPERTY_ID_CATEGORY); - prop.setValue(data[p++]); - prop = item.getItemProperty(PROPERTY_ID_NAME); - prop.setValue(data[p++]); - prop = item.getItemProperty(PROPERTY_ID_DESC); - prop.setValue(data[p++]); - prop = item.getItemProperty(PROPERTY_ID_CLASS); - prop.setValue(data[p++]); - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - c.addContainerProperty(PROPERTY_ID_CATEGORY, String.class, null); - c.addContainerProperty(PROPERTY_ID_NAME, String.class, ""); - c.addContainerProperty(PROPERTY_ID_DESC, String.class, ""); - c.addContainerProperty(PROPERTY_ID_CLASS, Class.class, null); - c.addContainerProperty(PROPERTY_ID_VIEWED, Embedded.class, null); - return c; - } - - public void valueChange(ValueChangeEvent event) { - if (event.getProperty() == tree) { - final Object id = tree.getValue(); - if (id == null) { - return; - } - final Item item = tree.getItem(id); - // - String newSection; - if (tree.isRoot(id)) { - newSection = ""; // show all sections - } else if (tree.hasChildren(id)) { - newSection = (String) item.getItemProperty(PROPERTY_ID_NAME) - .getValue(); - } else { - newSection = (String) item - .getItemProperty(PROPERTY_ID_CATEGORY).getValue(); - } - - table.setValue(null); - final IndexedContainer c = (IndexedContainer) table - .getContainerDataSource(); - - if (newSection != null && !newSection.equals(section)) { - c.removeAllContainerFilters(); - c.addContainerFilter(PROPERTY_ID_CATEGORY, newSection, false, - true); - } - section = newSection; - if (!tree.hasChildren(id)) { - // Example, not section - // update table selection - table.setValue(id); - } - - } else if (event.getProperty() == table) { - if (table.getValue() != null) { - table.removeListener(this); - tree.setValue(table.getValue()); - table.addListener(this); - final Item item = table.getItem(table.getValue()); - final Class<?> c = (Class<?>) item.getItemProperty( - PROPERTY_ID_CLASS).getValue(); - final Component component = getComponent(c); - if (component != null) { - final String caption = (String) item.getItemProperty( - PROPERTY_ID_NAME).getValue(); - ts.removeAllComponents(); - ts.addTab(component, caption, null); - } - // update "viewed" state - final Property p = item.getItemProperty(PROPERTY_ID_VIEWED); - if (p.getValue() == null) { - p.setValue(new Embedded("", new ThemeResource( - "icons/ok.png"))); - } - table.requestRepaint(); - } - } - - } - - private Component getComponent(Class<?> componentClass) { - if (!exampleInstances.containsKey(componentClass)) { - try { - final Component c = (Component) componentClass.newInstance(); - exampleInstances.put(componentClass, c); - } catch (final Exception e) { - return null; - } - } - return exampleInstances.get(componentClass); - } - -} diff --git a/src/com/vaadin/demo/featurebrowser/FormExample.java b/src/com/vaadin/demo/featurebrowser/FormExample.java deleted file mode 100644 index 52a2a98d80..0000000000 --- a/src/com/vaadin/demo/featurebrowser/FormExample.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.vaadin.demo.featurebrowser; - -import com.vaadin.data.Item; -import com.vaadin.data.Validator; -import com.vaadin.data.Validator.InvalidValueException; -import com.vaadin.data.util.BeanItem; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * This example demonstrates the most important features of the Form component: - * binding Form to a JavaBean so that form fields are automatically generated - * from the bean properties, creation of custom field editors using a - * FieldFactory, customizing the form without FieldFactory, buffering - * (commit/discard) and validation. Please note that the example is quite a bit - * more complex than real use, as it tries to demonstrate more features than - * needed in general case. - */ -@SuppressWarnings("serial") -public class FormExample extends CustomComponent { - - static final String cities[] = { "Amsterdam", "Berlin", "Helsinki", - "Hong Kong", "London", "Luxemburg", "New York", "Oslo", "Paris", - "Rome", "Stockholm", "Tokyo", "Turku" }; - - /** Compose the demo. */ - public FormExample() { - - // Example data model - final Address dataModel = new Address(); - Button peekDataModelState = new Button("Show the data model state", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - getWindow().showNotification( - dataModel.getAddressAsText()); - } - }); - - // Example form - final AddressForm form = new AddressForm("Contact Information"); - form.setDataSource(dataModel); - form - .setDescription("Please enter valid name and address. Fields marked with * are required. " - + "If you try to commit with invalid values, a form error message is displayed. " - + "(Address is required but failing to give it a value does not display an error.)"); - - // Layout the example - VerticalLayout root = new VerticalLayout(); - root.setMargin(true); - root.setSpacing(true); - root.addComponent(form); - root.addComponent(peekDataModelState); - setCompositionRoot(root); - } - - public static class AddressForm extends Form { - public AddressForm(String caption) { - - setCaption(caption); - - // Use custom field factory to modify the defaults on how the - // components are created - setFormFieldFactory(new MyFieldFactory()); - - // Add Commit and Discard controls to the form. - - Button commit = new Button("Save", new ClickListener() { - - public void buttonClick(ClickEvent event) { - try { - commit(); - } catch (InvalidValueException e) { - // Failed to commit. The validation errors are - // automatically shown to the user. - } - } - - }); - - Button discard = new Button("Reset", this, "discard"); - HorizontalLayout footer = new HorizontalLayout(); - footer.addComponent(commit); - footer.addComponent(discard); - setFooter(footer); - } - - public void setDataSource(Address dataModel) { - - // Set the form to edit given datamodel by converting pojo used as - // the datamodel to Item - setItemDataSource(new BeanItem(dataModel)); - - // Ensure that the fields are shown in correct order as the - // datamodel does not force any specific order. - setVisibleItemProperties(new String[] { "name", "streetAddress", - "postalCode", "city" }); - - // For examples sake, customize some of the form fields directly - // here. The alternative way is to use custom field factory as shown - // above. - getField("name").setRequired(true); - getField("name").setDescription("Please enter name"); - getField("name").setRequiredError("Name is missing"); - getField("streetAddress").setRequired(true); // No error message - getField("streetAddress").setDescription( - "Please enter street adderss."); - getField("postalCode").setRequired(true); // No error message - getField("postalCode").setDescription( - "Please enter postal code. Example: 12345."); - replaceWithSelect("city", cities, cities).setNewItemsAllowed(true); - getField("city") - .setDescription( - "Select city from list or type it. City field is not required."); - - // Set the form to act immediately on user input. This is - // automatically transports data between the client and the server - // to do server-side validation. - setImmediate(true); - - // Enable buffering so that commit() must be called for the form - // before input is written to the data. (Form input is not written - // immediately through to the underlying object.) - setWriteThrough(false); - } - } - - /** - * This is example on how to customize field creation. Any kind of field - * components could be created on the fly. - */ - static class MyFieldFactory extends DefaultFieldFactory { - - @Override - public Field createField(Item item, Object propertyId, - Component uiContext) { - - Field field = super.createField(item, propertyId, uiContext); - - if ("postalCode".equals(propertyId)) { - ((TextField) field).setColumns(5); - field.addValidator(new PostalCodeValidator()); - } - - return field; - } - - } - - /** - * This is an example of how to create a custom validator for automatic - * input validation. - */ - static class PostalCodeValidator implements Validator { - - public boolean isValid(Object value) { - if (value == null || !(value instanceof String)) { - return false; - } - - return ((String) value).matches("[0-9]{5}"); - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException( - "Postal code must be a five digit number."); - } - } - } - - /** - * Contact information data model created as POJO. Note that in many cases - * it would be a good idea to implement Item -interface for the datamodel to - * make it directly bindable to form (without BeanItem wrapper) - */ - public static class Address { - String name = ""; - String streetAddress = ""; - String postalCode = ""; - String city; - - public String getAddressAsText() { - return name + "\n" + streetAddress + "\n" + postalCode + " " - + (city == null ? "" : city); - } - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setStreetAddress(String address) { - streetAddress = address; - } - - public String getStreetAddress() { - return streetAddress; - } - - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - - public String getPostalCode() { - return postalCode; - } - - public void setCity(String city) { - this.city = city; - } - - public String getCity() { - return city; - } - } - -} diff --git a/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java b/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java deleted file mode 100644 index 0ce1afb511..0000000000 --- a/src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java +++ /dev/null @@ -1,559 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.featurebrowser; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.GregorianCalendar; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.Container.Indexed; -import com.vaadin.data.util.BeanItem; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * This example demonstrates the use of generated columns in a table. Generated - * columns can be used for formatting values or calculating them from other - * columns (or properties of the items). - * - * For the data model, we use POJOs bound to a custom Container with BeanItem - * items. - * - * @author magi - */ -@SuppressWarnings("serial") -public class GeneratedColumnExample extends CustomComponent { - /** - * The business model: fill-up at a gas station. - */ - public class FillUp { - Date date; - double quantity; - double total; - - public FillUp() { - } - - public FillUp(int day, int month, int year, double quantity, - double total) { - date = new GregorianCalendar(year, month - 1, day).getTime(); - this.quantity = quantity; - this.total = total; - } - - /** Calculates price per unit of quantity (€/l). */ - public double price() { - if (quantity != 0.0) { - return total / quantity; - } else { - return 0.0; - } - } - - /** Calculates average daily consumption between two fill-ups. */ - public double dailyConsumption(FillUp other) { - double difference_ms = date.getTime() - other.date.getTime(); - double days = difference_ms / 1000 / 3600 / 24; - if (days < 0.5) { - days = 1.0; // Avoid division by zero if two fill-ups on the - // same day. - } - return quantity / days; - } - - /** Calculates average daily consumption between two fill-ups. */ - public double dailyCost(FillUp other) { - return price() * dailyConsumption(other); - } - - // Getters and setters - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public double getQuantity() { - return quantity; - } - - public void setQuantity(double quantity) { - this.quantity = quantity; - } - - public double getTotal() { - return total; - } - - public void setTotal(double total) { - this.total = total; - } - }; - - /** - * This is a custom container that allows adding BeanItems inside it. The - * BeanItem objects must be bound to an object. The item ID is an Integer - * from 0 to 99. - * - * Most of the interface methods are implemented with just dummy - * implementations, as they are not needed in this example. - */ - public class MySimpleIndexedContainer implements Container, Indexed { - ArrayList<BeanItem> items; - Object itemtemplate; - - public MySimpleIndexedContainer(Object itemtemplate) { - this.itemtemplate = itemtemplate; - items = new ArrayList<BeanItem>(); // Yeah this is just a test - } - - public boolean addContainerProperty(Object propertyId, Class<?> type, - Object defaultValue) throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - public Item addItem(Object itemId) throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - /** - * This addItem method is specific for this container and allows adding - * BeanItem objects. The BeanItems must be bound to MyBean objects. - */ - public void addItem(BeanItem item) throws UnsupportedOperationException { - items.add(item); - } - - public boolean containsId(Object itemId) { - if (itemId instanceof Integer) { - int pos = ((Integer) itemId).intValue(); - if (pos >= 0 && pos < items.size()) { - return items.get(pos) != null; - } - } - return false; - } - - /** - * The Table will call this method to get the property objects for the - * columns. It uses the property objects to determine the data types of - * the columns. - */ - public Property getContainerProperty(Object itemId, Object propertyId) { - if (itemId instanceof Integer) { - int pos = ((Integer) itemId).intValue(); - if (pos >= 0 && pos < items.size()) { - Item item = items.get(pos); - - // The BeanItem provides the property objects for the items. - return item.getItemProperty(propertyId); - } - } - return null; - } - - /** Table calls this to get the column names. */ - public Collection<?> getContainerPropertyIds() { - Item item = new BeanItem(itemtemplate); - - // The BeanItem knows how to get the property names from the bean. - return item.getItemPropertyIds(); - } - - public Item getItem(Object itemId) { - if (itemId instanceof Integer) { - int pos = ((Integer) itemId).intValue(); - if (pos >= 0 && pos < items.size()) { - return items.get(pos); - } - } - return null; - } - - public Collection<?> getItemIds() { - ArrayList<Integer> ids = new ArrayList<Integer>(items.size()); - for (int i = 0; i < items.size(); i++) { - ids.add(Integer.valueOf(i)); - } - return ids; - } - - public Class<?> getType(Object propertyId) { - return BeanItem.class; - } - - public boolean removeAllItems() throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException(); - } - - public int size() { - return items.size(); - } - - public Object addItemAt(int index) throws UnsupportedOperationException { - // TODO Auto-generated method stub - return null; - } - - public Item addItemAt(int index, Object newItemId) - throws UnsupportedOperationException { - // TODO Auto-generated method stub - return null; - } - - public Object getIdByIndex(int index) { - return Integer.valueOf(index); - } - - public int indexOfId(Object itemId) { - return ((Integer) itemId).intValue(); - } - - public Object addItemAfter(Object previousItemId) - throws UnsupportedOperationException { - // TODO Auto-generated method stub - return null; - } - - public Item addItemAfter(Object previousItemId, Object newItemId) - throws UnsupportedOperationException { - // TODO Auto-generated method stub - return null; - } - - public Object firstItemId() { - return new Integer(0); - } - - public boolean isFirstId(Object itemId) { - return ((Integer) itemId).intValue() == 0; - } - - public boolean isLastId(Object itemId) { - return ((Integer) itemId).intValue() == (items.size() - 1); - } - - public Object lastItemId() { - return new Integer(items.size() - 1); - } - - public Object nextItemId(Object itemId) { - int pos = indexOfId(itemId); - if (pos >= items.size() - 1) { - return null; - } - return getIdByIndex(pos + 1); - } - - public Object prevItemId(Object itemId) { - int pos = indexOfId(itemId); - if (pos <= 0) { - return null; - } - return getIdByIndex(pos - 1); - } - } - - /** Formats the dates in a column containing Date objects. */ - class DateColumnGenerator implements Table.ColumnGenerator { - /** - * Generates the cell containing the Date value. The column is - * irrelevant in this use case. - */ - public Component generateCell(Table source, Object itemId, - Object columnId) { - Property prop = source.getItem(itemId).getItemProperty(columnId); - if (prop.getType().equals(Date.class)) { - Label label = new Label(String.format("%tF", - new Object[] { (Date) prop.getValue() })); - label.addStyleName("column-type-date"); - return label; - } - - return null; - } - } - - /** Formats the value in a column containing Double objects. */ - class ValueColumnGenerator implements Table.ColumnGenerator { - String format; /* Format string for the Double values. */ - - /** Creates double value column formatter with the given format string. */ - public ValueColumnGenerator(String format) { - this.format = format; - } - - /** - * Generates the cell containing the Double value. The column is - * irrelevant in this use case. - */ - public Component generateCell(Table source, Object itemId, - Object columnId) { - Property prop = source.getItem(itemId).getItemProperty(columnId); - if (prop.getType().equals(Double.class)) { - Label label = new Label(String.format(format, - new Object[] { (Double) prop.getValue() })); - - // Set styles for the column: one indicating that it's a value - // and a more - // specific one with the column name in it. This assumes that - // the column - // name is proper for CSS. - label.addStyleName("column-type-value"); - label.addStyleName("column-" + (String) columnId); - return label; - } - return null; - } - } - - /** Table column generator for calculating price column. */ - class PriceColumnGenerator implements Table.ColumnGenerator { - public Component generateCell(Table source, Object itemId, - Object columnId) { - // Retrieve the item. - BeanItem item = (BeanItem) source.getItem(itemId); - - // Retrieves the underlying POJO from the item. - FillUp fillup = (FillUp) item.getBean(); - - // Do the business logic - double price = fillup.price(); - - // Create the generated component for displaying the calcucated - // value. - Label label = new Label(String.format("%1.2f €", - new Object[] { new Double(price) })); - - // We set the style here. You can't use a CellStyleGenerator for - // generated columns. - label.addStyleName("column-price"); - return label; - } - } - - /** Table column generator for calculating consumption column. */ - class ConsumptionColumnGenerator implements Table.ColumnGenerator { - /** - * Generates a cell containing value calculated from the item. - */ - public Component generateCell(Table source, Object itemId, - Object columnId) { - Indexed indexedSource = (Indexed) source.getContainerDataSource(); - - // Can not calculate consumption for the first item. - if (indexedSource.isFirstId(itemId)) { - Label label = new Label("N/A"); - label.addStyleName("column-consumption"); - return label; - } - - // Index of the previous item. - Object prevItemId = indexedSource.prevItemId(itemId); - - // Retrieve the POJOs. - FillUp fillup = (FillUp) ((BeanItem) indexedSource.getItem(itemId)) - .getBean(); - FillUp prev = (FillUp) ((BeanItem) source.getItem(prevItemId)) - .getBean(); - - // Do the business logic - return generateCell(fillup, prev); - } - - public Component generateCell(FillUp fillup, FillUp prev) { - double consumption = fillup.dailyConsumption(prev); - - // Generate the component for displaying the calculated value. - Label label = new Label(String.format("%3.2f l", - new Object[] { new Double(consumption) })); - - // We set the style here. You can't use a CellStyleGenerator for - // generated columns. - label.addStyleName("column-consumption"); - return label; - } - } - - /** Table column generator for calculating daily cost column. */ - class DailyCostColumnGenerator extends ConsumptionColumnGenerator { - @Override - public Component generateCell(FillUp fillup, FillUp prev) { - double dailycost = fillup.dailyCost(prev); - - // Generate the component for displaying the calculated value. - Label label = new Label(String.format("%3.2f €", - new Object[] { new Double(dailycost) })); - - // We set the style here. You can't use a CellStyleGenerator for - // generated columns. - label.addStyleName("column-dailycost"); - return label; - } - } - - /** - * Custom field factory that sets the fields as immediate. - */ - public class ImmediateFieldFactory extends DefaultFieldFactory { - @Override - public Field createField(Container container, Object itemId, - Object propertyId, Component uiContext) { - // Let the DefaultFieldFactory create the fields - Field field = super.createField(container, itemId, propertyId, - uiContext); - - // ...and just set them as immediate - ((AbstractField) field).setImmediate(true); - - return field; - } - } - - public GeneratedColumnExample() { - final Table table = new Table(); - - // Define table columns. These include also the column for the generated - // column, because we want to set the column label to something - // different than the property ID. - table - .addContainerProperty("date", Date.class, null, "Date", null, - null); - table.addContainerProperty("quantity", Double.class, null, - "Quantity (l)", null, null); - table.addContainerProperty("price", Double.class, null, "Price (€/l)", - null, null); - table.addContainerProperty("total", Double.class, null, "Total (€)", - null, null); - table.addContainerProperty("consumption", Double.class, null, - "Consumption (l/day)", null, null); - table.addContainerProperty("dailycost", Double.class, null, - "Daily Cost (€/day)", null, null); - - // Define the generated columns and their generators. - table.addGeneratedColumn("date", new DateColumnGenerator()); - table - .addGeneratedColumn("quantity", new ValueColumnGenerator( - "%.2f l")); - table.addGeneratedColumn("price", new PriceColumnGenerator()); - table.addGeneratedColumn("total", new ValueColumnGenerator("%.2f €")); - table.addGeneratedColumn("consumption", - new ConsumptionColumnGenerator()); - table.addGeneratedColumn("dailycost", new DailyCostColumnGenerator()); - - // Create a data source and bind it to the table. - MySimpleIndexedContainer data = new MySimpleIndexedContainer( - new FillUp()); - table.setContainerDataSource(data); - - // Generated columns are automatically placed after property columns, so - // we have to set the order of the columns explicitly. - table.setVisibleColumns(new Object[] { "date", "quantity", "price", - "total", "consumption", "dailycost" }); - - // Add some data. - data.addItem(new BeanItem(new FillUp(19, 2, 2005, 44.96, 51.21))); - data.addItem(new BeanItem(new FillUp(30, 3, 2005, 44.91, 53.67))); - data.addItem(new BeanItem(new FillUp(20, 4, 2005, 42.96, 49.06))); - data.addItem(new BeanItem(new FillUp(23, 5, 2005, 47.37, 55.28))); - data.addItem(new BeanItem(new FillUp(6, 6, 2005, 35.34, 41.52))); - data.addItem(new BeanItem(new FillUp(30, 6, 2005, 16.07, 20.00))); - data.addItem(new BeanItem(new FillUp(2, 7, 2005, 36.40, 36.19))); - data.addItem(new BeanItem(new FillUp(6, 7, 2005, 39.17, 50.90))); - data.addItem(new BeanItem(new FillUp(27, 7, 2005, 43.43, 53.03))); - data.addItem(new BeanItem(new FillUp(17, 8, 2005, 20, 29.18))); - data.addItem(new BeanItem(new FillUp(30, 8, 2005, 46.06, 59.09))); - data.addItem(new BeanItem(new FillUp(22, 9, 2005, 46.11, 60.36))); - data.addItem(new BeanItem(new FillUp(14, 10, 2005, 41.51, 50.19))); - data.addItem(new BeanItem(new FillUp(12, 11, 2005, 35.24, 40.00))); - data.addItem(new BeanItem(new FillUp(28, 11, 2005, 45.26, 53.27))); - - // Have a check box that allows the user to make the quantity - // and total columns editable. - final CheckBox editable = new CheckBox( - "Edit the input values - calculated columns are regenerated"); - editable.setImmediate(true); - editable.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - table.setEditable(editable.booleanValue()); - - // The columns may not be generated when we want to have them - // editable. - if (editable.booleanValue()) { - table.removeGeneratedColumn("quantity"); - table.removeGeneratedColumn("total"); - } else { - // In non-editable mode we want to show the formatted - // values. - table.addGeneratedColumn("quantity", - new ValueColumnGenerator("%.2f l")); - table.addGeneratedColumn("total", new ValueColumnGenerator( - "%.2f €")); - } - // The visible columns are affected by removal and addition of - // generated columns so we have to redefine them. - table.setVisibleColumns(new Object[] { "date", "quantity", - "price", "total", "consumption", "dailycost" }); - } - }); - - // Use a custom field factory to set the edit fields as immediate. - // This is used when the table is in editable mode. - table.setTableFieldFactory(new ImmediateFieldFactory()); - - // Setting the table itself as immediate has no relevance in this - // example, - // because it is relevant only if the table is selectable and we want to - // get the selection changes immediately. - table.setImmediate(true); - - table.setHeight("300px"); - - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - layout - .addComponent(new Label( - "Table with column generators that format and calculate cell values.")); - layout.addComponent(table); - layout.addComponent(editable); - layout.addComponent(new Label( - "Columns displayed in blue are calculated from Quantity and Total. " - + "Others are simply formatted.")); - layout.setExpandRatio(table, 1); - layout.setSizeUndefined(); - setCompositionRoot(layout); - // setSizeFull(); - } -} diff --git a/src/com/vaadin/demo/featurebrowser/JavaScriptAPIExample.java b/src/com/vaadin/demo/featurebrowser/JavaScriptAPIExample.java deleted file mode 100644 index 70ff20daac..0000000000 --- a/src/com/vaadin/demo/featurebrowser/JavaScriptAPIExample.java +++ /dev/null @@ -1,98 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import java.util.Date;
-
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * An example using a RichTextArea to edit a Label in XHTML-mode.
- *
- */
-@SuppressWarnings("serial")
-public class JavaScriptAPIExample extends CustomComponent {
-
- public static final String txt = "<p>For advanced client side programmers Vaadin offers a simple method which can be used to force sync client with server. This may be needed for example if another part of a mashup changes things on server.</p> (more examples will be added here as the APIs are made public)<br/><br/><A href=\"javascript:vaadin.forceSync();\">javascript:vaadin.forceSync();</A>";
-
- private final VerticalLayout main;
- private final Label l;
- private final TextField editor = new TextField();
-
- public JavaScriptAPIExample() {
- // main layout
- main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
- editor.setRows(7);
- editor.setColumns(50);
- // Add the label
- l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
- main.addComponent(l);
- // Edit button with inline click-listener
- Button b = new Button("Edit", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- // swap Label <-> RichTextArea
- if (main.getComponentIterator().next() == l) {
- editor.setValue(l.getValue());
- main.replaceComponent(l, editor);
- event.getButton().setCaption("Save");
- } else {
- l.setValue(editor.getValue());
- main.replaceComponent(editor, l);
- event.getButton().setCaption("Edit");
- }
- }
- });
- main.addComponent(b);
- main.setComponentAlignment(b, Alignment.MIDDLE_RIGHT);
-
- //
- Label l = new Label(
- "This label will update it's server-side value AFTER it's rendered to the client-side. "
- + "The client will be synchronized on reload, when you click a button, "
- + "or when vaadin.forceSync() is called.") {
-
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
-
- super.paintContent(target);
- Delay d = new Delay(this);
- d.start();
- }
-
- };
- main.addComponent(l);
-
- }
-
- private class Delay extends Thread {
- Label label;
-
- public Delay(Label l) {
- label = l;
- }
-
- @Override
- public void run() {
- try {
- Thread.sleep(500);
- label.setValue(new Date().toString());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- }
-}
diff --git a/src/com/vaadin/demo/featurebrowser/LabelExample.java b/src/com/vaadin/demo/featurebrowser/LabelExample.java deleted file mode 100644 index 0e89cbd77d..0000000000 --- a/src/com/vaadin/demo/featurebrowser/LabelExample.java +++ /dev/null @@ -1,78 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-
-/**
- * Shows a few variations of Labels, including the effects of XHTML- and
- * pre-formatted mode.
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class LabelExample extends CustomComponent {
-
- private static final String xhtml = "This text has <b>HTML</b> formatting.<br/>"
- + "A plain <i>Label</i> will show the markup, while a <u>XHTML-mode</u>"
- + " <i>Label</i> will show the formatted text.";
-
- private static final String pre = "This text has linebreaks.\n\n"
- + "They will show up in a preformatted Label,\n"
- + "but not in a \"plain\" Label.\n\n"
- + " This is an indented row. \n Same indentation here.";
-
- public LabelExample() {
- final GridLayout g = new GridLayout(2, 4);
- g.setMargin(true);
- setCompositionRoot(g);
- g.setWidth("100%");
-
- // plain w/o caption
- Panel p = getExpamplePanel("Plain");
- Label l = new Label("A plain label without caption.");
- p.addComponent(l);
- g.addComponent(p);
- // plain w/ caption
- p = getExpamplePanel("Plain w/ caption + tooltip");
- l = new Label("A plain label with caption.");
- l.setCaption("Label caption");
- l.setDescription("This is a description (tooltip) for the label.");
- p.addComponent(l);
- g.addComponent(p);
- // plain w/ xhtml
- p = getExpamplePanel("Plain w/ XHTML content");
- l = new Label(xhtml);
- p.addComponent(l);
- g.addComponent(p);
- // xhtml w/ xhtml
- p = getExpamplePanel("XHTML-mode w/ XHTML content");
- l = new Label(xhtml);
- l.setContentMode(Label.CONTENT_XHTML);
- p.addComponent(l);
- g.addComponent(p);
- // plain w/ preformatted
- p = getExpamplePanel("Plain w/ preformatted content");
- l = new Label(pre);
- p.addComponent(l);
- g.addComponent(p);
- // preformatted w/ preformatted
- p = getExpamplePanel("Preformatted-mode w/ preformatted content");
- l = new Label(pre);
- l.setContentMode(Label.CONTENT_PREFORMATTED);
- p.addComponent(l);
- g.addComponent(p);
-
- }
-
- private Panel getExpamplePanel(String caption) {
- Panel p = new Panel(caption);
- p.addStyleName(Panel.STYLE_LIGHT);
- return p;
- }
-}
diff --git a/src/com/vaadin/demo/featurebrowser/LayoutExample.java b/src/com/vaadin/demo/featurebrowser/LayoutExample.java deleted file mode 100644 index 34152c9c86..0000000000 --- a/src/com/vaadin/demo/featurebrowser/LayoutExample.java +++ /dev/null @@ -1,89 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * A few examples of layout possibilities.
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class LayoutExample extends CustomComponent {
-
- public LayoutExample() {
-
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- final GridLayout g = new GridLayout(2, 5);
- g.setWidth("100%");
- main.addComponent(g);
-
- // panel
- Panel p = new Panel("This is a normal panel");
- Label l = new Label("A normal panel.");
- p.addComponent(l);
- g.addComponent(p);
- // lightpanel
- p = new Panel("This is a light panel");
- p.setStyleName(Panel.STYLE_LIGHT);
- l = new Label("A light-style panel.");
- p.addComponent(l);
- g.addComponent(p);
-
- TabSheet ts = new TabSheet();
- g.addComponent(ts, 0, 1, 1, 1);
-
- VerticalLayout ol = new VerticalLayout();
- ol.setMargin(true);
- ol.addComponent(new Label("Component 1"));
- ol.addComponent(new Label("Component 2"));
- ol.addComponent(new Label("Component 3"));
- ts.addTab(ol, "Vertical OrderedLayout", null);
-
- HorizontalLayout hl = new HorizontalLayout();
- hl.setMargin(true);
- hl.addComponent(new Label("Component 1"));
- hl.addComponent(new Label("Component 2"));
- hl.addComponent(new Label("Component 3"));
- ts.addTab(hl, "Horizontal OrderedLayout", null);
-
- final GridLayout gl = new GridLayout(3, 3);
- gl.setMargin(true);
- gl.addComponent(new Label("Component 1.1"));
- gl.addComponent(new Label("Component 1.2"));
- gl.addComponent(new Label("Component 1.3"));
- gl.addComponent(new Label("Component 2.2"), 1, 1);
- gl.addComponent(new Label("Component 3.1"), 0, 2);
- gl.addComponent(new Label("Component 3.3"), 2, 2);
- ts.addTab(gl, "GridLayout", null);
-
- /*- TODO spitpanel removed for now - do we need it here?
- ts = new TabSheet();
- ts.setHeight(150);
- g.addComponent(ts, 0, 2, 1, 2);
-
- SplitPanel sp = new SplitPanel();
- sp.addComponent(new Label("Component 1"));
- sp.addComponent(new Label("Component 2"));
- ts.addTab(sp, "Vertical SplitPanel", null);
-
- sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
- sp.addComponent(new Label("Component 1"));
- sp.addComponent(new Label("Component 2"));
- ts.addTab(sp, "Horizontal SplitPanel", null);
- -*/
-
- }
-}
diff --git a/src/com/vaadin/demo/featurebrowser/NotificationExample.java b/src/com/vaadin/demo/featurebrowser/NotificationExample.java deleted file mode 100644 index 73b94c5577..0000000000 --- a/src/com/vaadin/demo/featurebrowser/NotificationExample.java +++ /dev/null @@ -1,96 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.featurebrowser; - -import com.vaadin.data.Item; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * Demonstrates the use of Notifications. - * - * @author IT Mill Ltd. - * @see com.vaadin.ui.Window - */ -@SuppressWarnings("serial") -public class NotificationExample extends CustomComponent { - - // Dropdown select for notification type, using the native dropdown - NativeSelect type; - // Textfield for the notification caption - TextField caption; - // Textfield for the notification content - TextField message; - - /** - * Default constructor; We're subclassing CustomComponent, so we need to - * choose a root component and set it as composition root. - */ - public NotificationExample() { - // Main layout - final VerticalLayout main = new VerticalLayout(); - main.setSizeUndefined(); - main.setSpacing(true); - main.setMargin(true); // use theme-specific margin - setCompositionRoot(main); - - // Create the 'type' dropdown select. - type = new NativeSelect("Notification type"); - main.addComponent(type); - // no empty selection allowed - type.setNullSelectionAllowed(false); - // we want a different caption than the value - type.addContainerProperty("caption", String.class, null); - type.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); - type.setItemCaptionPropertyId("caption"); - // add some content (items) using the Container API - Item i = type.addItem(new Integer( - Window.Notification.TYPE_HUMANIZED_MESSAGE)); - i.getItemProperty("caption").setValue("Humanized message"); - i = type.addItem(new Integer(Window.Notification.TYPE_WARNING_MESSAGE)); - i.getItemProperty("caption").setValue("Warning message"); - i = type.addItem(new Integer(Window.Notification.TYPE_ERROR_MESSAGE)); - i.getItemProperty("caption").setValue("Error message"); - i = type - .addItem(new Integer(Window.Notification.TYPE_TRAY_NOTIFICATION)); - i.getItemProperty("caption").setValue("Tray notification"); - // set the initially selected item - type.setValue(new Integer(Window.Notification.TYPE_HUMANIZED_MESSAGE)); - - // Notification caption - caption = new TextField("Caption"); - main.addComponent(caption); - caption.setColumns(20); - caption.setValue("Brown Fox!"); - - // Notification message - message = new RichTextArea(); - main.addComponent(message); - message.setCaption("Message"); - message.setValue("A quick one jumped over the lazy dog."); - - // Button to show the notification - final Button b = new Button("Show notification", new ClickListener() { - // this is an inline ClickListener - public void buttonClick(ClickEvent event) { - // show the notification - getWindow().showNotification((String) caption.getValue(), - (String) message.getValue(), - ((Integer) type.getValue()).intValue()); - } - }); - main.addComponent(b); - main.setComponentAlignment(b, Alignment.MIDDLE_RIGHT); - } -} diff --git a/src/com/vaadin/demo/featurebrowser/RichTextExample.java b/src/com/vaadin/demo/featurebrowser/RichTextExample.java deleted file mode 100644 index eb5b2e4279..0000000000 --- a/src/com/vaadin/demo/featurebrowser/RichTextExample.java +++ /dev/null @@ -1,64 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.RichTextArea;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * An example using a RichTextArea to edit a Label in XHTML-mode.
- *
- */
-@SuppressWarnings("serial")
-public class RichTextExample extends CustomComponent {
-
- public static final String txt = "<h1>RichText editor example</h1>"
- + "To edit this text, press the <b>Edit</b> button below."
- + "<br/>"
- + "See the <A href=\"http://www.vaadin.com/book\">Book of Vaadin</a> "
- + "for more information.";
-
- private final VerticalLayout main;
- private final Label l;
- private final RichTextArea editor = new RichTextArea();
- private final Button b;
-
- public RichTextExample() {
- // main layout
- main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- editor.setWidth("100%");
-
- // Add the label
- l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
- main.addComponent(l);
- // Edit button with inline click-listener
- b = new Button("Edit", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- // swap Label <-> RichTextArea
- if (main.getComponentIterator().next() == l) {
- editor.setValue(l.getValue());
- main.replaceComponent(l, editor);
- b.setCaption("Save");
- } else {
- l.setValue(editor.getValue());
- main.replaceComponent(editor, l);
- b.setCaption("Edit");
- }
- }
- });
- main.addComponent(b);
- main.setComponentAlignment(b, Alignment.MIDDLE_RIGHT);
- }
-
-}
diff --git a/src/com/vaadin/demo/featurebrowser/SelectExample.java b/src/com/vaadin/demo/featurebrowser/SelectExample.java deleted file mode 100644 index 38183a946b..0000000000 --- a/src/com/vaadin/demo/featurebrowser/SelectExample.java +++ /dev/null @@ -1,103 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Field;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.ListSelect;
-import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.OptionGroup;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.TwinColSelect;
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * Shows some basic fields for value input; TextField, DateField, Slider...
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class SelectExample extends CustomComponent {
-
- // listener that shows a value change notification
- private final Field.ValueChangeListener listener = new Field.ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("" + event.getProperty().getValue());
- }
- };
-
- public SelectExample() {
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- final HorizontalLayout horiz = new HorizontalLayout();
- horiz.setWidth("100%");
- main.addComponent(horiz);
- final Panel single = new Panel("Single selects");
- single.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(single);
- final Panel multi = new Panel("Multi selects");
- multi.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(multi);
-
- // radio button group
- AbstractSelect sel = new OptionGroup("OptionGroup");
- initSelect(sel);
- single.addComponent(sel);
- // checkbox group
- sel = new OptionGroup("OptionGroup");
- sel.setMultiSelect(true); // TODO: throws if set after listener - why?
- initSelect(sel);
- multi.addComponent(sel);
- // single-select list
- sel = new ListSelect("ListSelect");
- ((ListSelect) sel).setColumns(15);
- initSelect(sel);
- single.addComponent(sel);
- // multi-select list
- sel = new ListSelect("ListSelect");
- ((ListSelect) sel).setColumns(15);
- sel.setMultiSelect(true);
- initSelect(sel);
- multi.addComponent(sel);
- // native-style dropdows
- sel = new NativeSelect("NativeSelect");
- ((NativeSelect) sel).setColumns(15);
- initSelect(sel);
- single.addComponent(sel);
- // combobox
- sel = new ComboBox("ComboBox");
- ((ComboBox) sel).setWidth("15em");
- initSelect(sel);
- single.addComponent(sel);
- // "twin column" select
- sel = new TwinColSelect("TwinColSelect");
- sel.setWidth("100%");
- ((TwinColSelect) sel).setColumns(15);
- initSelect(sel);
- multi.addComponent(sel);
- }
-
- /*
- * Initialize select with some values, make immediate and add listener.
- */
- private void initSelect(AbstractSelect sel) {
- for (int i = 1; i <= 5; i++) {
- sel.addItem("Item " + i);
- }
- // select one item
- sel.select("Item 1");
-
- // make immediate, add listener
- sel.setImmediate(true);
- sel.addListener(listener);
- }
-
-}
diff --git a/src/com/vaadin/demo/featurebrowser/TableExample.java b/src/com/vaadin/demo/featurebrowser/TableExample.java deleted file mode 100644 index 808762724b..0000000000 --- a/src/com/vaadin/demo/featurebrowser/TableExample.java +++ /dev/null @@ -1,300 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import java.util.Iterator;
-import java.util.Random;
-import java.util.Set;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.event.Action;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * Table example.
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class TableExample extends CustomComponent implements Action.Handler,
- Button.ClickListener {
-
- // Actions
- private static final Action ACTION_SAVE = new Action("Save");
- private static final Action ACTION_DELETE = new Action("Delete");
- private static final Action ACTION_HIRE = new Action("Hire");
- // Action sets
- private static final Action[] ACTIONS_NOHIRE = new Action[] { ACTION_SAVE,
- ACTION_DELETE };
- private static final Action[] ACTIONS_HIRE = new Action[] { ACTION_HIRE,
- ACTION_SAVE, ACTION_DELETE };
- // Properties
- private static final Object PROPERTY_SPECIES = "Species";
- private static final Object PROPERTY_TYPE = "Type";
- private static final Object PROPERTY_KIND = "Kind";
- private static final Object PROPERTY_HIRED = "Hired";
-
- // "global" components
- Table source;
- Table saved;
- Button saveSelected;
- Button hireSelected;
- Button deleteSelected;
- Button deselect;
-
- public TableExample() {
- VerticalLayout margin = new VerticalLayout();
- margin.setMargin(true);
-
- TabSheet root = new TabSheet();
- setCompositionRoot(margin);
- margin.addComponent(root);
-
- // main layout
- final VerticalLayout main = new VerticalLayout();
- main.setCaption("Basic Table");
- main.setMargin(true);
- root.addTab(main);
-
- // "source" table with bells & whistlesenabled
- source = new Table("All creatures");
- source.setPageLength(7);
- source.setWidth("550px");
- source.setColumnCollapsingAllowed(true);
- source.setColumnReorderingAllowed(true);
- source.setSelectable(true);
- source.setMultiSelect(true);
- source.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
- fillTable(source);
- source.addActionHandler(this);
- main.addComponent(source);
-
- // x-selected button row
- final HorizontalLayout horiz = new HorizontalLayout();
-
- horiz.setMargin(false, false, true, false);
- main.addComponent(horiz);
- saveSelected = new Button("Save selected");
- saveSelected.setStyleName(Button.STYLE_LINK);
- saveSelected.addListener(this);
- horiz.addComponent(saveSelected);
- hireSelected = new Button("Hire selected");
- hireSelected.setStyleName(Button.STYLE_LINK);
- hireSelected.addListener(this);
- horiz.addComponent(hireSelected);
- deleteSelected = new Button("Delete selected");
- deleteSelected.setStyleName(Button.STYLE_LINK);
- deleteSelected.addListener(this);
- horiz.addComponent(deleteSelected);
- deselect = new Button("Deselect all");
- deselect.setStyleName(Button.STYLE_LINK);
- deselect.addListener(this);
- horiz.addComponent(deselect);
- final CheckBox editmode = new CheckBox("Editmode ");
- editmode.addListener(new CheckBox.ClickListener() {
- public void buttonClick(ClickEvent event) {
- source.setEditable(((Boolean) event.getButton().getValue())
- .booleanValue());
- }
- });
- editmode.setImmediate(true);
- horiz.addComponent(editmode);
-
- // "saved" table, minimalistic
- saved = new Table("Saved creatures");
- saved.setPageLength(5);
- saved.setWidth("550px");
- saved.setSelectable(false);
- saved.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
- saved.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
- initProperties(saved);
- saved.addActionHandler(this);
- main.addComponent(saved);
-
- final CheckBox b = new CheckBox("Modify saved creatures");
- b.addListener(new CheckBox.ClickListener() {
- public void buttonClick(ClickEvent event) {
- saved.setEditable(((Boolean) event.getButton().getValue())
- .booleanValue());
- }
- });
- b.setImmediate(true);
- main.addComponent(b);
-
- GeneratedColumnExample gencols = new GeneratedColumnExample();
- gencols.setCaption("Generated Columns");
- root.addComponent(gencols);
- }
-
- // set up the properties (columns)
- private void initProperties(Table table) {
- table.addContainerProperty(PROPERTY_SPECIES, String.class, "");
- table.addContainerProperty(PROPERTY_TYPE, String.class, "");
- table.addContainerProperty(PROPERTY_KIND, String.class, "");
- table
- .addContainerProperty(PROPERTY_HIRED, Boolean.class,
- Boolean.FALSE);
- }
-
- // fill the table with some random data
- private void fillTable(Table table) {
- initProperties(table);
-
- final String[] sp = new String[] { "Fox", "Dog", "Cat", "Moose",
- "Penguin", "Cow" };
- final String[] ty = new String[] { "Quick", "Lazy", "Sleepy",
- "Fidgety", "Crazy", "Kewl" };
- final String[] ki = new String[] { "Jumping", "Walking", "Sleeping",
- "Skipping", "Dancing" };
-
- Random r = new Random(5);
-
- for (int i = 0; i < 100; i++) {
- final String s = sp[(int) (r.nextDouble() * sp.length)];
- final String t = ty[(int) (r.nextDouble() * ty.length)];
- final String k = ki[(int) (r.nextDouble() * ki.length)];
- table.addItem(new Object[] { s, t, k, Boolean.FALSE }, new Integer(
- i));
- }
-
- }
-
- // Called for each item (row), returns valid actions for that item
- public Action[] getActions(Object target, Object sender) {
- if (sender == source) {
- final Item item = source.getItem(target);
- // save, delete, and hire if not already hired
- if (item != null
- && item.getItemProperty(PROPERTY_HIRED).getValue() == Boolean.FALSE) {
- return ACTIONS_HIRE;
- } else {
- return ACTIONS_NOHIRE;
- }
- } else {
- // "saved" table only has one action
- return new Action[] { ACTION_DELETE };
- }
- }
-
- // called when an action is invoked on an item (row)
- public void handleAction(Action action, Object sender, Object target) {
- if (sender == source) {
- Item item = source.getItem(target);
- if (action == ACTION_HIRE) {
- // set HIRED property to true
- item.getItemProperty(PROPERTY_HIRED).setValue(Boolean.TRUE);
- if (saved.containsId(target)) {
- item = saved.getItem(target);
- item.getItemProperty(PROPERTY_HIRED).setValue(Boolean.TRUE);
- }
- getWindow().showNotification("Hired", "" + item);
-
- } else if (action == ACTION_SAVE) {
- if (saved.containsId(target)) {
- // let's not save twice
- getWindow().showNotification("Already saved", "" + item);
- return;
- }
- // "manual" copy of the item properties we want
- final Item added = saved.addItem(target);
- Property p = added.getItemProperty(PROPERTY_SPECIES);
- p.setValue(item.getItemProperty(PROPERTY_SPECIES).getValue());
- p = added.getItemProperty(PROPERTY_TYPE);
- p.setValue(item.getItemProperty(PROPERTY_TYPE).getValue());
- p = added.getItemProperty(PROPERTY_KIND);
- p.setValue(item.getItemProperty(PROPERTY_KIND).getValue());
- p = added.getItemProperty(PROPERTY_HIRED);
- p.setValue(item.getItemProperty(PROPERTY_HIRED).getValue());
- getWindow().showNotification("Saved", "" + item);
- } else {
- // ACTION_DELETE
- getWindow().showNotification("Deleted ", "" + item);
- source.removeItem(target);
- }
-
- } else {
- // sender==saved
- if (action == ACTION_DELETE) {
- final Item item = saved.getItem(target);
- getWindow().showNotification("Deleted", "" + item);
- saved.removeItem(target);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public void buttonClick(ClickEvent event) {
- final Button b = event.getButton();
- if (b == deselect) {
- source.setValue(null);
- } else if (b == saveSelected) {
- // loop each selected and copy to "saved" table
- final Set selected = (Set) source.getValue();
- int s = 0;
- for (final Iterator it = selected.iterator(); it.hasNext();) {
- final Object id = it.next();
- if (!saved.containsId(id)) {
- final Item item = source.getItem(id);
- final Item added = saved.addItem(id);
- // "manual" copy of the properties we want
- Property p = added.getItemProperty(PROPERTY_SPECIES);
- p.setValue(item.getItemProperty(PROPERTY_SPECIES)
- .getValue());
- p = added.getItemProperty(PROPERTY_TYPE);
- p.setValue(item.getItemProperty(PROPERTY_TYPE).getValue());
- p = added.getItemProperty(PROPERTY_KIND);
- p.setValue(item.getItemProperty(PROPERTY_KIND).getValue());
- p = added.getItemProperty(PROPERTY_HIRED);
- p.setValue(item.getItemProperty(PROPERTY_HIRED).getValue());
- s++;
- }
- }
- getWindow().showNotification("Saved " + s);
-
- } else if (b == hireSelected) {
- // loop each selected and set property HIRED to true
- int s = 0;
- final Set selected = (Set) source.getValue();
- for (final Iterator it = selected.iterator(); it.hasNext();) {
- final Object id = it.next();
- Item item = source.getItem(id);
- final Property p = item.getItemProperty(PROPERTY_HIRED);
- if (p.getValue() == Boolean.FALSE) {
- p.setValue(Boolean.TRUE);
- s++;
- }
- if (saved.containsId(id)) {
- // also update "saved" table
- item = saved.getItem(id);
- item.getItemProperty(PROPERTY_HIRED).setValue(Boolean.TRUE);
- }
- }
- getWindow().showNotification("Hired " + s);
-
- } else {
- // loop trough selected and delete
- int s = 0;
- final Set selected = (Set) source.getValue();
- for (final Iterator it = selected.iterator(); it.hasNext();) {
- final Object id = it.next();
- if (source.containsId(id)) {
- s++;
- source.removeItem(id);
- }
- }
- getWindow().showNotification("Deleted " + s);
- }
-
- }
-
-}
diff --git a/src/com/vaadin/demo/featurebrowser/TreeExample.java b/src/com/vaadin/demo/featurebrowser/TreeExample.java deleted file mode 100644 index a440cbb25c..0000000000 --- a/src/com/vaadin/demo/featurebrowser/TreeExample.java +++ /dev/null @@ -1,163 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.featurebrowser; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.event.Action; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; - -/** - * Demonstrates basic Tree -functionality. Actions are used for add/remove item - * functionality, and a ValueChangeListener reacts to both the Tree and the - * TextField. - */ -@SuppressWarnings("serial") -public class TreeExample extends CustomComponent implements Action.Handler, - Tree.ValueChangeListener { - - private static final Action ADD = new Action("Add item"); - private static final Action DELETE = new Action("Delete item"); - private static final Action[] actions = new Action[] { ADD, DELETE }; - - // Id for the caption property - private static final Object CAPTION_PROPERTY = "caption"; - - private static final String desc = "Try both right- and left-click!"; - - Tree tree; - TextField editor; - - public TreeExample() { - final HorizontalLayout main = new HorizontalLayout(); - main.setWidth("100%"); - main.setMargin(true); - setCompositionRoot(main); - - // Panel w/ Tree - Panel p = new Panel("Select item"); - p.setStyleName(Panel.STYLE_LIGHT); - p.setWidth("250px"); - // Description - p.addComponent(new Label(desc)); - // Tree with a few items - tree = new Tree(); - tree.setImmediate(true); - // we'll use a property for caption instead of the item id ("value"), - // so that multiple items can have the same caption - tree.addContainerProperty(CAPTION_PROPERTY, String.class, ""); - tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); - tree.setItemCaptionPropertyId(CAPTION_PROPERTY); - for (int i = 1; i <= 3; i++) { - final Object id = addCaptionedItem("Section " + i, null); - tree.expandItem(id); - addCaptionedItem("Team A", id); - addCaptionedItem("Team B", id); - } - // listen for selections - tree.addListener(this); - // "context menu" - tree.addActionHandler(this); - p.addComponent(tree); - main.addComponent(p); - - // Panel w/ TextField ("editor") - p = new Panel("Edit item caption"); - p.setStyleName(Panel.STYLE_LIGHT); - editor = new TextField(); - // make immediate, instead of adding an "apply" button - editor.setImmediate(true); - editor.setEnabled(false); - editor.setColumns(15); - p.addComponent(editor); - main.addComponent(p); - main.setExpandRatio(p, 1); - } - - public Action[] getActions(Object target, Object sender) { - // We can provide different actions for each target (item), but we'll - // use the same actions all the time. - return actions; - } - - public void handleAction(Action action, Object sender, Object target) { - if (action == DELETE) { - tree.removeItem(target); - } else { - // Add - final Object id = addCaptionedItem("New Item", target); - tree.expandItem(target); - tree.setValue(id); - editor.focus(); - } - } - - public void valueChange(ValueChangeEvent event) { - final Object id = tree.getValue(); // selected item id - if (event.getProperty() == tree) { - // a Tree item was (un) selected - if (id == null) { - // no selecteion, disable TextField - editor.removeListener(this); - editor.setValue(""); - editor.setEnabled(false); - } else { - // item selected - // first remove previous listener - editor.removeListener(this); - // enable TextField and update value - editor.setEnabled(true); - final Item item = tree.getItem(id); - editor.setValue(item.getItemProperty(CAPTION_PROPERTY) - .getValue()); - // listen for TextField changes - editor.addListener(this); - editor.focus(); - } - } else { - // TextField - if (id != null) { - final Item item = tree.getItem(id); - final Property p = item.getItemProperty(CAPTION_PROPERTY); - p.setValue(editor.getValue()); - tree.requestRepaint(); - } - - } - } - - /** - * Helper to add an item with specified caption and (optional) parent. - * - * @param caption - * The item caption - * @param parent - * The (optional) parent item id - * @return the created item's id - */ - private Object addCaptionedItem(String caption, Object parent) { - // add item, let tree decide id - final Object id = tree.addItem(); - // get the created item - final Item item = tree.getItem(id); - // set our "caption" property - final Property p = item.getItemProperty(CAPTION_PROPERTY); - p.setValue(caption); - if (parent != null) { - tree.setChildrenAllowed(parent, true); - tree.setParent(id, parent); - tree.setChildrenAllowed(id, false); - } - return id; - } - -} diff --git a/src/com/vaadin/demo/featurebrowser/ValueInputExample.java b/src/com/vaadin/demo/featurebrowser/ValueInputExample.java deleted file mode 100644 index 81afe67eaf..0000000000 --- a/src/com/vaadin/demo/featurebrowser/ValueInputExample.java +++ /dev/null @@ -1,147 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.Field;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.InlineDateField;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Slider;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
-
-/**
- * Shows some basic fields for value input; TextField, DateField, Slider...
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class ValueInputExample extends CustomComponent {
-
- public ValueInputExample() {
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- // listener that shows a value change notification
- final Field.ValueChangeListener listener = new Field.ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Received",
- "<pre>" + event.getProperty().getValue() + "</pre>",
- Notification.TYPE_WARNING_MESSAGE);
- }
- };
-
- // TextField
- HorizontalLayout horiz = new HorizontalLayout();
- horiz.setWidth("100%");
- main.addComponent(horiz);
- Panel left = new Panel("TextField");
- left.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(left);
- Panel right = new Panel("multiline");
- right.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(right);
- // basic TextField
- TextField tf = new TextField("Basic");
- tf.setColumns(15);
- tf.setImmediate(true);
- tf.addListener(listener);
- left.addComponent(tf);
- // multiline TextField a.k.a TextArea
- tf = new TextField("Area");
- tf.setColumns(15);
- tf.setRows(5);
- tf.setImmediate(true);
- tf.addListener(listener);
- right.addComponent(tf);
-
- // DateFields
- horiz = new HorizontalLayout();
- horiz.setWidth("100%");
- main.addComponent(horiz);
- left = new Panel("DateField");
- left.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(left);
- right = new Panel("inline");
- right.setStyleName(Panel.STYLE_LIGHT);
- horiz.addComponent(right);
- // default
- DateField df = new DateField("Day resolution");
- df.addListener(listener);
- df.setImmediate(true);
- df.setResolution(DateField.RESOLUTION_DAY);
- left.addComponent(df);
- // minute
- df = new DateField("Minute resolution");
- df.addListener(listener);
- df.setImmediate(true);
- df.setResolution(DateField.RESOLUTION_MIN);
- left.addComponent(df);
- // year
- df = new DateField("Year resolution");
- df.addListener(listener);
- df.setImmediate(true);
- df.setResolution(DateField.RESOLUTION_YEAR);
- left.addComponent(df);
- // msec
- df = new DateField("Millisecond resolution");
- df.addListener(listener);
- df.setImmediate(true);
- df.setResolution(DateField.RESOLUTION_MSEC);
- left.addComponent(df);
- // Inline
- df = new InlineDateField();
- df.addListener(listener);
- df.setImmediate(true);
- right.addComponent(df);
-
- // Slider
- left = new Panel("Slider");
- left.setStyleName(Panel.STYLE_LIGHT);
- main.addComponent(left);
- // int slider
- Slider slider = new Slider(0, 100);
- slider.setWidth("300px");
- // slider.setSize(300);
- slider.setImmediate(true);
- slider.addListener(new Slider.ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- // update caption when value changes
- final Slider s = (Slider) event.getProperty();
- s.setCaption("Value: " + s.getValue());
- }
- });
- try {
- slider.setValue(20);
- } catch (final Exception e) {
- e.printStackTrace(System.err);
- }
- left.addComponent(slider);
- // double slider
- slider = new Slider(0.0, 1.0, 1);
- slider.setOrientation(Slider.ORIENTATION_VERTICAL);
- slider.setImmediate(true);
- slider.addListener(new Slider.ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- // update caption when value changes
- final Slider s = (Slider) event.getProperty();
- s.setCaption("Value: " + s.getValue());
- }
- });
- try {
- slider.setValue(0.5);
- } catch (final Exception e) {
- e.printStackTrace(System.err);
- }
- left.addComponent(slider);
-
- }
-
-}
diff --git a/src/com/vaadin/demo/featurebrowser/WindowingExample.java b/src/com/vaadin/demo/featurebrowser/WindowingExample.java deleted file mode 100644 index db91da6b84..0000000000 --- a/src/com/vaadin/demo/featurebrowser/WindowingExample.java +++ /dev/null @@ -1,113 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.featurebrowser;
-
-import java.net.URL;
-
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * @author marc
- *
- */
-@SuppressWarnings("serial")
-public class WindowingExample extends CustomComponent {
-
- public static final String txt = "<p>There are two main types of windows: application-level windows, and "
- + "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window"
- + " within the (native) browser window to which it was added. You can create"
- + " a sub window by creating a new Window and adding it to a application-level window, for instance"
- + " your main window. </p><p> In contrast, you create a application-level window by"
- + " creating a new Window and adding it to the Application. Application-level"
- + " windows are not shown by default - you need to open a browser window for"
- + " the url representing the window. You can think of the application-level"
- + " windows as separate views into your application - and a way to create a"
- + " \"native\" browser window.</p><p>Depending on your needs, it's also"
- + " possible to create a new window instance (with it's own internal state)"
- + " for each new (native) browser window, or you can share the same instance"
- + " (and state) between several browser windows (the latter is most useful"
- + " for read-only views).</p>";
-
- private URL windowUrl = null;
-
- public WindowingExample() {
- final VerticalLayout main = new VerticalLayout();
- main.setMargin(true);
- setCompositionRoot(main);
-
- final Label l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
- main.addComponent(l);
-
- Button b = new Button("Create a new subwindow",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final Window w = new Window("Subwindow");
- w.setWidth("50%");
- final Label l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
- w.addComponent(l);
- getApplication().getMainWindow().addWindow(w);
- }
- });
- b.setStyleName(Button.STYLE_LINK);
- main.addComponent(b);
- b = new Button("Create a new modal window", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final Window w = new Window("Modal window");
- w.setWidth("50%");
- w.setModal(true);
- final Label l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
- w.addComponent(l);
- getApplication().getMainWindow().addWindow(w);
- }
- });
- b.setStyleName(Button.STYLE_LINK);
- main.addComponent(b);
- b = new Button("Open a application-level window, with shared state",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (windowUrl == null) {
- final Window w = new Window("Subwindow");
- final Label l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
- w.addComponent(l);
- getApplication().addWindow(w);
- windowUrl = w.getURL();
- }
- getApplication().getMainWindow().open(
- new ExternalResource(windowUrl), "_new");
- }
- });
- b.setStyleName(Button.STYLE_LINK);
- main.addComponent(b);
- b = new Button(
- "Create a new application-level window, with it's own state",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- final Window w = new Window("Subwindow");
- getApplication().addWindow(w);
- final Label l = new Label(
- "Each opened window has its own"
- + " name, and is accessed trough its own uri.");
- l.setCaption("Window " + w.getName());
- w.addComponent(l);
- getApplication().getMainWindow().open(
- new ExternalResource(w.getURL()), "_new");
- }
- });
- b.setStyleName(Button.STYLE_LINK);
- main.addComponent(b);
-
- }
-
-}
diff --git a/src/com/vaadin/demo/package.html b/src/com/vaadin/demo/package.html deleted file mode 100644 index 38ccd7654a..0000000000 --- a/src/com/vaadin/demo/package.html +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> -<html> -<head> -</head> - -<body bgcolor="white"> - -<p>Provides several fully functional Vaadin example applications. These -highlight certain aspects of the Vaadin and how it can be -used to produce simple, elegant yet powerful user interface driven -applications.</p> - -<ul> -<li><strong>HelloWorld</strong> is the classic example which only prints the -text "Hello, World!" on the screen.</li> -<li><strong>Calc</strong> implements a calculator application which -demonstrates how to build a bit more complicated user interface and how the -application can interact with the user through that interface.</li> -</ul> - -</body> -</html> diff --git a/src/com/vaadin/demo/reservation/CalendarDemo.java b/src/com/vaadin/demo/reservation/CalendarDemo.java deleted file mode 100644 index 4fc7dab44a..0000000000 --- a/src/com/vaadin/demo/reservation/CalendarDemo.java +++ /dev/null @@ -1,121 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.reservation; - -import java.sql.SQLException; -import java.util.Calendar; -import java.util.Date; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.util.QueryContainer; -import com.vaadin.demo.util.SampleCalendarDatabase; -import com.vaadin.ui.DateField; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Window; - -/** - * This example shows how the CalendarField can use Containers. A QueryContainer - * is used to bind SQL table rows to the calendar. Demonstrates: how to create - * <code>com.vaadin.data.Container</code> and set it as datasource for - * <code>com.vaadin.ui.Component.CalendarField</code> - * - * @author IT Mill Ltd. - * @since 4.0.0 - * - */ -@SuppressWarnings("serial") -public class CalendarDemo extends com.vaadin.Application { - - // Database provided with sample data - private SampleCalendarDatabase sampleDatabase; - - // The calendar UI component - private CalendarField from; - private CalendarField to; - - /** - * Initialize Application. Demo components are added to main window. - */ - @Override - public void init() { - final Window main = new Window("Calendar demo"); - setMainWindow(main); - - main.setContent(new HorizontalLayout()); - - // create the calendar component and add to layout - from = new CalendarField(); - main.addComponent(from); - from.setResolution(DateField.RESOLUTION_HOUR); - from.setImmediate(true); - - to = new CalendarField(); - main.addComponent(to); - to.setResolution(DateField.RESOLUTION_HOUR); - to.setEnabled(false); - to.setImmediate(true); - - from.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - final Date fd = (Date) from.getValue(); - final Date td = (Date) to.getValue(); - if (fd == null) { - to.setValue(null); - to.setEnabled(false); - return; - } else { - to.setEnabled(true); - } - to.setMinimumDate(fd); - if (td == null || td.before(fd)) { - to.setValue(fd); - } - } - }); - - // initialize the sample database and set as calendar datasource - sampleDatabase = new SampleCalendarDatabase(); - - initCalendars(); - - // Don't allow dates before today - from.setMinimumDate(Calendar.getInstance().getTime()); - - } - - /** - * Populates table component with all rows from calendar table. - */ - private void initCalendars() { - try { - final QueryContainer qc = new QueryContainer("SELECT * FROM " - + SampleCalendarDatabase.DB_TABLE_NAME, sampleDatabase - .getConnection()); - from.setContainerDataSource(qc); - to.setContainerDataSource(qc); - } catch (final SQLException e) { - e.printStackTrace(); - } - /* - * // Calendar will use the first date property as start if you do not - * // explicitly specify the property id. Our start -property will be - * the // first one, so it's intentionally left out. // Start is the - * only mandatory property, but you'll probably want to // specify title - * as well. - * from.setItemEndPropertyId(SampleCalendarDatabase.PROPERTY_ID_END); - * from - * .setItemTitlePropertyId(SampleCalendarDatabase.PROPERTY_ID_TITLE); - * from - * .setItemNotimePropertyId(SampleCalendarDatabase.PROPERTY_ID_NOTIME); - * - * to.setItemEndPropertyId(SampleCalendarDatabase.PROPERTY_ID_END); - * to.setItemTitlePropertyId(SampleCalendarDatabase.PROPERTY_ID_TITLE); - * to - * .setItemNotimePropertyId(SampleCalendarDatabase.PROPERTY_ID_NOTIME); - */ - } - -} diff --git a/src/com/vaadin/demo/reservation/CalendarField.java b/src/com/vaadin/demo/reservation/CalendarField.java deleted file mode 100644 index 9676cd79ee..0000000000 --- a/src/com/vaadin/demo/reservation/CalendarField.java +++ /dev/null @@ -1,327 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation;
-
-import java.text.SimpleDateFormat;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.demo.reservation.gwt.client.ui.VCalendarField;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.ui.ClientWidget;
-import com.vaadin.ui.DateField;
-
-// TODO send one month at a time, do lazyLoading
-// TODO check date limit when updating variables
-// TODO Allow item selection
-@SuppressWarnings("serial")
-@ClientWidget(VCalendarField.class)
-public class CalendarField extends DateField implements Container.Viewer {
-
- private static final String TAGNAME = "calendarfield";
-
- private Date minDate;
- private Date maxDate;
-
- private Container dataSource;
- private Object itemStyleNamePropertyId;
- private Object itemStartPropertyId;
- private Object itemEndPropertyId;
- private Object itemTitlePropertyId;
- private Object itemDescriptionPropertyId;
- private Object itemNotimePropertyId;
-
- public CalendarField() {
- super();
- init();
- }
-
- public CalendarField(Property dataSource) throws IllegalArgumentException {
- super(dataSource);
- init();
- }
-
- public CalendarField(String caption, Date value) {
- super(caption, value);
- init();
- }
-
- public CalendarField(String caption, Property dataSource) {
- super(caption, dataSource);
- init();
- }
-
- public CalendarField(String caption) {
- super(caption);
- init();
- }
-
- public void init() {
- super.setResolution(RESOLUTION_HOUR);
-
- }
-
- /**
- * Sets the resolution of the CalendarField. Only RESOLUTION_DAY and
- * RESOLUTION_HOUR are supported.
- *
- * @param resolution
- * the resolution to set.
- * @see com.vaadin.ui.DateField#setResolution(int)
- */
- @Override
- public void setResolution(int resolution) {
- if (resolution != RESOLUTION_DAY && resolution != RESOLUTION_HOUR) {
- throw new IllegalArgumentException();
- }
- super.setResolution(resolution);
- }
-
- public void setMinimumDate(Date date) {
- minDate = date;
- requestRepaint();
- }
-
- public Date getMinimumDate() {
- return minDate;
- }
-
- public void setMaximumDate(Date date) {
- maxDate = date;
- requestRepaint();
- }
-
- public Date getMaximumDate() {
- return maxDate;
- }
-
- public Container getContainerDataSource() {
- return dataSource;
- }
-
- public void setContainerDataSource(Container newDataSource) {
- if (newDataSource == null || checkDataSource(newDataSource)) {
- dataSource = newDataSource;
- } else {
- // TODO error message
- throw new IllegalArgumentException();
- }
- requestRepaint();
- }
-
- private boolean checkDataSource(Container dataSource) {
-
- // Check old propertyIds
- if (itemEndPropertyId != null) {
- final Class<?> c = dataSource.getType(itemEndPropertyId);
- if (!Date.class.isAssignableFrom(c)) {
- itemEndPropertyId = null;
- }
- }
- if (itemNotimePropertyId != null) {
- final Class<?> c = dataSource.getType(itemNotimePropertyId);
- if (!Boolean.class.isAssignableFrom(c)) {
- itemNotimePropertyId = null;
- }
- }
- if (itemStartPropertyId != null) {
- final Class<?> c = dataSource.getType(itemStartPropertyId);
- if (Date.class.isAssignableFrom(c)) {
- // All we _really_ need is one date
- return true;
- } else {
- itemStartPropertyId = null;
- }
- }
- // We need at least one Date
- final Collection<?> ids = dataSource.getContainerPropertyIds();
- for (final Iterator<?> it = ids.iterator(); it.hasNext();) {
- final Object id = it.next();
- final Class<?> c = dataSource.getType(id);
- if (Date.class.isAssignableFrom(c)) {
- itemStartPropertyId = id;
- return true;
- }
- }
-
- return false;
- }
-
- public Object getItemStyleNamePropertyId() {
- return itemStyleNamePropertyId;
- }
-
- public void setItemStyleNamePropertyId(Object propertyId) {
- itemStyleNamePropertyId = propertyId;
- }
-
- public Object getItemStartPropertyId() {
- return itemStartPropertyId;
- }
-
- public void setItemStartPropertyId(Object propertyId) {
- // TODO nullcheck for property id
- if (dataSource != null
- && !Date.class.isAssignableFrom(dataSource.getType(propertyId))) {
- // TODO error message
- throw new IllegalArgumentException();
- }
- itemStartPropertyId = propertyId;
- }
-
- public Object getItemEndPropertyId() {
- return itemEndPropertyId;
- }
-
- public void setItemEndPropertyId(Object propertyId) {
- // TODO nullcheck for property id
- if (dataSource != null
- && !Date.class.isAssignableFrom(dataSource.getType(propertyId))) {
- // TODO error message
- throw new IllegalArgumentException();
- }
- itemEndPropertyId = propertyId;
- }
-
- public Object getItemTitlePropertyId() {
- return itemTitlePropertyId;
- }
-
- public void setItemTitlePropertyId(Object propertyId) {
- itemTitlePropertyId = propertyId;
- }
-
- public Object getItemDescriptionPropertyId() {
- return itemDescriptionPropertyId;
- }
-
- public void setItemDescriptionPropertyId(Object propertyId) {
- itemDescriptionPropertyId = propertyId;
- }
-
- public Object getitemNotimePropertyId() {
- return itemNotimePropertyId;
- }
-
- public void setItemNotimePropertyId(Object propertyId) {
- // TODO nullcheck for property id
- if (dataSource != null
- && !Boolean.class.isAssignableFrom(dataSource
- .getType(propertyId))) {
- // TODO error message
- throw new IllegalArgumentException();
- }
- itemNotimePropertyId = propertyId;
- }
-
- /**
- * Paints the content of this component.
- *
- * @param target
- * the Paint Event.
- * @throws PaintException
- * if the paint operation failed.
- */
- @SuppressWarnings("deprecation")
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- super.paintContent(target);
-
- if (minDate != null) {
- target.addAttribute("min", String.valueOf(minDate.getTime()));
- }
- if (maxDate != null) {
- target.addAttribute("max", String.valueOf(maxDate.getTime()));
- }
-
- if (dataSource != null) {
- target.startTag("items");
-
- // TODO send one month now, the rest via lazyloading
- int month = new Date().getMonth();
- final Object value = getValue();
- if (value != null && value instanceof Date) {
- month = ((Date) value).getMonth();
- }
-
- for (final Iterator<?> it = dataSource.getItemIds().iterator(); it
- .hasNext();) {
- final Object itemId = it.next();
- final Item item = dataSource.getItem(itemId);
- Property p = item.getItemProperty(itemStartPropertyId);
- Date start = (Date) p.getValue();
- Date end = start; // assume same day
- if (itemEndPropertyId != null) {
- p = item.getItemProperty(itemEndPropertyId);
- end = (Date) p.getValue();
- if (end == null) {
- end = start;
- } else if (end.before(start)) {
- final Date tmp = start;
- start = end;
- end = tmp;
- }
- }
-
- // TODO half-done lazyloading logic (hence broken)
-
- if (start != null) {
- if ((start.getMonth() <= month || end.getMonth() >= month)) {
- target.startTag("item");
- // TODO different id?
- target.addAttribute("id", itemId.hashCode());
- if (itemStyleNamePropertyId != null) {
- p = item.getItemProperty(itemStyleNamePropertyId);
- final String styleName = (String) p.getValue();
- target.addAttribute("styleName", styleName);
- }
- SimpleDateFormat sdf = new SimpleDateFormat(
- "d MM yyyy HH:mm:ss Z");
-
- target.addAttribute("Z", start.getTimezoneOffset());
-
- target.addAttribute("start", "" + sdf.format(start));
-
- if (end != start) {
- target.addAttribute("end", "" + sdf.format(end));
- }
- if (itemTitlePropertyId != null) {
- p = item.getItemProperty(itemTitlePropertyId);
- final Object val = p.getValue();
- if (val != null) {
- target.addAttribute("title", val.toString());
- }
- }
- if (itemDescriptionPropertyId != null) {
- p = item.getItemProperty(itemDescriptionPropertyId);
- final Object val = p.getValue();
- if (val != null) {
- target.addAttribute("description", val
- .toString());
- }
- }
- if (itemNotimePropertyId != null) {
- p = item.getItemProperty(itemNotimePropertyId);
- final Object val = p.getValue();
- if (val != null) {
- target.addAttribute("notime", ((Boolean) val)
- .booleanValue());
- }
- }
-
- target.endTag("item");
- }
- }
- }
-
- target.endTag("items");
- }
- }
-}
diff --git a/src/com/vaadin/demo/reservation/GoogleMap.java b/src/com/vaadin/demo/reservation/GoogleMap.java deleted file mode 100644 index 746982db9b..0000000000 --- a/src/com/vaadin/demo/reservation/GoogleMap.java +++ /dev/null @@ -1,194 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation;
-
-import java.awt.geom.Point2D;
-import java.util.Collection;
-import java.util.Iterator;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.demo.reservation.gwt.client.ui.VGoogleMap;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Sizeable;
-import com.vaadin.ui.AbstractComponent;
-import com.vaadin.ui.ClientWidget;
-
-@SuppressWarnings("serial")
-@ClientWidget(VGoogleMap.class)
-public class GoogleMap extends AbstractComponent implements Sizeable,
- Container.Viewer {
- private final String TAG_MARKERS = "markers";
- private final String TAG_MARKER = "marker";
- private int zoomLevel = 15;
- private Point2D.Double mapCenter;
-
- private Container dataSource;
- private Object itemMarkerHtmlPropertyId = new Object();
- private Object itemMarkerXPropertyId = new Object();
- private Object itemMarkerYPropertyId = new Object();
-
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- super.paintContent(target);
- // Add size info as variables
- if (getHeight() > -1) {
- target.addVariable(this, "height", getHeight()
- + UNIT_SYMBOLS[getHeightUnits()]);
- }
- if (getWidth() > -1) {
- target.addVariable(this, "width", getWidth()
- + UNIT_SYMBOLS[getWidthUnits()]);
- }
- if (null != mapCenter) {
- target.addAttribute("centerX", mapCenter.getX());
- target.addAttribute("centerY", mapCenter.getY());
- }
- target.addAttribute("zoom", zoomLevel);
-
- if (dataSource != null) {
- target.startTag(TAG_MARKERS);
- final Collection<?> itemIds = dataSource.getItemIds();
- for (final Iterator<?> it = itemIds.iterator(); it.hasNext();) {
- final Object itemId = it.next();
- final Item item = dataSource.getItem(itemId);
- Property p = item.getItemProperty(getItemMarkerXPropertyId());
- final Double x = (Double) (p != null ? p.getValue() : null);
- p = item.getItemProperty(getItemMarkerYPropertyId());
- final Double y = (Double) (p != null ? p.getValue() : null);
- if (x == null || y == null) {
- continue;
- }
- target.startTag(TAG_MARKER);
- target.addAttribute("x", x.doubleValue());
- target.addAttribute("y", y.doubleValue());
- p = item.getItemProperty(getItemMarkerHtmlPropertyId());
- final String h = (String) (p != null ? p.getValue() : null);
- target.addAttribute("html", h);
- target.endTag(TAG_MARKER);
- }
- target.endTag(TAG_MARKERS);
- }
- }
-
- public void setZoomLevel(int zoomLevel) {
- this.zoomLevel = zoomLevel;
- requestRepaint();
- }
-
- public int getZoomLevel() {
- return zoomLevel;
- }
-
- public void setMapCenter(Point2D.Double center) {
- mapCenter = center;
- }
-
- public Point2D.Double getMapCenter() {
- return mapCenter;
- }
-
- // Container.Viewer methods:
-
- public Container getContainerDataSource() {
- return dataSource;
- }
-
- public void setContainerDataSource(Container newDataSource) {
-
- dataSource = newDataSource;
-
- requestRepaint();
- }
-
- // Item methods
-
- public Object getItemMarkerHtmlPropertyId() {
- return itemMarkerHtmlPropertyId;
- }
-
- public void setItemMarkerHtmlPropertyId(Object itemMarkerHtmlPropertyId) {
- this.itemMarkerHtmlPropertyId = itemMarkerHtmlPropertyId;
- requestRepaint();
- }
-
- public Object getItemMarkerXPropertyId() {
- return itemMarkerXPropertyId;
- }
-
- public void setItemMarkerXPropertyId(Object itemMarkerXPropertyId) {
- this.itemMarkerXPropertyId = itemMarkerXPropertyId;
- requestRepaint();
- }
-
- public Object getItemMarkerYPropertyId() {
- return itemMarkerYPropertyId;
- }
-
- public void setItemMarkerYPropertyId(Object itemMarkerYPropertyId) {
- this.itemMarkerYPropertyId = itemMarkerYPropertyId;
- requestRepaint();
- }
-
- // Marker add
-
- public Object addMarker(String html, Point2D.Double location) {
- if (location == null) {
- throw new IllegalArgumentException("Location must be non-null");
- }
- if (dataSource == null) {
- initDataSource();
- }
- final Object markerId = dataSource.addItem();
- if (markerId == null) {
- return null;
- }
- final Item marker = dataSource.getItem(markerId);
- Property p = marker.getItemProperty(getItemMarkerXPropertyId());
- p.setValue(new Double(location.x));
- p = marker.getItemProperty(getItemMarkerYPropertyId());
- p.setValue(new Double(location.y));
- p = marker.getItemProperty(getItemMarkerHtmlPropertyId());
- p.setValue(html);
-
- requestRepaint();
-
- return markerId;
- }
-
- public void removeMarker(Object markerId) {
- if (dataSource != null) {
- dataSource.removeItem(markerId);
- requestRepaint();
- }
- }
-
- public Item getMarkerItem(Object markerId) {
- if (dataSource != null) {
- return dataSource.getItem(markerId);
- } else {
- return null;
- }
- }
-
- // dataSource init helper:
- private void initDataSource() {
- dataSource = new IndexedContainer();
- dataSource.addContainerProperty(itemMarkerHtmlPropertyId, String.class,
- null);
- dataSource.addContainerProperty(itemMarkerXPropertyId, Double.class,
- new Double(0));
- dataSource.addContainerProperty(itemMarkerYPropertyId, Double.class,
- new Double(0));
- }
-
- public void clear() {
- setContainerDataSource(null);
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/reservation/ReservationApplication.java b/src/com/vaadin/demo/reservation/ReservationApplication.java deleted file mode 100644 index 1b9777dcb2..0000000000 --- a/src/com/vaadin/demo/reservation/ReservationApplication.java +++ /dev/null @@ -1,342 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation;
-
-import java.awt.geom.Point2D;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import com.vaadin.Application;
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-import com.vaadin.ui.Window.Notification;
-
-@SuppressWarnings("serial")
-public class ReservationApplication extends Application {
-
- private SampleDB db;
-
- ResourceSelectorPanel resourcePanel;
-
- private CalendarField reservedFrom;
-
- private static final long DEFAULT_GAP_MILLIS = 3600000; // (almost) one
-
- // hour
- private long currentGapMillis = DEFAULT_GAP_MILLIS; // current length of
-
- // reservation
- private CalendarField reservedTo;
-
- private Label resourceName;
-
- private TextField description;
-
- private Button reservationButton;
-
- private Table allTable;
-
- private GoogleMap map;
-
- @Override
- public void init() {
- //
- db = new SampleDB(getProperty("jdbcUrl"));
-
- VerticalLayout mainLayout = new VerticalLayout();
- mainLayout.setSizeFull();
- mainLayout.setMargin(true);
-
- final Window mainWindow = new Window("Reservr ", mainLayout);
- setMainWindow(mainWindow);
- setTheme("reservr");
-
- Label logo = new Label("Reservr");
- logo.setStyleName("logo");
- mainLayout.addComponent(logo);
-
- Label slogan = new Label("Representational vehicles on-the-road");
- slogan.setStyleName("slogan");
- mainLayout.addComponent(slogan);
-
- final TabSheet mainTabs = new TabSheet();
- mainTabs.setSizeFull();
- mainLayout.addComponent(mainTabs);
- mainLayout.setExpandRatio(mainTabs, 1);
-
- final VerticalLayout reservationTab = new VerticalLayout();
- reservationTab.setWidth("100%");
- mainTabs.addTab(reservationTab, "Make reservation", null);
-
- resourcePanel = new ResourceSelectorPanel("Resources");
- resourcePanel.setResourceContainer(db.getResources(null));
- resourcePanel.addListener(
- ResourceSelectorPanel.SelectedResourcesChangedEvent.class,
- this, "selectedResourcesChanged");
- reservationTab.addComponent(resourcePanel);
-
- HorizontalLayout reservationLayout = new HorizontalLayout();
- final Panel reservationPanel = new Panel("Reservation",
- reservationLayout);
- reservationPanel.addStyleName(Panel.STYLE_LIGHT);
- reservationLayout.setMargin(true);
- reservationTab.addComponent(reservationPanel);
-
- final VerticalLayout infoLayout = new VerticalLayout();
- infoLayout.setSpacing(true);
- infoLayout.setSizeUndefined();
- infoLayout.setMargin(false, true, false, false);
- reservationPanel.addComponent(infoLayout);
- resourceName = new Label("From the list above");
- resourceName.setCaption("Choose resource");
- infoLayout.addComponent(resourceName);
- description = new TextField();
- description.setWidth("250px");
- description.setRows(5);
- infoLayout.addComponent(description);
- reservationButton = new Button("Make reservation", this,
- "makeReservation");
- infoLayout.addComponent(reservationButton);
- infoLayout.setComponentAlignment(reservationButton,
- Alignment.MIDDLE_CENTER);
-
- map = new GoogleMap();
- map.setWidth("250px");
- map.setHeight("250px");
- map.setItemMarkerHtmlPropertyId(SampleDB.Resource.PROPERTY_ID_NAME);
- map.setItemMarkerXPropertyId(SampleDB.Resource.PROPERTY_ID_LOCATIONX);
- map.setItemMarkerYPropertyId(SampleDB.Resource.PROPERTY_ID_LOCATIONY);
- map.setContainerDataSource(db.getResources(null));
- infoLayout.addComponent(map);
-
- final Calendar from = Calendar.getInstance();
- from.add(Calendar.HOUR, 1);
- from.set(Calendar.MINUTE, 0);
- from.set(Calendar.SECOND, 0);
- from.set(Calendar.MILLISECOND, 0);
- reservedFrom = new CalendarField("From");
- reservedFrom.setMinimumDate(from.getTime());
- reservedFrom.setValue(from.getTime());
- reservedFrom.setImmediate(true);
- initCalendarFieldPropertyIds(reservedFrom);
- reservationPanel.addComponent(reservedFrom);
-
- final Label arrowLabel = new Label("»");
- arrowLabel.setContentMode(Label.CONTENT_XHTML);
- arrowLabel.setStyleName("arrow");
- reservationPanel.addComponent(arrowLabel);
-
- final Calendar to = Calendar.getInstance();
- to.setTime(from.getTime());
- to.add(Calendar.MILLISECOND, (int) DEFAULT_GAP_MILLIS);
- reservedTo = new CalendarField("To");
- reservedTo.setMinimumDate(to.getTime());
- reservedTo.setValue(to.getTime());
- reservedTo.setImmediate(true);
- initCalendarFieldPropertyIds(reservedTo);
- reservationPanel.addComponent(reservedTo);
-
- reservedFrom.addListener(new ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- final Date fd = (Date) reservedFrom.getValue();
- if (fd == null) {
- reservedTo.setValue(null);
- reservedTo.setEnabled(false);
- refreshSelectedResources(true);
- return;
- } else {
- reservedTo.setEnabled(true);
- }
- reservedTo.setMinimumDate(new Date(fd.getTime()
- + DEFAULT_GAP_MILLIS));
- final Calendar to = Calendar.getInstance();
- to.setTime(fd);
- to.add(Calendar.MILLISECOND, (int) currentGapMillis);
- reservedTo.setValue(to.getTime());
- refreshSelectedResources(true);
- }
- });
- reservedTo.addListener(new ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- final Date from = (Date) reservedFrom.getValue();
- final Date to = (Date) reservedTo.getValue();
- currentGapMillis = to.getTime() - from.getTime();
- if (currentGapMillis <= 0) {
- final Calendar t = Calendar.getInstance();
- t.setTime(from);
- t.add(Calendar.MILLISECOND, (int) DEFAULT_GAP_MILLIS);
- reservedTo.setValue(t.getTime());
- }
- refreshSelectedResources(true);
- }
- });
-
- allTable = new Table();
- allTable.setSizeFull();
- allTable.setColumnCollapsingAllowed(true);
- allTable.setColumnReorderingAllowed(true);
- mainTabs.addTab(allTable, "All reservations", null);
- mainTabs.addListener(new TabSheet.SelectedTabChangeListener() {
- public void selectedTabChange(SelectedTabChangeEvent event) {
- refreshReservations();
- }
- });
-
- resourcePanel.selectFirstCategory();
- refreshReservations();
- refreshSelectedResources(true);
- }
-
- public void makeReservation() {
- try {
- final Item resource = getActiveResource();
- if (resource != null) {
- db.addReservation(resource, 0, (Date) reservedFrom.getValue(),
- (Date) reservedTo.getValue(), (String) description
- .getValue());
- getMainWindow()
- .showNotification(
- "Success!",
- "You have reserved the resource for the selected period.",
- Notification.TYPE_WARNING_MESSAGE);
- refreshReservations();
- refreshSelectedResources(false);
- } else {
- getMainWindow().showNotification("Oops!",
- "Please select a resource (or category) to reserve.",
- Notification.TYPE_WARNING_MESSAGE);
- }
- } catch (final ResourceNotAvailableException e) {
- getMainWindow()
- .showNotification(
- "Not available!",
- "The selected resource is already reserved for the selected period.",
- Notification.TYPE_ERROR_MESSAGE);
- refreshReservations();
- }
- }
-
- private Item getActiveResource() throws ResourceNotAvailableException {
- final LinkedList<Item> rids = resourcePanel.getSelectedResources();
- if (rids != null && rids.size() > 0) {
- for (final Iterator<Item> it = rids.iterator(); it.hasNext();) {
- final Item resource = it.next();
- final int id = ((Integer) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_ID).getValue())
- .intValue();
- if (db.isAvailableResource(id, (Date) reservedFrom.getValue(),
- (Date) reservedTo.getValue())) {
- return resource;
- }
- }
- throw new ResourceNotAvailableException("No available resources");
- } else {
- return null;
- }
- }
-
- private void refreshReservations() {
- final Container reservations = db.getReservations(resourcePanel
- .getSelectedResources());
- reservedFrom.setContainerDataSource(reservations);
- reservedTo.setContainerDataSource(reservations);
- final Container allReservations = db.getReservations(null);
- allTable.setContainerDataSource(allReservations);
- if (allReservations != null && allReservations.size() > 0) {
- allTable.setVisibleColumns(new Object[] {
- SampleDB.Reservation.PROPERTY_ID_RESERVED_FROM,
- SampleDB.Reservation.PROPERTY_ID_RESERVED_TO,
- SampleDB.Resource.PROPERTY_ID_NAME,
- SampleDB.Resource.PROPERTY_ID_DESCRIPTION,
- SampleDB.Reservation.PROPERTY_ID_DESCRIPTION });
- allTable.setColumnHeaders(new String[] { "From", "To", "Resource",
- "Description", "Message" });
- }
- }
-
- private void refreshSelectedResources(boolean alertIfNotAvailable) {
- Item resource = null;
- try {
- resource = getActiveResource();
- } catch (final ResourceNotAvailableException e) {
- if (alertIfNotAvailable) {
- getMainWindow().showNotification("Not available",
- "Please choose another resource or time period.",
- Notification.TYPE_HUMANIZED_MESSAGE);
- }
- refreshReservations();
- return;
- }
- map.clear();
- if (resource == null) {
- resourceName.setCaption("Choose resource above");
- resourceName.setValue("");
- map.setContainerDataSource(db.getResources(null));
- map.setZoomLevel(1);
-
- } else {
- // Display active resource name + desc
- String name = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_NAME).getValue();
- String desc = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_DESCRIPTION).getValue();
- resourceName.setCaption(name);
- resourceName.setValue(desc);
- // Put all resources on map (may be many if category was selected)
- final LinkedList<Item> srs = resourcePanel.getSelectedResources();
- for (final Iterator<Item> it = srs.iterator(); it.hasNext();) {
- resource = it.next();
- name = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_NAME).getValue();
- desc = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_DESCRIPTION).getValue();
- final Double x = (Double) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_LOCATIONX).getValue();
- final Double y = (Double) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_LOCATIONY).getValue();
- if (x != null && y != null) {
- map.addMarker(name + "<br/>" + desc, new Point2D.Double(x
- .doubleValue(), y.doubleValue()));
-
- }
-
- }
- map.setZoomLevel((srs.size() == 1 ? 14 : 9));
- }
-
- }
-
- private void initCalendarFieldPropertyIds(CalendarField cal) {
- cal.setItemStyleNamePropertyId(SampleDB.Resource.PROPERTY_ID_STYLENAME);
- cal
- .setItemStartPropertyId(SampleDB.Reservation.PROPERTY_ID_RESERVED_FROM);
- cal.setItemEndPropertyId(SampleDB.Reservation.PROPERTY_ID_RESERVED_TO);
- cal.setItemTitlePropertyId(SampleDB.Resource.PROPERTY_ID_NAME);
- cal
- .setItemDescriptionPropertyId(SampleDB.Reservation.PROPERTY_ID_DESCRIPTION);
- }
-
- public void selectedResourcesChanged(
- ResourceSelectorPanel.SelectedResourcesChangedEvent event) {
- refreshReservations();
- refreshSelectedResources(true);
- }
-
-}
diff --git a/src/com/vaadin/demo/reservation/ResourceNotAvailableException.java b/src/com/vaadin/demo/reservation/ResourceNotAvailableException.java deleted file mode 100644 index edb52f8a56..0000000000 --- a/src/com/vaadin/demo/reservation/ResourceNotAvailableException.java +++ /dev/null @@ -1,12 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation;
-
-@SuppressWarnings("serial")
-public class ResourceNotAvailableException extends Exception {
- public ResourceNotAvailableException(String message) {
- super(message);
- }
-}
diff --git a/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java b/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java deleted file mode 100644 index 2b4047722a..0000000000 --- a/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java +++ /dev/null @@ -1,142 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class ResourceSelectorPanel extends Panel implements
- Button.ClickListener {
- private final HashMap<String, Layout> categoryLayouts = new HashMap<String, Layout>();
- private final HashMap<String, LinkedList<Item>> categoryResources = new HashMap<String, LinkedList<Item>>();
-
- // private Container allResources;
- private LinkedList<Item> selectedResources = null;
-
- public ResourceSelectorPanel(String caption) {
- super(caption, new HorizontalLayout());
- addStyleName(Panel.STYLE_LIGHT);
- setSizeUndefined();
- setWidth("100%");
- }
-
- public void setResourceContainer(Container resources) {
- removeAllComponents();
- categoryLayouts.clear();
- categoryResources.clear();
- if (resources != null && resources.size() > 0) {
- for (final Iterator<?> it = resources.getItemIds().iterator(); it
- .hasNext();) {
- final Item resource = resources.getItem(it.next());
- // final Integer id = (Integer) resource.getItemProperty(
- // SampleDB.Resource.PROPERTY_ID_ID).getValue();
- final String category = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_CATEGORY).getValue();
- final String name = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_NAME).getValue();
- final String description = (String) resource.getItemProperty(
- SampleDB.Resource.PROPERTY_ID_DESCRIPTION).getValue();
- final Button rButton = new Button(name, this);
- rButton.setStyleName("link");
- rButton.setDescription(description);
- rButton.setData(resource);
- Layout resourceLayout = categoryLayouts.get(category);
- LinkedList<Item> resourceList = categoryResources.get(category);
- if (resourceLayout == null) {
- resourceLayout = new VerticalLayout();
- resourceLayout.setSizeUndefined();
- resourceLayout.setMargin(true);
- addComponent(resourceLayout);
- categoryLayouts.put(category, resourceLayout);
- resourceList = new LinkedList<Item>();
- categoryResources.put(category, resourceList);
- final Button cButton = new Button(category + " (any)", this);
- cButton.setStyleName("important-link");
- cButton.setData(category);
- resourceLayout.addComponent(cButton);
- }
- resourceLayout.addComponent(rButton);
- resourceList.add(resource);
- }
- }
- }
-
- // Selects one initial category, in practice randomly
- public void selectFirstCategory() {
- try {
- final String catId = categoryResources.keySet().iterator().next();
- final LinkedList<Item> res = categoryResources.get(catId);
- final Layout l = categoryLayouts.get(catId);
- final Button catB = (Button) l.getComponentIterator().next();
- setSelectedResources(res);
- catB.setStyleName("selected-link");
- } catch (final Exception e) {
- e.printStackTrace(System.err);
- }
- }
-
- private void setSelectedResources(LinkedList<Item> resources) {
- selectedResources = resources;
- fireEvent(new SelectedResourcesChangedEvent());
- }
-
- public LinkedList<Item> getSelectedResources() {
- return selectedResources;
- }
-
- public void buttonClick(ClickEvent event) {
- final Object source = event.getSource();
- if (source instanceof Button) {
- final Object data = ((Button) source).getData();
- resetStyles();
- if (data instanceof Item) {
- final LinkedList<Item> rlist = new LinkedList<Item>();
- rlist.add((Item) data);
- setSelectedResources(rlist);
- } else {
- final String category = (String) data;
- final LinkedList<Item> resources = categoryResources
- .get(category);
- setSelectedResources(resources);
- }
- ((Button) source).setStyleName("selected-link");
- }
-
- }
-
- private void resetStyles() {
- for (final Iterator<Layout> it = categoryLayouts.values().iterator(); it
- .hasNext();) {
- final Layout lo = it.next();
- for (final Iterator<?> bit = lo.getComponentIterator(); bit
- .hasNext();) {
- final Button b = (Button) bit.next();
- if (b.getData() instanceof Item) {
- b.setStyleName("link");
- } else {
- b.setStyleName("important-link");
- }
- }
- }
-
- }
-
- public class SelectedResourcesChangedEvent extends Event {
- public SelectedResourcesChangedEvent() {
- super(ResourceSelectorPanel.this);
- }
- }
-}
diff --git a/src/com/vaadin/demo/reservation/SampleDB.java b/src/com/vaadin/demo/reservation/SampleDB.java deleted file mode 100644 index 59eb7ef010..0000000000 --- a/src/com/vaadin/demo/reservation/SampleDB.java +++ /dev/null @@ -1,559 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.reservation; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.util.QueryContainer; - -public class SampleDB { - public class User { - public static final String TABLE = "USER"; - public static final String PROPERTY_ID_ID = TABLE + "_ID"; - public static final String PROPERTY_ID_FULLNAME = TABLE + "_FULLNAME"; - public static final String PROPERTY_ID_EMAIL = TABLE + "_EMAIL"; - public static final String PROPERTY_ID_PASSWORD = TABLE + "_PASSWORD"; - public static final String PROPERTY_ID_DELETED = TABLE + "_DELETED"; - } - - public class Resource { - public static final String TABLE = "RESOURCE"; - public static final String PROPERTY_ID_ID = TABLE + "_ID"; - public static final String PROPERTY_ID_STYLENAME = TABLE + "_STYLENAME"; - public static final String PROPERTY_ID_NAME = TABLE + "_NAME"; - public static final String PROPERTY_ID_DESCRIPTION = TABLE - + "_DESCRIPTION"; - public static final String PROPERTY_ID_LOCATIONX = TABLE - + "_LOCATION_X"; - public static final String PROPERTY_ID_LOCATIONY = TABLE - + "_LOCATION_Y"; - public static final String PROPERTY_ID_CATEGORY = TABLE + "_CATEGORY"; - public static final String PROPERTY_ID_DELETED = TABLE + "_DELETED"; - } - - public class Reservation { - public static final String TABLE = "RESERVATION"; - public static final String PROPERTY_ID_ID = TABLE + "_ID"; - public static final String PROPERTY_ID_DESCRIPTION = TABLE - + "_DESCRIPTION"; - public static final String PROPERTY_ID_RESOURCE_ID = TABLE - + "_RESOURCE_ID"; - public static final String PROPERTY_ID_RESERVED_BY_ID = TABLE - + "_RESERVED_BY_USER_ID"; - public static final String PROPERTY_ID_RESERVED_FROM = TABLE - + "_RESERVED_FROM"; - public static final String PROPERTY_ID_RESERVED_TO = TABLE - + "_RESERVED_TO"; - } - - private static final String DEFAULT_JDBC_URL = "jdbc:hsqldb:mem:reservation.db"; - private static Object dbMutex = new Object(); - - private static final String CREATE_TABLE_USER = "CREATE TABLE " - + User.TABLE + " (" + " " + User.PROPERTY_ID_ID - + " INTEGER IDENTITY" + ", " + User.PROPERTY_ID_FULLNAME - + " VARCHAR(100) NOT NULL" + ", " + User.PROPERTY_ID_EMAIL - + " VARCHAR(50) NOT NULL" + ", " + User.PROPERTY_ID_PASSWORD - + " VARCHAR(20) NOT NULL" + ", " + User.PROPERTY_ID_DELETED - + " BOOLEAN DEFAULT false NOT NULL" + ", UNIQUE(" - + User.PROPERTY_ID_FULLNAME + "), UNIQUE(" + User.PROPERTY_ID_EMAIL - + ") )"; - private static final String CREATE_TABLE_RESOURCE = "CREATE TABLE " - + Resource.TABLE + " (" + " " + Resource.PROPERTY_ID_ID - + " INTEGER IDENTITY" + ", " + Resource.PROPERTY_ID_STYLENAME - + " VARCHAR(20) NOT NULL" + ", " + Resource.PROPERTY_ID_NAME - + " VARCHAR(30) NOT NULL" + ", " + Resource.PROPERTY_ID_DESCRIPTION - + " VARCHAR(100)" + ", " + Resource.PROPERTY_ID_LOCATIONX - + " DOUBLE" + ", " + Resource.PROPERTY_ID_LOCATIONY + " DOUBLE" - + ", " + Resource.PROPERTY_ID_CATEGORY + " VARCHAR(30)" + ", " - + Resource.PROPERTY_ID_DELETED + " BOOLEAN DEFAULT false NOT NULL" - + ", UNIQUE(" + Resource.PROPERTY_ID_NAME + "))"; - private static final String CREATE_TABLE_RESERVATION = "CREATE TABLE " - + Reservation.TABLE + " (" + " " + Reservation.PROPERTY_ID_ID - + " INTEGER IDENTITY" + ", " + Reservation.PROPERTY_ID_RESOURCE_ID - + " INTEGER" + ", " + Reservation.PROPERTY_ID_RESERVED_BY_ID - + " INTEGER" + ", " + Reservation.PROPERTY_ID_RESERVED_FROM - + " TIMESTAMP NOT NULL" + ", " - + Reservation.PROPERTY_ID_RESERVED_TO + " TIMESTAMP NOT NULL" - + ", " + Reservation.PROPERTY_ID_DESCRIPTION + " VARCHAR(100)" - + ", FOREIGN KEY (" + Reservation.PROPERTY_ID_RESOURCE_ID - + ") REFERENCES " + Resource.TABLE + "(" + Resource.PROPERTY_ID_ID - + "), FOREIGN KEY (" + Reservation.PROPERTY_ID_RESERVED_BY_ID - + ") REFERENCES " + User.TABLE + "(" + User.PROPERTY_ID_ID + "))"; - - private static Connection connection = null; - - /** - * Create database. - * - * @param jdbcUrl - */ - public SampleDB(String jdbcUrl) { - if (jdbcUrl == null || jdbcUrl.equals("")) { - jdbcUrl = DEFAULT_JDBC_URL; - } - // connect to SQL database - connect(jdbcUrl); - - } - - private synchronized void dropTables() { - try { - update("DROP TABLE " + Reservation.TABLE); - } catch (final SQLException IGNORED) { - // IGNORED, assuming it was not there - } - try { - update("DROP TABLE " + Resource.TABLE); - } catch (final SQLException IGNORED) { - // IGNORED, assuming it was not there - } - try { - update("DROP TABLE " + User.TABLE); - } catch (final SQLException IGNORED) { - // IGNORED, assuming it was not there - } - } - - /** - * Connect to SQL database. In this sample we use HSQLDB and an toolkit - * named database in implicitly created into system memory. - * - */ - private synchronized void connect(String dbUrl) { - if (connection == null) { - try { - Class.forName("org.hsqldb.jdbcDriver").newInstance(); - connection = DriverManager.getConnection(dbUrl); - } catch (final Exception e) { - throw new RuntimeException(e); - } - - dropTables(); - // initialize SQL database - createTables(); - - // test by executing sample JDBC query - testDatabase(); - - generateResources(); - generateDemoUser(); - generateReservations(); - - } - } - - /** - * use for SQL commands CREATE, DROP, INSERT and UPDATE - * - * @param expression - * @throws SQLException - */ - private synchronized void update(String expression) throws SQLException { - Statement st = null; - st = connection.createStatement(); - final int i = st.executeUpdate(expression); - if (i == -1) { - System.out.println("SampleDatabase error : " + expression); - } - st.close(); - } - - /** - * Create test table and few rows. Issue note: using capitalized column - * names as HSQLDB returns column names in capitalized form with this demo. - * - */ - private synchronized void createTables() { - try { - String stmt = null; - stmt = CREATE_TABLE_RESOURCE; - update(stmt); - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - try { - String stmt = null; - stmt = CREATE_TABLE_USER; - update(stmt); - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - try { - String stmt = null; - stmt = CREATE_TABLE_RESERVATION; - update(stmt); - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - } - - /** - * Test database connection with simple SELECT command. - * - */ - private synchronized String testDatabase() { - String result = null; - try { - final Statement stmt = connection.createStatement( - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_UPDATABLE); - final ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM " - + Resource.TABLE); - rs.next(); - result = "rowcount for table test is " + rs.getObject(1).toString(); - stmt.close(); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - return result; - } - - public Connection getConnection() { - return connection; - } - - public Container getCategories() { - // TODO where deleted=? - final String q = "SELECT DISTINCT(" + Resource.PROPERTY_ID_CATEGORY - + ") FROM " + Resource.TABLE + " ORDER BY " - + Resource.PROPERTY_ID_CATEGORY; - try { - return new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - - } - - public Container getResources(String category) { - // TODO where deleted=? - String q = "SELECT * FROM " + Resource.TABLE; - if (category != null) { - q += " WHERE " + Resource.PROPERTY_ID_CATEGORY + "='" + category - + "'"; // FIXME -> - // PreparedStatement! - } - - try { - return new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - - } - - public Container getReservations(List<?> resources) { - // TODO where reserved_by=? - // TODO where from=? - // TODO where to=? - // TODO where deleted=? - String q = "SELECT * FROM " + Reservation.TABLE + "," + Resource.TABLE; - q += " WHERE " + Reservation.PROPERTY_ID_RESOURCE_ID + "=" - + Resource.PROPERTY_ID_ID; - if (resources != null && resources.size() > 0) { - final StringBuffer s = new StringBuffer(); - for (final Iterator<?> it = resources.iterator(); it.hasNext();) { - if (s.length() > 0) { - s.append(","); - } - s.append(((Item) it.next()) - .getItemProperty(Resource.PROPERTY_ID_ID)); - } - q += " HAVING " + Reservation.PROPERTY_ID_RESOURCE_ID + " IN (" + s - + ")"; - } - q += " ORDER BY " + Reservation.PROPERTY_ID_RESERVED_FROM; - try { - final QueryContainer qc = new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - if (qc.size() < 1) { - return null; - } else { - return qc; - } - } catch (final SQLException e) { - throw new RuntimeException(e); - } - } - - public synchronized void addReservation(Item resource, int reservedById, - Date reservedFrom, Date reservedTo, String description) { - if (reservedFrom.after(reservedTo)) { - final Date tmp = reservedTo; - reservedTo = reservedFrom; - reservedFrom = tmp; - } - final int resourceId = ((Integer) resource.getItemProperty( - Resource.PROPERTY_ID_ID).getValue()).intValue(); - final String q = "INSERT INTO " + Reservation.TABLE + " (" - + Reservation.PROPERTY_ID_RESOURCE_ID + "," - + Reservation.PROPERTY_ID_RESERVED_BY_ID + "," - + Reservation.PROPERTY_ID_RESERVED_FROM + "," - + Reservation.PROPERTY_ID_RESERVED_TO + "," - + Reservation.PROPERTY_ID_DESCRIPTION + ")" - + "VALUES (?,?,?,?,?)"; - synchronized (dbMutex) { - try { - if (!isAvailableResource(resourceId, reservedFrom, reservedTo)) { - throw new ResourceNotAvailableException( - "The resource is not available at that time."); - } - final PreparedStatement p = connection.prepareStatement(q); - p.setInt(1, resourceId); - p.setInt(2, reservedById); - p.setTimestamp(3, - new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(4, new java.sql.Timestamp(reservedTo.getTime())); - p.setString(5, description); - p.execute(); - } catch (final Exception e) { - throw new RuntimeException(e); - } - } - } - - public boolean isAvailableResource(int resourceId, Date reservedFrom, - Date reservedTo) { - // TODO where deleted=? - if (reservedFrom.after(reservedTo)) { - final Date tmp = reservedTo; - reservedTo = reservedFrom; - reservedFrom = tmp; - } - final String checkQ = "SELECT count(*) FROM " + Reservation.TABLE - + " WHERE " + Reservation.PROPERTY_ID_RESOURCE_ID + "=? AND ((" - + Reservation.PROPERTY_ID_RESERVED_FROM + ">=? AND " - + Reservation.PROPERTY_ID_RESERVED_FROM + "<?) OR (" - + Reservation.PROPERTY_ID_RESERVED_TO + ">? AND " - + Reservation.PROPERTY_ID_RESERVED_TO + "<=?) OR (" - + Reservation.PROPERTY_ID_RESERVED_FROM + "<=? AND " - + Reservation.PROPERTY_ID_RESERVED_TO + ">=?)" + ")"; - try { - final PreparedStatement p = connection.prepareStatement(checkQ); - p.setInt(1, resourceId); - p.setTimestamp(2, new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(3, new java.sql.Timestamp(reservedTo.getTime())); - p.setTimestamp(4, new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(5, new java.sql.Timestamp(reservedTo.getTime())); - p.setTimestamp(6, new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(7, new java.sql.Timestamp(reservedTo.getTime())); - p.execute(); - final ResultSet rs = p.getResultSet(); - if (rs.next() && rs.getInt(1) > 0) { - return false; - } - } catch (final Exception e) { - throw new RuntimeException(e); - } - return true; - } - - public Container getUsers() { - // TODO where deleted=? - final String q = "SELECT * FROM " + User.TABLE + " ORDER BY " - + User.PROPERTY_ID_FULLNAME; - try { - final QueryContainer qc = new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - return qc; - } catch (final SQLException e) { - throw new RuntimeException(e); - } - } - - @SuppressWarnings("deprecation") - public synchronized void generateReservations() { - final int days = 30; - final String descriptions[] = { "Picking up guests from airport", - "Sightseeing with the guests", - "Moving new servers from A to B", "Shopping", - "Customer meeting", "Guests arriving at harbour", - "Moving furniture", "Taking guests to see town" }; - final Container cat = getCategories(); - final Collection<?> cIds = cat.getItemIds(); - for (final Iterator<?> it = cIds.iterator(); it.hasNext();) { - final Object id = it.next(); - final Item ci = cat.getItem(id); - final String c = (String) ci.getItemProperty( - Resource.PROPERTY_ID_CATEGORY).getValue(); - final Container resources = getResources(c); - final Collection<?> rIds = resources.getItemIds(); - final Calendar cal = Calendar.getInstance(); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - cal.set(Calendar.MILLISECOND, 0); - final int hourNow = new Date().getHours(); - // cal.add(Calendar.DAY_OF_MONTH, -days); - for (int i = 0; i < days; i++) { - int r = 3; - for (final Iterator<?> rit = rIds.iterator(); rit.hasNext() - && r > 0; r--) { - final Object rid = rit.next(); - final Item resource = resources.getItem(rid); - final int s = hourNow - 6 - + (int) Math.round(Math.random() * 6.0); - final int e = s + 1 + (int) Math.round(Math.random() * 4.0); - final Date start = new Date(cal.getTimeInMillis()); - start.setHours(s); - final Date end = new Date(cal.getTimeInMillis()); - end.setHours(e); - addReservation(resource, 0, start, end, - descriptions[(int) Math.floor(Math.random() - * descriptions.length)]); - } - cal.add(Calendar.DATE, 1); - } - } - - } - - public synchronized void generateResources() { - - final Object[][] resources = { - // Turku - { "01", "01 Ford Mondeo", "w/ company logo", "Turku", - new Double(60.510857), new Double(22.275424) }, - { "02", "02 Citroen Jumper", - "w/ company logo. 12m3 storage space.", "Turku", - new Double(60.452171), new Double(22.2995) }, - { "03", "03 Saab 93", "Cabriolet. Keys from the rental desk.", - "Turku", new Double(60.4507), new Double(22.295551) }, - { "04", "04 Volvo S60", "Key from the rental desk.", "Turku", - new Double(60.434722), new Double(22.224398) }, - { "05", "05 Smart fourtwo", "Cabrio. Keys from infodesk.", - "Turku", new Double(60.508970), new Double(22.264790) }, - // Helsinki - { "06", "06 Smart fourtwo", "Cabrio. Keys from infodesk.", - "Helsinki", new Double(60.17175), new Double(24.939029) }, - { "07", "07 Smart fourtwo", "Cabrio. Keys from infodesk.", - "Helsinki", new Double(60.17175), new Double(24.939029) }, - { "08", "08 Smart fourtwo", "Cabrio. Keys from infodesk.", - "Helsinki", new Double(60.166579), - new Double(24.953899) }, - { "09", "09 Volvo S60", "Keys from infodesk.", "Helsinki", - new Double(60.317832), new Double(24.967289) }, - { "10", "10 Saab 93", "Keys from infodesk.", "Helsinki", - new Double(60.249193), new Double(25.045921) }, - // Silicon Valley - { "11", "11 Ford Mustang", "Keys from Acme clerk.", - "Silicon Valley", new Double(37.615853), - new Double(-122.386384) }, - { "12", "12 Ford Fusion", "Keys from infodesk.", - "Silicon Valley", new Double(37.365028), - new Double(-121.922654) }, - { "13", "13 Land Rover", "Keys from infodesk.", - "Silicon Valley", new Double(37.365028), - new Double(-121.922654) }, - { "14", "14 Land Rover", "Keys from infodesk.", - "Silicon Valley", new Double(37.365028), - new Double(-121.922654) }, - { "15", "15 Ford Mustang", "GT Cal Special. Keys from guard.", - "Silicon Valley", new Double(37.403812), - new Double(-121.977425) }, - { "16", "16 Ford Focus", "Keys from guard.", "Silicon Valley", - new Double(37.403812), new Double(-121.977425) }, - // Paris - { "17", "17 Peugeot 308", "Keys from infodesk.", "Paris", - new Double(48.844756), new Double(2.372784) }, - { "18", "18 Citroen C6", "Keys from rental desk.", "Paris", - new Double(49.007253), new Double(2.545025) }, - { "19", "19 Citroen C6", "Keys from infodesk.", "Paris", - new Double(48.729061), new Double(2.368087) }, - { "20", "20 Peugeot 308", "Keys from ticket sales.", "Paris", - new Double(48.880931), new Double(2.356988) }, - { "21", "21 Peugeot 308", "Keys from ticket sales.", "Paris", - new Double(48.876479), new Double(2.358161) }, - // STHLM - { "22", "22 Volvo S60", "Keys from infodesk.", "Stockholm", - new Double(59.350414), new Double(18.106574) }, - { "23", "23 Saab 93", "Keys from infodesk.", "Stockholm", - new Double(59.355905), new Double(17.946784) }, - { "24", "24 Smart fourtwo", "Keys from infodesk.", "Stockholm", - new Double(59.315939), new Double(18.095904) }, - { "25", "25 Smart fourtwo", "Keys from infodesk.", "Stockholm", - new Double(59.330716), new Double(18.058702) }, - // Boston - /* - * { "26", "26 Ford Mustang", "Keys from infodesk.", "Boston", new - * Double(42.366588), new Double(-71.020955) }, { "27", "27 Smart - * fourtwo", "Keys from infodesk.", "Boston", new Double(42.365419), new - * Double(-71.061748) }, { "28", "28 Volvo S60", "Keys from Seaport - * Hotel reception.", "Boston", new Double(42.34811), new - * Double(-71.041127) }, { "29", "29 Smart fourtwo", "Keys from Seaport - * Hotel reception.", "Boston", new Double(42.348072), new - * Double(-71.041315) }, - */ - - }; - - final String q = "INSERT INTO " + Resource.TABLE + "(" - + Resource.PROPERTY_ID_STYLENAME + "," - + Resource.PROPERTY_ID_NAME + "," - + Resource.PROPERTY_ID_DESCRIPTION + "," - + Resource.PROPERTY_ID_CATEGORY + "," - + Resource.PROPERTY_ID_LOCATIONX + "," - + Resource.PROPERTY_ID_LOCATIONY + ")" - + " VALUES (?,?,?,?,?,?)"; - try { - final PreparedStatement stmt = connection.prepareStatement(q); - for (int i = 0; i < resources.length; i++) { - int j = 0; - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setDouble(j + 1, ((Double) resources[i][j++]) - .doubleValue()); - stmt.setDouble(j + 1, ((Double) resources[i][j++]) - .doubleValue()); - stmt.execute(); - } - } catch (final SQLException e) { - throw new RuntimeException(e); - } - } - - public synchronized void generateDemoUser() { - final String q = "INSERT INTO USER (" + User.PROPERTY_ID_FULLNAME + "," - + User.PROPERTY_ID_EMAIL + "," + User.PROPERTY_ID_PASSWORD - + ") VALUES (?,?,?)"; - try { - final PreparedStatement stmt = connection.prepareStatement(q); - stmt.setString(1, "Demo User"); - stmt.setString(2, "demo.user@vaadin.com"); - stmt.setString(3, "demo"); - stmt.execute(); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - - } - -} diff --git a/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml b/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml deleted file mode 100644 index 4f38e07f26..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml +++ /dev/null @@ -1,26 +0,0 @@ -<module> - <!-- Inherit DefaultWidgetSet -->
- <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
-
- <!-- The googlemaps_gwt module --> - <inherits name="com.google.gwt.maps.GoogleMaps" /> - - <!-- WidgetSet default theme --> - <stylesheet src="reservr/styles.css"/> - - <!-- - Google Maps needs an API key if you're not running this demo on "localhost". - You can get a Google Maps API key here: - http://www.google.com/apis/maps/signup.html - - Append your Google Maps API key to the src -attribute below, like so: - src="http://maps.google.com/maps?gwt=1&file=api&v=2.x&key=XXXXXXXX" - where the X:s represent your key. - --> - <!-- Works w/o key for localhost: - <script src="http://maps.google.com/maps?gwt=1&file=api&v=2.x" /> - --> - <!-- Using key for http://demo.vaadin.com: --> - <script src="http://maps.google.com/maps?gwt=1&file=api&v=2.x&key=ABQIAAAAP3UBMIhn15mgO6uIqO_GVRTjfRw0y7NvUKCc8_UnYaOyzzWA_xRoBYGzLMNrw-8-IesNKDC1WFd_vg" /> - -</module> diff --git a/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java b/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java deleted file mode 100644 index 0ccb5b73ef..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java +++ /dev/null @@ -1,295 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation.gwt.client.ui;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.SourcesTableEvents;
-import com.google.gwt.user.client.ui.TableListener;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.DateTimeService;
-import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ui.CalendarEntry;
-import com.vaadin.terminal.gwt.client.ui.VCalendarPanel;
-import com.vaadin.terminal.gwt.client.ui.VDateField;
-
-@SuppressWarnings( { "deprecation", "unchecked" })
-public class VCalendarField extends VDateField {
-
- private final VCalendarPanel calPanel;
-
- private SimplePanel hourPanel;
-
- private FlexTable hourTable;
-
- private final EntrySource entrySource;
-
- private final TableListener ftListener = new HourTableListener();
-
- private int realResolution = RESOLUTION_DAY;
-
- private static final String CLASSNAME = VDateField.CLASSNAME
- + "-entrycalendar";
-
- public VCalendarField() {
- super();
- setStyleName(CLASSNAME);
- calPanel = new VCalendarPanel(this);
- add(calPanel);
- entrySource = new EntrySource();
- calPanel.setCalendarEntrySource(entrySource);
- calPanel.addTableListener(new TableListener() {
- public void onCellClicked(SourcesTableEvents sender, int row,
- int cell) {
- buildDayView(date);
- }
- });
- }
-
- @Override
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- super.updateFromUIDL(uidl, client);
- // We want to draw our own hour list
- realResolution = currentResolution;
- currentResolution = RESOLUTION_DAY;
- if (uidl.hasAttribute("min")) {
- final String mins = uidl.getStringAttribute("min");
- final long min = (mins != null ? Long.parseLong(mins) : 0);
- final String maxs = uidl.getStringAttribute("max");
- final long max = (maxs != null ? Long.parseLong(maxs) : 0);
- final Date minDate = (min > 0 ? new Date(min) : null);
- final Date maxDate = (max > 0 ? new Date(max) : null);
- calPanel.setLimits(minDate, maxDate);
- }
- entrySource.clear();
- for (final Iterator cit = uidl.getChildIterator(); cit.hasNext();) {
- final UIDL child = (UIDL) cit.next();
- if (child.getTag().equals("items")) {
- for (final Iterator iit = child.getChildIterator(); iit
- .hasNext();) {
- final UIDL item = (UIDL) iit.next();
- entrySource.addItem(item);
- }
- break;
- }
- }
- calPanel.updateCalendar();
- buildDayView(date);
- }
-
- protected void buildDayView(Date date) {
- if (hourPanel == null) {
- hourPanel = new SimplePanel();
- hourPanel.setStyleName(CLASSNAME + "-hours");
- calPanel.getFlexCellFormatter().setColSpan(8, 0, 7);
- calPanel.setWidget(8, 0, hourPanel);
- } else {
- hourPanel.clear();
- }
- hourTable = new FlexTable();
- hourTable.addTableListener(ftListener);
- hourPanel.add(hourTable);
- hourTable.setCellSpacing(1);
-
- for (int i = 0; i < 24; i++) {
- String style = (i % 2 == 0 ? "even" : "odd");
- if (realResolution >= RESOLUTION_HOUR) {
- if (this.date != null && this.date.getHours() == i) {
- style = "selected";
- }
- }
- hourTable.getRowFormatter().setStyleName(i,
- CLASSNAME + "-row-" + style);
- String hstr = (i < 10 ? "0" : "") + i + ":00";
- if (dts.isTwelveHourClock()) {
- final String ampm = (i < 12 ? "am" : "pm");
- hstr = (i <= 12 ? i : i - 12) + ":00 " + ampm;
- }
- hourTable.setHTML(i, 0, "<span>" + hstr + "</span>");
- hourTable.getCellFormatter()
- .setStyleName(i, 0, CLASSNAME + "-time");
- }
-
- final List entries = entrySource.getEntries(date,
- DateTimeService.RESOLUTION_DAY);
- int currentCol = 1;
- for (final Iterator it = entries.iterator(); it.hasNext();) {
- final CalendarEntry entry = (CalendarEntry) it.next();
- int start = 0;
- int hours = 24;
- if (!entry.isNotime()) {
- Date d = entry.getStart();
- // TODO consider month&year as well
- start = (d.getDate() < date.getDate() ? 0 : d.getHours());
- d = entry.getEnd();
- hours = (d.getDate() > date.getDate() ? 24 : d.getHours())
- - start;
- if (hours < 1) {
- // We can't draw entries smaller than
- // one
- hours = 1;
- }
- }
- int col = currentCol;
- if (col > 1) {
- while (!hourTable.isCellPresent(start, col - 1)) {
- col--;
- }
- }
- hourTable.setHTML(start, col, "<span>"
- + (entry.getTitle() != null ? entry.getTitle() : " ")
- + "</span>");
- hourTable.getFlexCellFormatter().setRowSpan(start, col, hours);
- hourTable.getFlexCellFormatter().setStyleName(start, col,
- CLASSNAME + "-entry");
- final String sn = entry.getStyleName();
- if (sn != null && !sn.equals("")) {
- hourTable.getFlexCellFormatter().addStyleName(start, col,
- CLASSNAME + "-" + entry.getStyleName());
- }
- final Element el = hourTable.getFlexCellFormatter().getElement(
- start, col);
-
- String tooltip;
- if (DateTimeService.isSameDay(entry.getStart(), entry.getEnd())) {
- tooltip = (start < 10 ? "0" : "") + start + ":00";
- if (dts.isTwelveHourClock()) {
- final String ampm = (start < 12 ? "am" : "pm");
- tooltip = (start <= 12 ? start : start - 12) + ":00 "
- + ampm;
-
- }
- tooltip += " (" + hours + "h) ";
- if (entry.getTitle() != null) {
- tooltip += entry.getTitle() + "\n ";
- }
- } else {
- tooltip = entry.getStringForDate(entry.getEnd()) + "\n ";
- }
- if (entry.getDescription() != null) {
- tooltip += "\"" + entry.getDescription() + "\"";
- }
- DOM.setElementProperty(el, "title", tooltip);
-
- currentCol++;
- }
-
- // int hour = new Date().getHours()+1; // scroll to current hour
- Date d = (this.date != null ? this.date : new Date());
- final int hour = d.getHours() + 1; // scroll to selected
- // hour
- final int h1 = hourPanel.getOffsetHeight() / 2;
- final int oh = hourTable.getOffsetHeight();
- final int h2 = (int) (hour / 24.0 * oh);
- final int scrollTop = h2 - h1;
- final Element el = hourPanel.getElement();
- setScrollTop(el, scrollTop);
-
- }
-
- private native void setScrollTop(Element el, int scrollTop)
- /*-{
- el.scrollTop = scrollTop;
- }-*/;
-
- private class HourTableListener implements TableListener {
-
- public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
- if (realResolution < RESOLUTION_HOUR || date == null) {
- return;
- }
- date.setHours(row);
- client.updateVariable(id, "hour", row, immediate);
- }
-
- }
-
- private class EntrySource implements VCalendarPanel.CalendarEntrySource {
-
- private final HashMap dates = new HashMap();
-
- public void addItem(UIDL item) {
- final String styleName = item.getStringAttribute("styleName");
- // final Integer id = new Integer(item.getIntAttribute("id"));
-
- DateTimeFormat dtf = DateTimeFormat
- .getFormat("d MM yyyy HH:mm:ss Z");
-
- Date startDate = dtf.parse(item.getStringAttribute("start"));
-
- // fix times with server-client difference
- int diff = (startDate.getTimezoneOffset() - item
- .getIntAttribute("Z")) * 60000;
- startDate = new Date(startDate.getTime() + diff);
- Date endDate;
- if (item.hasAttribute("end")) {
- endDate = dtf.parse(item.getStringAttribute("end"));
- endDate = new Date(endDate.getTime() + diff);
- } else {
- endDate = (Date) startDate.clone();
- }
- final String title = item.getStringAttribute("title");
- final String desc = item.getStringAttribute("description");
- final boolean notime = item.getBooleanAttribute("notime");
- final CalendarEntry entry = new CalendarEntry(styleName, startDate,
- endDate, title, desc, notime);
-
- // TODO should remove+readd if the same entry (id) is
- // added again
-
- for (final Date d = new Date(entry.getStart().getTime()); d
- .getYear() <= entry.getEnd().getYear()
- && d.getMonth() <= entry.getEnd().getYear()
- && d.getDate() <= entry.getEnd().getDate(); d.setTime(d
- .getTime() + 86400000)) {
- final String key = d.getYear() + "" + d.getMonth() + ""
- + d.getDate();
- ArrayList l = (ArrayList) dates.get(key);
- if (l == null) {
- l = new ArrayList();
- dates.put(key, l);
- }
- l.add(entry);
- }
- }
-
- public List getEntries(Date date, int resolution) {
- final ArrayList res = new ArrayList();
- if (date == null) {
- return res;
- }
- final List entries = (List) dates.get(date.getYear() + ""
- + date.getMonth() + "" + date.getDate());
-
- if (entries == null) {
- return res;
- }
- for (final Iterator it = entries.iterator(); it.hasNext();) {
- final CalendarEntry item = (CalendarEntry) it.next();
- if (DateTimeService.isInRange(date, item.getStart(), item
- .getEnd(), resolution)) {
- res.add(item);
- }
- }
-
- return res;
- }
-
- public void clear() {
- dates.clear();
- }
-
- }
-
-}
diff --git a/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java b/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java deleted file mode 100644 index 48d7d4b7f2..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java +++ /dev/null @@ -1,93 +0,0 @@ -/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.demo.reservation.gwt.client.ui;
-
-import java.util.Iterator;
-
-import com.google.gwt.maps.client.InfoWindowContent;
-import com.google.gwt.maps.client.MapWidget;
-import com.google.gwt.maps.client.control.SmallMapControl;
-import com.google.gwt.maps.client.event.MarkerClickHandler;
-import com.google.gwt.maps.client.geom.LatLng;
-import com.google.gwt.maps.client.overlay.Marker;
-import com.google.gwt.user.client.ui.Composite;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Paintable;
-import com.vaadin.terminal.gwt.client.UIDL;
-
-public class VGoogleMap extends Composite implements Paintable {
-
- public static final String CLASSNAME = "v-googlemap";
-
- private final MapWidget widget = new MapWidget();
-
- public VGoogleMap() {
- initWidget(widget);
- setWidth("200px");
- setHeight("200px");
- setStyleName(CLASSNAME);
- widget.addControl(new SmallMapControl());
-
- }
-
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- widget.clearOverlays();
- LatLng pos = null;
- for (final Iterator<Object> it = uidl.getChildIterator(); it.hasNext();) {
- final UIDL u = (UIDL) it.next();
- if (u.getTag().equals("markers")) {
-
- for (final Iterator<Object> m = u.getChildIterator(); m
- .hasNext();) {
- final UIDL umarker = (UIDL) m.next();
- final String html = "<span>"
- + umarker.getStringAttribute("html") + "</span>";
- final double x = umarker.getDoubleAttribute("x");
- final double y = umarker.getDoubleAttribute("y");
- pos = LatLng.newInstance(x, y);
- final Marker marker = new Marker(pos);
- widget.addOverlay(marker);
- if (html != null) {
- addMarkerPopup(marker, html);
- }
- }
- }
- }
- if (uidl.hasAttribute("width")) {
- widget.setWidth(uidl.getStringAttribute("width"));
- }
- if (uidl.hasAttribute("height")) {
- widget.setHeight(uidl.getStringAttribute("height"));
- }
- if (uidl.hasAttribute("zoom")) {
- widget.setZoomLevel(uidl.getIntAttribute("zoom"));
- }
- if (uidl.hasAttribute("centerX") && uidl.hasAttribute("centerY")) {
- final LatLng center = LatLng.newInstance(uidl
- .getDoubleAttribute("centerX"), uidl
- .getDoubleAttribute("centerY"));
- widget.setCenter(center);
- } else if (pos != null) {
- // use last marker position
- widget.setCenter(pos);
- }
-
- }
-
- private void addMarkerPopup(Marker marker, final String html) {
- marker.addMarkerClickHandler(new MarkerClickHandler() {
-
- @SuppressWarnings("deprecation")
- public void onClick(MarkerClickEvent event) {
- widget.getInfoWindow().open(event.getSender().getPoint(),
- new InfoWindowContent(html));
-
- }
-
- });
-
- }
-
-}
diff --git a/src/com/vaadin/demo/reservation/gwt/public/reservr/googlemap/css/googlemap.css b/src/com/vaadin/demo/reservation/gwt/public/reservr/googlemap/css/googlemap.css deleted file mode 100644 index 8a71f89721..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/public/reservr/googlemap/css/googlemap.css +++ /dev/null @@ -1,4 +0,0 @@ -.v-googlemap {
- margin-top: 5px;
- border: 1px solid #d6d6d6;
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/calendar-time-selected.gif b/src/com/vaadin/demo/reservation/gwt/public/reservr/img/calendar-time-selected.gif Binary files differdeleted file mode 100755 index 73c7857fc9..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/calendar-time-selected.gif +++ /dev/null diff --git a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/entry-bg.jpg b/src/com/vaadin/demo/reservation/gwt/public/reservr/img/entry-bg.jpg Binary files differdeleted file mode 100644 index a6aeecaf70..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/entry-bg.jpg +++ /dev/null diff --git a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/entry-topleft.jpg b/src/com/vaadin/demo/reservation/gwt/public/reservr/img/entry-topleft.jpg Binary files differdeleted file mode 100644 index 53da0b13c0..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/entry-topleft.jpg +++ /dev/null diff --git a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/event-bg.jpg b/src/com/vaadin/demo/reservation/gwt/public/reservr/img/event-bg.jpg Binary files differdeleted file mode 100644 index 44d65c4dd7..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/public/reservr/img/event-bg.jpg +++ /dev/null diff --git a/src/com/vaadin/demo/reservation/gwt/public/reservr/styles.css b/src/com/vaadin/demo/reservation/gwt/public/reservr/styles.css deleted file mode 100644 index 13551850d4..0000000000 --- a/src/com/vaadin/demo/reservation/gwt/public/reservr/styles.css +++ /dev/null @@ -1,149 +0,0 @@ -@import "googlemap/css/googlemap.css";
-
-/* Entrycalendar styles */
-.v-datefield-entrycalendar-hours {
- width: 240px;
- height: auto;
-}
-.v-datefield-entrycalendar-hours table {
- table-layout: fixed;
-}
-.v-datefield-entrycalendar-hours table tr {
- height: 1em;
-}
-.v-datefield-entrycalendar-row-even {
- cursor: pointer;
- background: #fff;
- height: 1em;
-}
-.v-datefield-entrycalendar-row-odd {
- cursor: pointer;
- background: #f6f7f7;
- height: 1em;
-}
-.v-datefield-entrycalendar-row-selected {
- color: #fff;
- background: #5daee8 url(img/calendar-time-selected.gif) no-repeat;
-}
-.v-datefield-calendarpanel td.v-datefield-entrycalendar-time { - width: 55px; - padding: 2px 0px; - white-space: nowrap; -} -td.v-datefield-entrycalendar-time span { - width: 47px; - padding: 0px 4px; - text-align: right; - display: block; -}
-td.v-datefield-entrycalendar-entry {
- overflow: hidden;
-}
-td.v-datefield-entrycalendar-entry span {
- display: block;
- overflow: hidden;
- padding: 2px;
- color: #fff;
- background-image: url(img/entry-topleft.jpg);
- background-repeat: no-repeat;
- background-position: 0px 0px;
- text-align: left;
-}
-.v-datefield-calendarpanel td.v-datefield-entrycalendar-entry {
- background-color: #F24C1A;
- color: #fff;
- background-image: url(img/entry-bg.jpg);
- background-repeat: repeat-x;
- vertical-align: top;
- width: auto;
-}
-
-/* Reservr styles */
-.v-datefield-entrycalendar-01 {
-
-}
-.v-datefield-entrycalendar-02 {
-
-}
-.v-datefield-entrycalendar-03 {
-
-}
-.v-datefield-entrycalendar-04 {
-
-}
-.v-datefield-entrycalendar-05 {
-
-}
-.v-datefield-entrycalendar-06 {
-
-}
-.v-datefield-entrycalendar-07 {
-
-}
-.v-datefield-entrycalendar-08 {
-
-}
-.v-datefield-entrycalendar-09 {
-
-}
-.v-datefield-entrycalendar-10 {
-
-}
-.v-datefield-entrycalendar-11 {
-
-}
-.v-datefield-entrycalendar-12 {
-
-}
-.v-datefield-entrycalendar-13 {
-
-}
-.v-datefield-entrycalendar-14 {
-
-}
-.v-datefield-entrycalendar-15 {
-
-}
-.v-datefield-entrycalendar-16 {
-
-}
-.v-datefield-entrycalendar-17 {
-
-}
-.v-datefield-entrycalendar-18 {
-
-}
-.v-datefield-entrycalendar-19 {
-
-}
-.v-datefield-entrycalendar-20 {
-
-}
-.v-datefield-entrycalendar-21 {
-
-}
-.v-datefield-entrycalendar-22 {
-
-}
-.v-datefield-entrycalendar-23 {
-
-}
-.v-datefield-entrycalendar-24 {
-
-}
-.v-datefield-entrycalendar-25 {
-
-}
-.v-datefield-entrycalendar-26 {
-
-}
-.v-datefield-entrycalendar-27 {
-
-}
-.v-datefield-entrycalendar-28 {
-
-}
-.v-datefield-entrycalendar-29 {
-
-}
-
diff --git a/src/com/vaadin/demo/reservation/simple/AdminView.java b/src/com/vaadin/demo/reservation/simple/AdminView.java deleted file mode 100644 index 49798f5181..0000000000 --- a/src/com/vaadin/demo/reservation/simple/AdminView.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.vaadin.demo.reservation.simple; - -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.AbstractSelect.NewItemHandler; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -@SuppressWarnings("serial") -public class AdminView extends VerticalLayout { - - private ComboBox resources = new ComboBox( - "Select for editing or type new resource"); - private SimpleReserver application; - private VerticalLayout form = new VerticalLayout(); - private Button save = new Button("Save resource"); - - private TextField name = new TextField("Name:"); - private TextField desc = new TextField("Description:"); - protected Item editedItem; - - AdminView(SimpleReserver app) { - setWidth("250px"); - - application = app; - - resources.setImmediate(true); - resources.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS); - refreshList(); - resources.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY); - resources.setItemCaptionPropertyId(SampleDB.Resource.PROPERTY_ID_NAME); - resources.setNewItemsAllowed(true); - resources.setNewItemHandler(new NewItemHandler() { - public void addNewItem(String newItemCaption) { - name.setValue(newItemCaption); - desc.setValue(""); - form.setVisible(true); - } - }); - - resources.addListener(new ComboBox.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - if (resources.getValue() != null) { - editedItem = resources.getItem(resources.getValue()); - - name - .setPropertyDataSource(editedItem - .getItemProperty(SampleDB.Resource.PROPERTY_ID_NAME)); - desc - .setPropertyDataSource(editedItem - .getItemProperty(SampleDB.Resource.PROPERTY_ID_DESCRIPTION)); - - form.setVisible(true); - - } else { - form.setVisible(false); - editedItem = null; - } - - } - }); - addComponent(resources); - - form.setVisible(false); - addComponent(form); - form.addComponent(name); - form.addComponent(desc); - name.setWidth("100%"); - desc.setWidth("100%"); - form.addComponent(save); - save.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - if (editedItem == null) { - // save - application.getDb().addResource(name.getValue().toString(), - desc.getValue().toString()); - } else { - // update - application.getDb().updateResource(editedItem, - name.getValue().toString(), - desc.getValue().toString()); - } - resources.setValue(null); - refreshList(); - } - }); - - } - - private void refreshList() { - resources - .setContainerDataSource(application.getDb().getResources(null)); - } -} diff --git a/src/com/vaadin/demo/reservation/simple/SampleDB.java b/src/com/vaadin/demo/reservation/simple/SampleDB.java deleted file mode 100644 index bd1808e385..0000000000 --- a/src/com/vaadin/demo/reservation/simple/SampleDB.java +++ /dev/null @@ -1,502 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.reservation.simple; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.util.QueryContainer; -import com.vaadin.demo.reservation.ResourceNotAvailableException; - -/** - * Simplified version of Reservr's SampleDB - * - * If you are going to use this application in production, make sure to modify - * this to save data into real DB instead of in memory HSQLDB. - */ -public class SampleDB { - - public class Resource { - public static final String TABLE = "RESOURCE"; - public static final String PROPERTY_ID_ID = TABLE + "_ID"; - public static final String PROPERTY_ID_STYLENAME = TABLE + "_STYLENAME"; - public static final String PROPERTY_ID_NAME = TABLE + "_NAME"; - public static final String PROPERTY_ID_DESCRIPTION = TABLE - + "_DESCRIPTION"; - public static final String PROPERTY_ID_LOCATIONX = TABLE - + "_LOCATION_X"; - public static final String PROPERTY_ID_LOCATIONY = TABLE - + "_LOCATION_Y"; - public static final String PROPERTY_ID_CATEGORY = TABLE + "_CATEGORY"; - public static final String PROPERTY_ID_DELETED = TABLE + "_DELETED"; - } - - public class Reservation { - public static final String TABLE = "RESERVATION"; - public static final String PROPERTY_ID_ID = TABLE + "_ID"; - public static final String PROPERTY_ID_DESCRIPTION = TABLE - + "_DESCRIPTION"; - public static final String PROPERTY_ID_RESOURCE_ID = TABLE - + "_RESOURCE_ID"; - public static final String PROPERTY_ID_RESERVED_BY = TABLE - + "_RESERVED_BY_USER"; - public static final String PROPERTY_ID_RESERVED_FROM = TABLE - + "_RESERVED_FROM"; - public static final String PROPERTY_ID_RESERVED_TO = TABLE - + "_RESERVED_TO"; - } - - // TODO -> param - private static final String DB_URL = "jdbc:hsqldb:file:reservationsimple.db"; - - private static final String CREATE_TABLE_RESOURCE = "CREATE TABLE " - + Resource.TABLE + " (" + " " + Resource.PROPERTY_ID_ID - + " INTEGER IDENTITY" + ", " + Resource.PROPERTY_ID_STYLENAME - + " VARCHAR(20) NOT NULL" + ", " + Resource.PROPERTY_ID_NAME - + " VARCHAR(30) NOT NULL" + ", " + Resource.PROPERTY_ID_DESCRIPTION - + " VARCHAR(100)" + ", " + Resource.PROPERTY_ID_LOCATIONX - + " DOUBLE" + ", " + Resource.PROPERTY_ID_LOCATIONY + " DOUBLE" - + ", " + Resource.PROPERTY_ID_CATEGORY + " VARCHAR(30)" + ", " - + Resource.PROPERTY_ID_DELETED + " BOOLEAN DEFAULT false NOT NULL" - + ", UNIQUE(" + Resource.PROPERTY_ID_NAME + "))"; - private static final String CREATE_TABLE_RESERVATION = "CREATE TABLE " - + Reservation.TABLE + " (" + " " + Reservation.PROPERTY_ID_ID - + " INTEGER IDENTITY" + ", " + Reservation.PROPERTY_ID_RESOURCE_ID - + " INTEGER" + ", " + Reservation.PROPERTY_ID_RESERVED_FROM - + " TIMESTAMP NOT NULL" + ", " - + Reservation.PROPERTY_ID_RESERVED_TO + " TIMESTAMP NOT NULL" - + ", " + Reservation.PROPERTY_ID_DESCRIPTION + " VARCHAR(100)" - + ", " + Reservation.PROPERTY_ID_RESERVED_BY + " VARCHAR(100)" - + ", FOREIGN KEY (" + Reservation.PROPERTY_ID_RESOURCE_ID - + ") REFERENCES " + Resource.TABLE + "(" + Resource.PROPERTY_ID_ID - + "))"; - - private static Connection connection = null; - - /** - * Create database. - */ - public SampleDB() { - // connect to SQL database - connect(); - - } - - private synchronized void dropTables() { - try { - update("DROP TABLE " + Reservation.TABLE); - } catch (final SQLException IGNORED) { - // IGNORED, assuming it was not there - } - try { - update("DROP TABLE " + Resource.TABLE); - } catch (final SQLException IGNORED) { - // IGNORED, assuming it was not there - } - } - - /** - * Connect to SQL database. In this sample we use HSQLDB and an toolkit - * named database in implicitly created into system memory. - * - */ - private synchronized void connect() { - if (connection == null) { - try { - Class.forName("org.hsqldb.jdbcDriver").newInstance(); - connection = DriverManager.getConnection(DB_URL); - } catch (final Exception e) { - throw new RuntimeException(e); - } - - dropTables(); - // initialize SQL database - createTables(); - - // test by executing sample JDBC query - testDatabase(); - - generateResources(); - generateReservations(); - - } - } - - /** - * use for SQL commands CREATE, DROP, INSERT and UPDATE - * - * @param expression - * @throws SQLException - */ - private synchronized void update(String expression) throws SQLException { - Statement st = null; - st = connection.createStatement(); - final int i = st.executeUpdate(expression); - if (i == -1) { - System.out.println("SampleDatabase error : " + expression); - } - st.close(); - } - - /** - * Create test table and few rows. Issue note: using capitalized column - * names as HSQLDB returns column names in capitalized form with this demo. - * - */ - private synchronized void createTables() { - try { - String stmt = null; - stmt = CREATE_TABLE_RESOURCE; - update(stmt); - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - try { - String stmt = null; - stmt = CREATE_TABLE_RESERVATION; - update(stmt); - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - } - - /** - * Test database connection with simple SELECT command. - * - */ - private synchronized String testDatabase() { - String result = null; - try { - final Statement stmt = connection.createStatement( - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_UPDATABLE); - final ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM " - + Resource.TABLE); - rs.next(); - result = "rowcount for table test is " + rs.getObject(1).toString(); - stmt.close(); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - return result; - } - - public Connection getConnection() { - return connection; - } - - public Container getCategories() { - // TODO where deleted=? - final String q = "SELECT DISTINCT(" + Resource.PROPERTY_ID_CATEGORY - + ") FROM " + Resource.TABLE + " ORDER BY " - + Resource.PROPERTY_ID_CATEGORY; - try { - return new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - - } - - public Container getResources(String category) { - // TODO where deleted=? - String q = "SELECT * FROM " + Resource.TABLE; - if (category != null) { - q += " WHERE " + Resource.PROPERTY_ID_CATEGORY + "='" + category - + "'"; // FIXME -> - // PreparedStatement! - } - - try { - return new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - - } - - public Container getReservations(List<?> resources) { - // TODO where reserved_by=? - // TODO where from=? - // TODO where to=? - // TODO where deleted=? - String q = "SELECT * FROM " + Reservation.TABLE + "," + Resource.TABLE; - q += " WHERE " + Reservation.PROPERTY_ID_RESOURCE_ID + "=" - + Resource.PROPERTY_ID_ID; - if (resources != null && resources.size() > 0) { - final StringBuffer s = new StringBuffer(); - for (final Iterator<?> it = resources.iterator(); it.hasNext();) { - if (s.length() > 0) { - s.append(","); - } - s.append(((Item) it.next()) - .getItemProperty(Resource.PROPERTY_ID_ID)); - } - q += " HAVING " + Reservation.PROPERTY_ID_RESOURCE_ID + " IN (" + s - + ")"; - } - q += " ORDER BY " + Reservation.PROPERTY_ID_RESERVED_FROM; - try { - final QueryContainer qc = new QueryContainer(q, connection, - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_READ_ONLY); - if (qc.size() < 1) { - return null; - } else { - return qc; - } - } catch (final SQLException e) { - throw new RuntimeException(e); - } - } - - public synchronized void addReservation(Item resource, String reservedBy, - Date reservedFrom, Date reservedTo, String description) - throws ResourceNotAvailableException { - if (reservedFrom.after(reservedTo)) { - final Date tmp = reservedTo; - reservedTo = reservedFrom; - reservedFrom = tmp; - } - final int resourceId = ((Integer) resource.getItemProperty( - Resource.PROPERTY_ID_ID).getValue()).intValue(); - final String q = "INSERT INTO " + Reservation.TABLE + " (" - + Reservation.PROPERTY_ID_RESOURCE_ID + "," - + Reservation.PROPERTY_ID_RESERVED_BY + "," - + Reservation.PROPERTY_ID_RESERVED_FROM + "," - + Reservation.PROPERTY_ID_RESERVED_TO + "," - + Reservation.PROPERTY_ID_DESCRIPTION + ")" - + "VALUES (?,?,?,?,?)"; - synchronized (DB_URL) { - if (!isAvailableResource(resourceId, reservedFrom, reservedTo)) { - throw new ResourceNotAvailableException( - "The resource is not available at that time."); - } - try { - PreparedStatement p; - p = connection.prepareStatement(q); - p.setInt(1, resourceId); - p.setString(2, reservedBy); - p.setTimestamp(3, - new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(4, new java.sql.Timestamp(reservedTo.getTime())); - p.setString(5, description); - p.execute(); - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - public boolean isAvailableResource(int resourceId, Date reservedFrom, - Date reservedTo) { - // TODO where deleted=? - if (reservedFrom.after(reservedTo)) { - final Date tmp = reservedTo; - reservedTo = reservedFrom; - reservedFrom = tmp; - } - final String checkQ = "SELECT count(*) FROM " + Reservation.TABLE - + " WHERE " + Reservation.PROPERTY_ID_RESOURCE_ID + "=? AND ((" - + Reservation.PROPERTY_ID_RESERVED_FROM + ">=? AND " - + Reservation.PROPERTY_ID_RESERVED_FROM + "<?) OR (" - + Reservation.PROPERTY_ID_RESERVED_TO + ">? AND " - + Reservation.PROPERTY_ID_RESERVED_TO + "<=?) OR (" - + Reservation.PROPERTY_ID_RESERVED_FROM + "<=? AND " - + Reservation.PROPERTY_ID_RESERVED_TO + ">=?)" + ")"; - try { - final PreparedStatement p = connection.prepareStatement(checkQ); - p.setInt(1, resourceId); - p.setTimestamp(2, new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(3, new java.sql.Timestamp(reservedTo.getTime())); - p.setTimestamp(4, new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(5, new java.sql.Timestamp(reservedTo.getTime())); - p.setTimestamp(6, new java.sql.Timestamp(reservedFrom.getTime())); - p.setTimestamp(7, new java.sql.Timestamp(reservedTo.getTime())); - p.execute(); - final ResultSet rs = p.getResultSet(); - if (rs.next() && rs.getInt(1) > 0) { - return false; - } - } catch (final Exception e) { - throw new RuntimeException(e); - } - return true; - } - - @SuppressWarnings("deprecation") - public synchronized void generateReservations() { - final int days = 30; - final String descriptions[] = { "Picking up guests from airport", - "Sightseeing with the guests", - "Moving new servers from A to B", "Shopping", - "Customer meeting", "Guests arriving at harbour", - "Moving furniture", "Taking guests to see town" }; - final Container cat = getCategories(); - final Collection<?> cIds = cat.getItemIds(); - for (final Iterator<?> it = cIds.iterator(); it.hasNext();) { - final Object id = it.next(); - final Item ci = cat.getItem(id); - final String c = (String) ci.getItemProperty( - Resource.PROPERTY_ID_CATEGORY).getValue(); - final Container resources = getResources(c); - final Collection<?> rIds = resources.getItemIds(); - final Calendar cal = Calendar.getInstance(); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - cal.set(Calendar.MILLISECOND, 0); - final int hourNow = new Date().getHours(); - // cal.add(Calendar.DAY_OF_MONTH, -days); - for (int i = 0; i < days; i++) { - int r = 3; - for (final Iterator<?> rit = rIds.iterator(); rit.hasNext() - && r > 0; r--) { - final Object rid = rit.next(); - final Item resource = resources.getItem(rid); - final int s = hourNow - 6 - + (int) Math.round(Math.random() * 6.0); - final int e = s + 1 + (int) Math.round(Math.random() * 4.0); - final Date start = new Date(cal.getTimeInMillis()); - start.setHours(s); - final Date end = new Date(cal.getTimeInMillis()); - end.setHours(e); - try { - addReservation(resource, "Demo User", start, end, - descriptions[(int) Math.floor(Math.random() - * descriptions.length)]); - } catch (ResourceNotAvailableException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - cal.add(Calendar.DATE, 1); - } - } - - } - - public synchronized void generateResources() { - - final Object[][] resources = { - - { "01", "Portable Video projector 1", "Small,XGA resolution", - "Turku", new Double(60.510857), new Double(22.275424) }, - { "02", "Auditorio", "", "Turku", new Double(60.452171), - new Double(22.2995) }, - { "03", "Meeting room 1", "Projector, WiFi", "Turku", - new Double(60.4507), new Double(22.295551) }, - { "04", "Meeting room 2", "WiFi, Blackboard", "Turku", - new Double(60.434722), new Double(22.224398) }, - { "05", "AV Room", "Cabrio. Keys from infodesk.", "Turku", - new Double(60.508970), new Double(22.264790) }, - { "06", "Video projector", - "Rather heavy, good luminance, WXGA", "Turku", - new Double(60.434722), new Double(22.224398) }, - - }; - - final String q = "INSERT INTO " + Resource.TABLE + "(" - + Resource.PROPERTY_ID_STYLENAME + "," - + Resource.PROPERTY_ID_NAME + "," - + Resource.PROPERTY_ID_DESCRIPTION + "," - + Resource.PROPERTY_ID_CATEGORY + "," - + Resource.PROPERTY_ID_LOCATIONX + "," - + Resource.PROPERTY_ID_LOCATIONY + ")" - + " VALUES (?,?,?,?,?,?)"; - try { - final PreparedStatement stmt = connection.prepareStatement(q); - for (int i = 0; i < resources.length; i++) { - int j = 0; - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setString(j + 1, (String) resources[i][j++]); - stmt.setDouble(j + 1, ((Double) resources[i][j++]) - .doubleValue()); - stmt.setDouble(j + 1, ((Double) resources[i][j++]) - .doubleValue()); - stmt.execute(); - } - } catch (final SQLException e) { - throw new RuntimeException(e); - } - } - - public int addResource(String name, String desc) { - final String q = "INSERT INTO " + Resource.TABLE + " (" - + Resource.PROPERTY_ID_STYLENAME + "," - + Resource.PROPERTY_ID_NAME + "," - + Resource.PROPERTY_ID_DESCRIPTION + "," - + Resource.PROPERTY_ID_CATEGORY + "," - + Resource.PROPERTY_ID_LOCATIONX + "," - + Resource.PROPERTY_ID_LOCATIONY + ")" - + " VALUES (?,?,?,?,?,?)"; - synchronized (DB_URL) { - try { - PreparedStatement p = connection.prepareStatement(q); - p.setString(1, ""); - p.setString(2, name); - p.setString(3, desc); - p.setString(4, "default"); - p.setDouble(5, 0); - p.setDouble(6, 0); - p.execute(); - - Statement createStatement = connection.createStatement(); - ResultSet executeQuery = createStatement - .executeQuery("CALL IDENTITY()"); - executeQuery.next(); - return executeQuery.getInt(1); - - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - return -1; - } - - public void updateResource(Item editedItem, String name, String desc) { - final String q = "UPDATE " + Resource.TABLE + " SET " - + Resource.PROPERTY_ID_NAME + " = ? ," - + Resource.PROPERTY_ID_DESCRIPTION + " = ? " + "WHERE " - + Resource.PROPERTY_ID_ID + " = ?"; - synchronized (DB_URL) { - try { - PreparedStatement p = connection.prepareStatement(q); - p.setString(1, name); - p.setString(2, desc); - p.setInt(3, ((Integer) editedItem.getItemProperty( - Resource.PROPERTY_ID_ID).getValue()).intValue()); - p.execute(); - - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - } -} diff --git a/src/com/vaadin/demo/reservation/simple/SimpleReserver.java b/src/com/vaadin/demo/reservation/simple/SimpleReserver.java deleted file mode 100644 index d2dd8bb45a..0000000000 --- a/src/com/vaadin/demo/reservation/simple/SimpleReserver.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.vaadin.demo.reservation.simple; - -import java.security.Principal; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.PortletMode; -import javax.portlet.RenderRequest; -import javax.portlet.RenderResponse; - -import com.liferay.portal.model.User; -import com.liferay.portal.service.UserServiceUtil; -import com.vaadin.Application; -import com.vaadin.terminal.gwt.server.PortletApplicationContext; -import com.vaadin.terminal.gwt.server.PortletApplicationContext.PortletListener; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * This is a stripped down version of Reservr example. Idea is to create simple, - * but actually usable portal gadget. Example is Liferay spesific (in user - * handling), so you need to add portal-kernel.jar and portal-service.jar files - * to your classpath. - * - */ -@SuppressWarnings("serial") -public class SimpleReserver extends Application { - - private SampleDB db = new SampleDB(); - - private StdView stdView = new StdView(this); - - private AdminView adminView = new AdminView(this); - - private Button toggleMode = new Button("Switch mode"); - - private boolean isAdminView = false; - - private boolean isPortlet; - - protected User user; - - @Override - public void init() { - VerticalLayout rootLayout = new VerticalLayout(); - final Window w = new Window("Simple Reserver", rootLayout); - w.addStyleName("simplereserver"); - - if (getContext() instanceof PortletApplicationContext) { - isPortlet = true; - PortletApplicationContext context = (PortletApplicationContext) getContext(); - context.addPortletListener(this, new PortletListener() { - - public void handleActionRequest(ActionRequest request, - ActionResponse response) { - - } - - public void handleRenderRequest(RenderRequest request, - RenderResponse response) { - // react on mode changes - if ((request.getPortletMode() == PortletMode.EDIT && !isAdminView) - || (request.getPortletMode() == PortletMode.VIEW && isAdminView)) { - toggleMode(); - } - - // save user object to application for later use - Principal userPrincipal = request.getUserPrincipal(); - try { - user = UserServiceUtil.getUserById(Long - .parseLong(userPrincipal.toString())); - } catch (Exception e) { - e.printStackTrace(); - } - - } - }); - w.setTheme("liferay"); - // portal will deal outer margins - rootLayout.setMargin(false); - } else { - w.setTheme("reservr"); - } - - setMainWindow(w); - if (!isPortlet) { - // only use toggle mode button when not in portal - w.addComponent(toggleMode); - toggleMode.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - toggleMode(); - } - }); - } - w.addComponent(stdView); - } - - protected void toggleMode() { - ComponentContainer main = getMainWindow().getContent(); - isAdminView = !isAdminView; - if (isAdminView) { - main.replaceComponent(stdView, adminView); - } else { - main.replaceComponent(adminView, stdView); - stdView.refreshData(); - } - } - - public SampleDB getDb() { - return db; - } - - @Override - public Object getUser() { - if (getContext() instanceof PortletApplicationContext) { - try { - return user.getFirstName() + " " + user.getLastName(); - } catch (Exception e) { - // TODO: handle exception - e.printStackTrace(); - return "Portlet Demouser"; - } - } else { - Object user = super.getUser(); - if (user == null) { - return "Demo User"; - } else { - return user; - } - } - - } -} diff --git a/src/com/vaadin/demo/reservation/simple/StdView.java b/src/com/vaadin/demo/reservation/simple/StdView.java deleted file mode 100644 index 252e668ee5..0000000000 --- a/src/com/vaadin/demo/reservation/simple/StdView.java +++ /dev/null @@ -1,195 +0,0 @@ -package com.vaadin.demo.reservation.simple; - -import java.util.Calendar; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.demo.reservation.CalendarField; -import com.vaadin.demo.reservation.ResourceNotAvailableException; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -@SuppressWarnings("serial") -public class StdView extends VerticalLayout { - - private ComboBox resources = new ComboBox("Select resource"); - private CalendarField reservations = new CalendarField(); - private Button add = new Button("Add reservation"); - private SimpleReserver application; - - private EditorWindow editor = new EditorWindow(); - - StdView(SimpleReserver app) { - setWidth("250px"); - application = app; - - resources.setImmediate(true); - resources.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS); - resources - .setContainerDataSource(application.getDb().getResources(null)); - resources.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY); - resources.setItemCaptionPropertyId(SampleDB.Resource.PROPERTY_ID_NAME); - resources.addListener(new ComboBox.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - refreshReservations(); - } - }); - addComponent(resources); - - initCalendarFieldPropertyIds(reservations); - Calendar c = Calendar.getInstance(); - reservations.setValue(c.getTime()); - reservations.setEnabled(false); - addComponent(reservations); - reservations.setImmediate(true); - - add.setEnabled(false); - addComponent(add); - - add.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (resources.getValue() != null) { - Item i = resources.getItem(resources.getValue()); - editor.newReservationFor(i); - } - } - }); - - add.setDescription("Add new reservation for selected resource"); - - } - - private static void initCalendarFieldPropertyIds(CalendarField cal) { - cal.setItemStyleNamePropertyId(SampleDB.Resource.PROPERTY_ID_STYLENAME); - cal - .setItemStartPropertyId(SampleDB.Reservation.PROPERTY_ID_RESERVED_FROM); - cal.setItemEndPropertyId(SampleDB.Reservation.PROPERTY_ID_RESERVED_TO); - cal - .setItemTitlePropertyId(SampleDB.Reservation.PROPERTY_ID_RESERVED_BY); - cal - .setItemDescriptionPropertyId(SampleDB.Reservation.PROPERTY_ID_DESCRIPTION); - } - - private void refreshReservations() { - if (resources.getValue() == null) { - reservations.setContainerDataSource(null); - add.setEnabled(false); - reservations.setEnabled(false); - } else { - List<Item> resource = new LinkedList<Item>(); - resource.add(resources.getItem(resources.getValue())); - final Container res = application.getDb().getReservations(resource); - reservations.setContainerDataSource(res); - add.setEnabled(true); - reservations.setEnabled(true); - } - } - - public class EditorWindow extends Window { - - Label resourceName = new Label(); - - DateField start = new DateField("From:"); - DateField end = new DateField("To:"); - TextField desc = new TextField("Description:"); - Button save = new Button("Save"); - - private Item res; - - private Calendar cal; - - EditorWindow() { - super("Add reservation"); - - cal = Calendar.getInstance(); - - addComponent(resourceName); - - start.setResolution(DateField.RESOLUTION_MIN); - start.setImmediate(true); - start.setValue(new Date()); - start.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Date startTime = (Date) start.getValue(); - Date endTime = (Date) end.getValue(); - if (endTime.before(startTime)) { - cal.setTime(startTime); - cal.add(Calendar.HOUR_OF_DAY, 1); - end.setValue(cal.getTime()); - } - } - }); - addComponent(start); - - end.setResolution(DateField.RESOLUTION_MIN); - end.setImmediate(true); - end.setValue(new Date()); - end.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Date startTime = (Date) start.getValue(); - Date endTime = (Date) end.getValue(); - if (endTime.before(startTime)) { - cal.setTime(endTime); - cal.add(Calendar.HOUR, -1); - start.setValue(cal.getTime()); - } - } - }); - addComponent(end); - addComponent(desc); - addComponent(save); - save.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - try { - application.getDb().addReservation(res, - application.getUser().toString(), - (Date) start.getValue(), (Date) end.getValue(), - (String) desc.getValue()); - EditorWindow.this.close(); - refreshReservations(); - } catch (ResourceNotAvailableException e) { - getWindow() - .showNotification( - "Resource is not available at that time " - + "or is too close to another reservation."); - } - } - }); - } - - public void newReservationFor(Item resource) { - res = resource; - resourceName.setValue("Resourse: " - + res.getItemProperty(SampleDB.Resource.PROPERTY_ID_NAME) - .getValue()); - - cal.setTime((Date) reservations.getValue()); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.MILLISECOND, 0); - cal.set(Calendar.SECOND, 0); - start.setValue(cal.getTime()); - cal.add(Calendar.HOUR_OF_DAY, 1); - end.setValue(cal.getTime()); - StdView.this.getWindow().addWindow(this); - } - } - - public void refreshData() { - resources - .setContainerDataSource(application.getDb().getResources(null)); - refreshReservations(); - - } -} diff --git a/src/com/vaadin/demo/sampler/APIResource.java b/src/com/vaadin/demo/sampler/APIResource.java deleted file mode 100644 index 76719f48ab..0000000000 --- a/src/com/vaadin/demo/sampler/APIResource.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.demo.sampler; - -/** - * A NamedExternalResource pointing to the javadoc for the given class. Knows - * where the javadocs are located for some common APIs, but one can also specify - * a javadoc baseurl. The name will be set to the class simpleName. - * - */ -@SuppressWarnings("serial") -public class APIResource extends NamedExternalResource { - - private static final String VAADIN_BASE = "http://www.vaadin.com/api"; - private static final String JAVA_BASE = "http://java.sun.com/javase/6/docs/api/"; - private static final String SERVLET_BASE = "http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2"; - private static final String PORTLET_BASE = "http://developers.sun.com/docs/jscreator/apis/portlet"; - - public APIResource(Class<?> clazz) { - this(resolveBaseUrl(clazz), clazz); - } - - public APIResource(String baseUrl, Class<?> clazz) { - super(resolveName(clazz), getJavadocUrl(baseUrl, clazz)); - } - - private static String getJavadocUrl(String baseUrl, Class<?> clazz) { - if (!baseUrl.endsWith("/")) { - baseUrl += "/"; - } - String path = clazz.getName().replaceAll("\\.", "/"); - path = path.replaceAll("\\$", "."); - return baseUrl + path + ".html"; - } - - /** - * Tries to resolve the javadoc baseurl for the given class by looking at - * the packagename. - * - * @param clazz - * @return - */ - private static String resolveBaseUrl(Class<?> clazz) { - String name = clazz.getName(); - if (name.startsWith("javax.servlet.")) { - return SERVLET_BASE; - } else if (name.startsWith("javax.portlet.")) { - return PORTLET_BASE; - } else if (name.startsWith("java.") || name.startsWith("javax.")) { - return JAVA_BASE; - } - return VAADIN_BASE; - } - - private static String resolveName(Class<?> clazz) { - Class<?> ec = clazz.getEnclosingClass(); - return (ec != null ? ec.getSimpleName() + "." : "") - + clazz.getSimpleName(); - } -} diff --git a/src/com/vaadin/demo/sampler/ActiveLink.java b/src/com/vaadin/demo/sampler/ActiveLink.java deleted file mode 100644 index b92e8371a7..0000000000 --- a/src/com/vaadin/demo/sampler/ActiveLink.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.io.Serializable; -import java.lang.reflect.Method; -import java.util.HashSet; -import java.util.Map; - -import com.vaadin.demo.sampler.gwt.client.ui.VActiveLink; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.ui.ClientWidget; -import com.vaadin.ui.Component; -import com.vaadin.ui.Link; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -@ClientWidget(VActiveLink.class) -public class ActiveLink extends Link { - - private static final String TAG = "activelink"; - - private static final Method LINK_FOLLOWED_METHOD; - - private HashSet<LinkActivatedListener> listeners = new HashSet<LinkActivatedListener>(); - - public ActiveLink() { - super(); - } - - public ActiveLink(String caption, Resource resource, String targetName, - int width, int height, int border) { - super(caption, resource, targetName, width, height, border); - } - - public ActiveLink(String caption, Resource resource) { - super(caption, resource); - } - - static { - try { - LINK_FOLLOWED_METHOD = LinkActivatedListener.class - .getDeclaredMethod("linkActivated", - new Class[] { LinkActivatedEvent.class }); - } catch (final java.lang.NoSuchMethodException e) { - // This should never happen - throw new java.lang.RuntimeException( - "Internal error finding methods in ActiveLink"); - } - } - - /** - * Adds the link activated listener. - * - * @param listener - * the Listener to be added. - */ - public void addListener(LinkActivatedListener listener) { - listeners.add(listener); - addListener(LinkActivatedEvent.class, listener, LINK_FOLLOWED_METHOD); - if (listeners.size() == 1) { - requestRepaint(); - } - } - - /** - * Removes the link activated listener. - * - * @param listener - * the Listener to be removed. - */ - public void removeListener(LinkActivatedListener listener) { - listeners.remove(listener); - removeListener(ClickEvent.class, listener, LINK_FOLLOWED_METHOD); - if (listeners.size() == 0) { - requestRepaint(); - } - } - - /** - * Emits the options change event. - */ - protected void fireClick(boolean linkOpened) { - fireEvent(new LinkActivatedEvent(this, linkOpened)); - } - - @Override - public void paintContent(PaintTarget target) throws PaintException { - super.paintContent(target); - - if (listeners.size() > 0) { - target.addVariable(this, "activated", false); - target.addVariable(this, "opened", false); - } - } - - @SuppressWarnings("unchecked") - @Override - public void changeVariables(Object source, Map variables) { - super.changeVariables(source, variables); - if (!isReadOnly() && variables.containsKey("activated")) { - final Boolean activated = (Boolean) variables.get("activated"); - final Boolean opened = (Boolean) variables.get("opened"); - if (activated != null && activated.booleanValue() && !isReadOnly()) { - fireClick((opened != null && opened.booleanValue() ? true - : false)); - } - } - } - - public class LinkActivatedEvent extends Component.Event { - - private boolean linkOpened; - - /** - * New instance of text change event. - * - * @param source - * the Source of the event. - */ - public LinkActivatedEvent(Component source, boolean linkOpened) { - super(source); - this.linkOpened = linkOpened; - } - - /** - * Gets the ActiveLink where the event occurred. - * - * @return the Source of the event. - */ - public ActiveLink getActiveLink() { - return (ActiveLink) getSource(); - } - - /** - * Indicates whether or not the link was opened on the client, i.e in a - * new window/tab. If the link was not opened, the listener should react - * to the event and "do something", otherwise the link does nothing. - * - * @return true if the link was opened on the client - */ - public boolean isLinkOpened() { - return linkOpened; - } - } - - /** - * ActiveLink click listener - */ - public interface LinkActivatedListener extends Serializable { - - /** - * ActiveLink has been activated. - * - * @param event - * ActiveLink click event. - */ - public void linkActivated(LinkActivatedEvent event); - - } - -} diff --git a/src/com/vaadin/demo/sampler/CodeLabel.java b/src/com/vaadin/demo/sampler/CodeLabel.java deleted file mode 100644 index a135c230c0..0000000000 --- a/src/com/vaadin/demo/sampler/CodeLabel.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.demo.sampler; - -import com.vaadin.demo.sampler.gwt.client.ui.VCodeLabel; -import com.vaadin.ui.ClientWidget; -import com.vaadin.ui.Label; - -@ClientWidget(VCodeLabel.class) -@SuppressWarnings("serial") -public class CodeLabel extends Label { - - private static final String TAG = "codelabel"; - - public CodeLabel() { - setContentMode(CONTENT_PREFORMATTED); - } - - public CodeLabel(String content) { - super(content, CONTENT_PREFORMATTED); - } - - @Override - public void setContentMode(int contentMode) { - if (contentMode != CONTENT_PREFORMATTED) { - throw new UnsupportedOperationException( - "Only preformatted content supported"); - } - super.setContentMode(CONTENT_PREFORMATTED); - } - -} diff --git a/src/com/vaadin/demo/sampler/ExampleUtil.java b/src/com/vaadin/demo/sampler/ExampleUtil.java deleted file mode 100644 index 411e7d77eb..0000000000 --- a/src/com/vaadin/demo/sampler/ExampleUtil.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.util.Locale; -import java.util.Random; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; - -public final class ExampleUtil { - public static final String lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ut massa eget erat dapibus sollicitudin. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a augue. Praesent non elit. Duis sapien dolor, cursus eget, pulvinar eget, eleifend a, est. Integer in nunc. Vivamus consequat ipsum id sapien. Duis eu elit vel libero posuere luctus. Aliquam ac turpis. Aenean vitae justo in sem iaculis pulvinar. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam sit amet mi. " - + "<br/>" - + "Aenean auctor, mi sit amet ultricies pulvinar, dui urna adipiscing odio, ut faucibus odio mauris eget justo. Mauris quis magna quis augue interdum porttitor. Sed interdum, tortor laoreet tincidunt ullamcorper, metus velit hendrerit nunc, id laoreet mauris arcu vitae est. Nulla nec nisl. Mauris orci nibh, tempor nec, sollicitudin ac, venenatis sed, lorem. Quisque dignissim tempus erat. Maecenas molestie, pede ac ultrices interdum, felis neque vulputate quam, in sodales felis odio quis mi. Aliquam massa pede, pharetra quis, tincidunt quis, fringilla at, mauris. Vestibulum a massa. Vestibulum luctus odio ut quam. Maecenas congue convallis diam. Cras urna arcu, vestibulum vitae, blandit ut, laoreet id, risus. Ut condimentum, arcu sit amet placerat blandit, augue nibh pretium nunc, in tempus sem dolor non leo. Etiam fringilla mauris a odio. Nunc lorem diam, interdum eget, lacinia in, scelerisque sit amet, purus. Nam ornare. " - + "<br/>" - + "Donec placerat dui ut orci. Phasellus quis lacus at nisl elementum cursus. Cras bibendum egestas nulla. Phasellus pulvinar ullamcorper odio. Etiam ipsum. Proin tincidunt. Aliquam aliquet. Etiam purus odio, commodo sed, feugiat volutpat, scelerisque molestie, velit. Aenean sed sem sit amet libero sodales ultrices. Donec dictum, arcu sed iaculis porttitor, est mauris pulvinar purus, sit amet porta purus neque in risus. Mauris libero. Maecenas rhoncus. Morbi quis nisl. " - + "<br/>" - + "Vestibulum laoreet tortor eu elit. Cras euismod nulla eu sapien. Sed imperdiet. Maecenas vel sapien. Nulla at purus eu diam auctor lobortis. Donec pede eros, lacinia tincidunt, tempus eu, molestie nec, velit. Nullam ipsum odio, euismod non, aliquet nec, consequat ac, felis. Duis fermentum mauris sed justo. Suspendisse potenti. Praesent at libero sit amet ipsum imperdiet fermentum. Aliquam enim nisl, dictum id, lacinia sit amet, elementum posuere, ipsum. Integer luctus dictum libero. Pellentesque sed pede sed nisl bibendum porttitor. Phasellus tempor interdum nisi. Mauris nec magna. Phasellus massa pede, vehicula sed, ornare at, ullamcorper ut, nisl. Sed turpis nisl, hendrerit sit amet, consequat id, auctor nec, arcu. Quisque fringilla tincidunt massa. In eleifend, nulla sed mollis vestibulum, mauris orci facilisis ante, id pharetra dolor ipsum vitae sem. Integer dictum. " - + "<br/>" - + "Nunc ut odio. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mauris tellus, dapibus vel, hendrerit vel, sollicitudin ut, ligula. Ut justo metus, accumsan placerat, ultrices sit amet, congue at, nulla. Integer in quam. Cras sollicitudin mattis magna. Vestibulum neque eros, egestas ut, tincidunt vel, ullamcorper non, ligula. Vivamus eu lacus. Donec rhoncus metus et odio. Donec est. Nulla facilisi. Suspendisse potenti. Etiam tempor pede nec ante. Vestibulum adipiscing velit vel neque. " - + "<br/>" - + "Quisque ornare erat rhoncus lectus. Donec vitae ante at enim mollis egestas. Mauris convallis. Fusce convallis, nisl eu sagittis suscipit, risus ligula aliquam libero, in imperdiet neque mi non risus. Aenean dictum ultricies risus. Praesent ut ligula vitae purus ornare auctor. Cras tellus mauris, adipiscing ac, dignissim auctor, faucibus in, sem. Cras mauris libero, pharetra sit amet, lacinia eu, vehicula eleifend, sapien. Donec ac tellus. Sed eros dui, vulputate vel, auctor pharetra, tincidunt at, ipsum. Duis at dolor ac leo condimentum pulvinar. Donec molestie, dolor et fringilla elementum, nibh nibh iaculis orci, eu elementum odio turpis et odio. Phasellus fermentum, justo id placerat egestas, arcu nunc molestie ante, non imperdiet ligula lectus sed erat. Quisque sed ligula. Sed ac nulla. Nullam massa. " - + "<br/>" - + "Sed a purus. Mauris non nibh blandit neque cursus scelerisque. Quisque ultrices sem nec dolor. Donec non diam ut dui consequat venenatis. Nullam risus massa, egestas in, facilisis tristique, molestie sed, mi. Duis euismod turpis sit amet quam. Vestibulum ornare felis eget dolor. Phasellus ac urna vel sapien lacinia adipiscing. Donec egestas felis id mi. Sed erat. Vestibulum porta vulputate neque. Maecenas scelerisque, sem id sodales pretium, sem mauris rhoncus magna, at scelerisque tortor mauris nec dui. Nullam blandit rhoncus velit. Nam accumsan, enim id vestibulum feugiat, lorem nibh placerat urna, eget laoreet diam tortor at lorem. Suspendisse imperdiet consectetur dolor. "; - private static final String[] iso3166 = new String[] { "AFGHANISTAN", "AF", - "ÅLAND ISLANDS", "AX", "ALBANIA", "AL", "ALGERIA", "DZ", - "AMERICAN SAMOA", "AS", "ANDORRA", "AD", "ANGOLA", "AO", - "ANGUILLA", "AI", "ANTARCTICA", "AQ", "ANTIGUA AND BARBUDA", "AG", - "ARGENTINA", "AR", "ARMENIA", "AM", "ARUBA", "AW", "AUSTRALIA", - "AU", "AUSTRIA", "AT", "AZERBAIJAN", "AZ", "BAHAMAS", "BS", - "BAHRAIN", "BH", "BANGLADESH", "BD", "BARBADOS", "BB", "BELARUS", - "BY", "BELGIUM", "BE", "BELIZE", "BZ", "BENIN", "BJ", "BERMUDA", - "BM", "BHUTAN", "BT", "BOLIVIA", "BO", "BOSNIA AND HERZEGOVINA", - "BA", "BOTSWANA", "BW", "BOUVET ISLAND", "BV", "BRAZIL", "BR", - "BRITISH INDIAN OCEAN TERRITORY", "IO", "BRUNEI DARUSSALAM", "BN", - "BULGARIA", "BG", "BURKINA FASO", "BF", "BURUNDI", "BI", - "CAMBODIA", "KH", "CAMEROON", "CM", "CANADA", "CA", "CAPE VERDE", - "CV", "CAYMAN ISLANDS", "KY", "CENTRAL AFRICAN REPUBLIC", "CF", - "CHAD", "TD", "CHILE", "CL", "CHINA", "CN", "CHRISTMAS ISLAND", - "CX", "COCOS (KEELING) ISLANDS", "CC", "COLOMBIA", "CO", "COMOROS", - "KM", "CONGO", "CG", "CONGO, THE DEMOCRATIC REPUBLIC OF THE", "CD", - "COOK ISLANDS", "CK", "COSTA RICA", "CR", "CÔTE D'IVOIRE", "CI", - "CROATIA", "HR", "CUBA", "CU", "CYPRUS", "CY", "CZECH REPUBLIC", - "CZ", "DENMARK", "DK", "DJIBOUTI", "DJ", "DOMINICA", "DM", - "DOMINICAN REPUBLIC", "DO", "ECUADOR", "EC", "EGYPT", "EG", - "EL SALVADOR", "SV", "EQUATORIAL GUINEA", "GQ", "ERITREA", "ER", - "ESTONIA", "EE", "ETHIOPIA", "ET", "FALKLAND ISLANDS (MALVINAS)", - "FK", "FAROE ISLANDS", "FO", "FIJI", "FJ", "FINLAND", "FI", - "FRANCE", "FR", "FRENCH GUIANA", "GF", "FRENCH POLYNESIA", "PF", - "FRENCH SOUTHERN TERRITORIES", "TF", "GABON", "GA", "GAMBIA", "GM", - "GEORGIA", "GE", "GERMANY", "DE", "GHANA", "GH", "GIBRALTAR", "GI", - "GREECE", "GR", "GREENLAND", "GL", "GRENADA", "GD", "GUADELOUPE", - "GP", "GUAM", "GU", "GUATEMALA", "GT", "GUERNSEY", "GG", "GUINEA", - "GN", "GUINEA-BISSAU", "GW", "GUYANA", "GY", "HAITI", "HT", - "HEARD ISLAND AND MCDONALD ISLANDS", "HM", - "HOLY SEE (VATICAN CITY STATE)", "VA", "HONDURAS", "HN", - "HONG KONG", "HK", "HUNGARY", "HU", "ICELAND", "IS", "INDIA", "IN", - "INDONESIA", "ID", "IRAN, ISLAMIC REPUBLIC OF", "IR", "IRAQ", "IQ", - "IRELAND", "IE", "ISLE OF MAN", "IM", "ISRAEL", "IL", "ITALY", - "IT", "JAMAICA", "JM", "JAPAN", "JP", "JERSEY", "JE", "JORDAN", - "JO", "KAZAKHSTAN", "KZ", "KENYA", "KE", "KIRIBATI", "KI", - "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF", "KP", - "KOREA, REPUBLIC OF", "KR", "KUWAIT", "KW", "KYRGYZSTAN", "KG", - "LAO PEOPLE'S DEMOCRATIC REPUBLIC", "LA", "LATVIA", "LV", - "LEBANON", "LB", "LESOTHO", "LS", "LIBERIA", "LR", - "LIBYAN ARAB JAMAHIRIYA", "LY", "LIECHTENSTEIN", "LI", "LITHUANIA", - "LT", "LUXEMBOURG", "LU", "MACAO", "MO", - "MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF", "MK", "MADAGASCAR", - "MG", "MALAWI", "MW", "MALAYSIA", "MY", "MALDIVES", "MV", "MALI", - "ML", "MALTA", "MT", "MARSHALL ISLANDS", "MH", "MARTINIQUE", "MQ", - "MAURITANIA", "MR", "MAURITIUS", "MU", "MAYOTTE", "YT", "MEXICO", - "MX", "MICRONESIA, FEDERATED STATES OF", "FM", - "MOLDOVA, REPUBLIC OF", "MD", "MONACO", "MC", "MONGOLIA", "MN", - "MONTENEGRO", "ME", "MONTSERRAT", "MS", "MOROCCO", "MA", - "MOZAMBIQUE", "MZ", "MYANMAR", "MM", "NAMIBIA", "NA", "NAURU", - "NR", "NEPAL", "NP", "NETHERLANDS", "NL", "NETHERLANDS ANTILLES", - "AN", "NEW CALEDONIA", "NC", "NEW ZEALAND", "NZ", "NICARAGUA", - "NI", "NIGER", "NE", "NIGERIA", "NG", "NIUE", "NU", - "NORFOLK ISLAND", "NF", "NORTHERN MARIANA ISLANDS", "MP", "NORWAY", - "NO", "OMAN", "OM", "PAKISTAN", "PK", "PALAU", "PW", - "PALESTINIAN TERRITORY, OCCUPIED", "PS", "PANAMA", "PA", - "PAPUA NEW GUINEA", "PG", "PARAGUAY", "PY", "PERU", "PE", - "PHILIPPINES", "PH", "PITCAIRN", "PN", "POLAND", "PL", "PORTUGAL", - "PT", "PUERTO RICO", "PR", "QATAR", "QA", "REUNION", "RE", - "ROMANIA", "RO", "RUSSIAN FEDERATION", "RU", "RWANDA", "RW", - "SAINT BARTHÉLEMY", "BL", "SAINT HELENA", "SH", - "SAINT KITTS AND NEVIS", "KN", "SAINT LUCIA", "LC", "SAINT MARTIN", - "MF", "SAINT PIERRE AND MIQUELON", "PM", - "SAINT VINCENT AND THE GRENADINES", "VC", "SAMOA", "WS", - "SAN MARINO", "SM", "SAO TOME AND PRINCIPE", "ST", "SAUDI ARABIA", - "SA", "SENEGAL", "SN", "SERBIA", "RS", "SEYCHELLES", "SC", - "SIERRA LEONE", "SL", "SINGAPORE", "SG", "SLOVAKIA", "SK", - "SLOVENIA", "SI", "SOLOMON ISLANDS", "SB", "SOMALIA", "SO", - "SOUTH AFRICA", "ZA", - "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS", "GS", "SPAIN", - "ES", "SRI LANKA", "LK", "SUDAN", "SD", "SURINAME", "SR", - "SVALBARD AND JAN MAYEN", "SJ", "SWAZILAND", "SZ", "SWEDEN", "SE", - "SWITZERLAND", "CH", "SYRIAN ARAB REPUBLIC", "SY", - "TAIWAN, PROVINCE OF CHINA", "TW", "TAJIKISTAN", "TJ", - "TANZANIA, UNITED REPUBLIC OF", "TZ", "THAILAND", "TH", - "TIMOR-LESTE", "TL", "TOGO", "TG", "TOKELAU", "TK", "TONGA", "TO", - "TRINIDAD AND TOBAGO", "TT", "TUNISIA", "TN", "TURKEY", "TR", - "TURKMENISTAN", "TM", "TURKS AND CAICOS ISLANDS", "TC", "TUVALU", - "TV", "UGANDA", "UG", "UKRAINE", "UA", "UNITED ARAB EMIRATES", - "AE", "UNITED KINGDOM", "GB", "UNITED STATES", "US", - "UNITED STATES MINOR OUTLYING ISLANDS", "UM", "URUGUAY", "UY", - "UZBEKISTAN", "UZ", "VANUATU", "VU", "VENEZUELA", "VE", "VIET NAM", - "VN", "VIRGIN ISLANDS, BRITISH", "VG", "VIRGIN ISLANDS, U.S.", - "VI", "WALLIS AND FUTUNA", "WF", "WESTERN SAHARA", "EH", "YEMEN", - "YE", "ZAMBIA", "ZM", "ZIMBABWE", "ZW" }; - public static final Object iso3166_PROPERTY_NAME = "name"; - public static final Object iso3166_PROPERTY_SHORT = "short"; - public static final Object iso3166_PROPERTY_FLAG = "flag"; - public static final Object hw_PROPERTY_NAME = "name"; - - public static final Object locale_PROPERTY_LOCALE = "locale"; - public static final Object locale_PROPERTY_NAME = "name"; - private static final String[][] locales = { { "fi", "FI", "Finnish" }, - { "de", "DE", "German" }, { "en", "US", "US - English" }, - { "sv", "SE", "Swedish" } }; - private static final String[][] hardware = { // - { "Desktops", "Dell OptiPlex GX240", "Dell OptiPlex GX260", - "Dell OptiPlex GX280" }, - { "Monitors", "Benq T190HD", "Benq T220HD", "Benq T240HD" }, - { "Laptops", "IBM ThinkPad T40", "IBM ThinkPad T43", - "IBM ThinkPad T60" } }; - - public static final Object PERSON_PROPERTY_FIRSTNAME = "First Name"; - public static final Object PERSON_PROPERTY_LASTNAME = "Last Name"; - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Robert", "Paula", - "Lenny", "Kenny", "Nathan", "Nicole", "Laura", "Jos", "Josie", - "Linus" }; - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Adams", "Black", "Wilson", "Richards", "Thompson", - "McGoff", "Halas", "Jones", "Beck", "Sheridan", "Picard", "Hill", - "Fielding", "Einstein" }; - - public static IndexedContainer getPersonContainer() { - IndexedContainer contactContainer = new IndexedContainer(); - contactContainer.addContainerProperty(PERSON_PROPERTY_FIRSTNAME, - String.class, ""); - contactContainer.addContainerProperty(PERSON_PROPERTY_LASTNAME, - String.class, ""); - - Random r = new Random(5); - for (int i = 0; i < 50;) { - String fn = firstnames[(int) (r.nextDouble() * firstnames.length)]; - String ln = lastnames[(int) (r.nextDouble() * lastnames.length)]; - String id = fn + ln; - Item item = contactContainer.addItem(id); - if (item != null) { - i++; - item.getItemProperty(PERSON_PROPERTY_FIRSTNAME).setValue(fn); - item.getItemProperty(PERSON_PROPERTY_LASTNAME).setValue(ln); - } - } - return contactContainer; - } - - public static IndexedContainer getLocaleContainer() { - IndexedContainer localeContainer = new IndexedContainer(); - localeContainer.addContainerProperty(locale_PROPERTY_LOCALE, - Locale.class, null); - localeContainer.addContainerProperty(locale_PROPERTY_NAME, - String.class, null); - for (int i = 0; i < locales.length; i++) { - String id = locales[i][2]; - Item item = localeContainer.addItem(id); - item.getItemProperty(locale_PROPERTY_LOCALE).setValue( - new Locale(locales[i][0], locales[i][1])); - item.getItemProperty(locale_PROPERTY_NAME).setValue(locales[i][2]); - } - - return localeContainer; - } - - @Deprecated - public static IndexedContainer getStaticISO3166Container() { - return getISO3166Container(); - } - - public static IndexedContainer getISO3166Container() { - IndexedContainer c = new IndexedContainer(); - fillIso3166Container(c); - return c; - } - - private static void fillIso3166Container(IndexedContainer container) { - container.addContainerProperty(iso3166_PROPERTY_NAME, String.class, - null); - container.addContainerProperty(iso3166_PROPERTY_SHORT, String.class, - null); - container.addContainerProperty(iso3166_PROPERTY_FLAG, Resource.class, - null); - for (int i = 0; i < iso3166.length; i++) { - String name = iso3166[i++]; - String id = iso3166[i]; - Item item = container.addItem(id); - item.getItemProperty(iso3166_PROPERTY_NAME).setValue(name); - item.getItemProperty(iso3166_PROPERTY_SHORT).setValue(id); - item.getItemProperty(iso3166_PROPERTY_FLAG).setValue( - new ThemeResource("../sampler/flags/" + id.toLowerCase() - + ".gif")); - } - container.sort(new Object[] { iso3166_PROPERTY_NAME }, - new boolean[] { true }); - } - - public static HierarchicalContainer getHardwareContainer() { - Item item = null; - int itemId = 0; // Increasing numbering for itemId:s - - // Create new container - HierarchicalContainer hwContainer = new HierarchicalContainer(); - // Create containerproperty for name - hwContainer.addContainerProperty(hw_PROPERTY_NAME, String.class, null); - for (int i = 0; i < hardware.length; i++) { - // Add new item - item = hwContainer.addItem(itemId); - // Add name property for item - item.getItemProperty(hw_PROPERTY_NAME).setValue(hardware[i][0]); - // Allow children - hwContainer.setChildrenAllowed(itemId, true); - itemId++; - for (int j = 1; j < hardware[i].length; j++) { - // Add child items - item = hwContainer.addItem(itemId); - item.getItemProperty(hw_PROPERTY_NAME).setValue(hardware[i][j]); - hwContainer.setParent(itemId, itemId - j); - hwContainer.setChildrenAllowed(itemId, false); - itemId++; - } - } - return hwContainer; - } - - public static void fillContainerWithEmailAddresses(Container c, int amount) { - for (int i = 0; i < amount; i++) { - // TODO - } - } - -} diff --git a/src/com/vaadin/demo/sampler/Feature.java b/src/com/vaadin/demo/sampler/Feature.java deleted file mode 100644 index 45ce902ecd..0000000000 --- a/src/com/vaadin/demo/sampler/Feature.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Serializable; - -import com.vaadin.ui.Component; - -/** - * Represents one feature or sample, with associated example. - * <p> - * - * </p> - * - */ -@SuppressWarnings("serial") -abstract public class Feature implements Serializable { - - public static final Object PROPERTY_ICON = "Icon"; - public static final Object PROPERTY_NAME = "Name"; - public static final Object PROPERTY_DESCRIPTION = "Description"; - - private static final String MSG_SOURCE_NOT_AVAILABLE = "I'm terribly sorry," - + " but it seems the source could not be found.\n" - + "Please try adding the source folder to the classpath for your" - + " server, or tell the administrator to do so!"; - - private static final Object MUTEX = new Object(); - private String javaSource = null; - - /** - * Gets the name of this feature. Try not to exceed 25 characters too much. - * - * @return - */ - abstract public String getName(); - - /** - * Gets the description for this feature. Should describe what the example - * intends to showcase. May contain HTML. 100 words should be enough, and - * about 7 rows... - * - * @return the description - */ - abstract public String getDescription(); - - /** - * Gets related resources, i.e links to resources related to the example. - * <p> - * Good candidates are resources used to make the example (CSS, images, - * custom layouts), documentation links (reference manual), articles (e.g. - * pattern description, usability discussion). - * </p> - * <p> - * May return null, if the example has no related resources. - * </p> - * <p> - * The name of the NamedExternalResource will be shown in the UI. <br/> - * Note that Javadoc should be referenced via {@link #getRelatedAPI()}. - * </p> - * - * @see #getThemeBase() - * @return related external stuff - */ - abstract public NamedExternalResource[] getRelatedResources(); - - /** - * Gets related API resources, i.e links to javadoc of used classes. - * <p> - * Good candidates are Vaadin classes being demoed in the example, or other - * classes playing an important role in the example. - * </p> - * <p> - * May return null, if the example uses no interesting classes. - * <p> - * - * @return - */ - abstract public APIResource[] getRelatedAPI(); - - /** - * Gets related Features; the classes returned should extend Feature. - * <p> - * Good candidates are Features similar to this one, Features using the - * functionality demoed in this one, and Features being used in this one. - * </p> - * <p> - * May return null, if no other Features are related to this one. - * <p> - * - * @return - */ - abstract public Class<? extends Feature>[] getRelatedFeatures(); - - /** - * Gets the name of the icon for this feature, usually simpleName + - * extension. - * - * @return - */ - public String getIconName() { - String icon = getClass().getSimpleName() + ".png"; - return icon; - } - - /** - * Get the example instance. Override if instantiation needs parameters. - * - * @return - */ - public Component getExample() { - - String className = this.getClass().getName() + "Example"; - try { - Class<?> classObject = getClass().getClassLoader().loadClass( - className); - return (Component) classObject.newInstance(); - } catch (ClassNotFoundException e) { - return null; - } catch (InstantiationException e) { - return null; - } catch (IllegalAccessException e) { - return null; - } - - } - - public String getSource() { - synchronized (MUTEX) { - if (javaSource == null) { - StringBuffer src = new StringBuffer(); - try { - /* - * Use package name + class name so the class loader won't - * have to guess the package name. - */ - String resourceName = "/" - + getExample().getClass().getName().replace('.', - '/') + ".java"; - InputStream is = getClass().getResourceAsStream( - resourceName); - BufferedReader bis = new BufferedReader( - new InputStreamReader(is)); - for (String line = bis.readLine(); null != line; line = bis - .readLine()) { - src.append(line); - src.append("\n"); - } - javaSource = src.toString(); - } catch (Exception e) { - System.err.println(MSG_SOURCE_NOT_AVAILABLE + " (" - + getPathName() + ")"); - javaSource = MSG_SOURCE_NOT_AVAILABLE; - } - } - } - return javaSource; - - } - - public String getSourceHTML() { - return getSource(); - } - - /** - * Gets the name used when resolving the path for this feature. Usually no - * need to override. - * - * @return - */ - public String getPathName() { - return getClass().getSimpleName(); - } - - /** - * Gets the base url used to reference theme resources. - * - * @return - */ - protected static final String getThemeBase() { - return SamplerApplication.getThemeBase(); - } - - @Override - public String toString() { - return getName(); - } - - @Override - public boolean equals(Object obj) { - // A feature is uniquely identified by its class name - if (obj == null) { - return false; - } - return obj.getClass() == getClass(); - } - - @Override - public int hashCode() { - // A feature is uniquely identified by its class name - return getClass().hashCode(); - } -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/FeatureSet.java b/src/com/vaadin/demo/sampler/FeatureSet.java deleted file mode 100644 index 2766b63d8d..0000000000 --- a/src/com/vaadin/demo/sampler/FeatureSet.java +++ /dev/null @@ -1,563 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.util.Collections; -import java.util.LinkedList; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.demo.sampler.features.accordions.AccordionDisabled; -import com.vaadin.demo.sampler.features.accordions.AccordionIcons; -import com.vaadin.demo.sampler.features.blueprints.ProminentPrimaryAction; -import com.vaadin.demo.sampler.features.buttons.ButtonLink; -import com.vaadin.demo.sampler.features.buttons.ButtonPush; -import com.vaadin.demo.sampler.features.buttons.ButtonSwitch; -import com.vaadin.demo.sampler.features.commons.Errors; -import com.vaadin.demo.sampler.features.commons.Icons; -import com.vaadin.demo.sampler.features.commons.Tooltips; -import com.vaadin.demo.sampler.features.commons.Validation; -import com.vaadin.demo.sampler.features.dates.DateInline; -import com.vaadin.demo.sampler.features.dates.DateLocale; -import com.vaadin.demo.sampler.features.dates.DatePopup; -import com.vaadin.demo.sampler.features.dates.DateResolution; -import com.vaadin.demo.sampler.features.form.FormBasic; -import com.vaadin.demo.sampler.features.layouts.ApplicationLayout; -import com.vaadin.demo.sampler.features.layouts.CssLayouts; -import com.vaadin.demo.sampler.features.layouts.CustomLayouts; -import com.vaadin.demo.sampler.features.layouts.ExpandingComponent; -import com.vaadin.demo.sampler.features.layouts.GridLayoutBasic; -import com.vaadin.demo.sampler.features.layouts.HorizontalLayoutBasic; -import com.vaadin.demo.sampler.features.layouts.LayoutAlignment; -import com.vaadin.demo.sampler.features.layouts.LayoutMargin; -import com.vaadin.demo.sampler.features.layouts.LayoutSpacing; -import com.vaadin.demo.sampler.features.layouts.SplitPanelBasic; -import com.vaadin.demo.sampler.features.layouts.VerticalLayoutBasic; -import com.vaadin.demo.sampler.features.layouts.WebLayout; -import com.vaadin.demo.sampler.features.link.LinkCurrentWindow; -import com.vaadin.demo.sampler.features.link.LinkNoDecorations; -import com.vaadin.demo.sampler.features.link.LinkSizedWindow; -import com.vaadin.demo.sampler.features.notifications.NotificationCustom; -import com.vaadin.demo.sampler.features.notifications.NotificationError; -import com.vaadin.demo.sampler.features.notifications.NotificationHumanized; -import com.vaadin.demo.sampler.features.notifications.NotificationTray; -import com.vaadin.demo.sampler.features.notifications.NotificationWarning; -import com.vaadin.demo.sampler.features.panels.PanelBasic; -import com.vaadin.demo.sampler.features.panels.PanelLight; -import com.vaadin.demo.sampler.features.selects.ComboBoxContains; -import com.vaadin.demo.sampler.features.selects.ComboBoxInputPrompt; -import com.vaadin.demo.sampler.features.selects.ComboBoxNewItems; -import com.vaadin.demo.sampler.features.selects.ComboBoxPlain; -import com.vaadin.demo.sampler.features.selects.ComboBoxStartsWith; -import com.vaadin.demo.sampler.features.selects.ListSelectMultiple; -import com.vaadin.demo.sampler.features.selects.ListSelectSingle; -import com.vaadin.demo.sampler.features.selects.NativeSelection; -import com.vaadin.demo.sampler.features.selects.TwinColumnSelect; -import com.vaadin.demo.sampler.features.table.TableActions; -import com.vaadin.demo.sampler.features.table.TableCellStyling; -import com.vaadin.demo.sampler.features.table.TableColumnAlignment; -import com.vaadin.demo.sampler.features.table.TableColumnCollapsing; -import com.vaadin.demo.sampler.features.table.TableColumnHeaders; -import com.vaadin.demo.sampler.features.table.TableColumnReordering; -import com.vaadin.demo.sampler.features.table.TableHeaderIcons; -import com.vaadin.demo.sampler.features.table.TableLazyLoading; -import com.vaadin.demo.sampler.features.table.TableMouseEvents; -import com.vaadin.demo.sampler.features.table.TableRowHeaders; -import com.vaadin.demo.sampler.features.table.TableRowStyling; -import com.vaadin.demo.sampler.features.table.TableSorting; -import com.vaadin.demo.sampler.features.tabsheets.TabSheetDisabled; -import com.vaadin.demo.sampler.features.tabsheets.TabSheetIcons; -import com.vaadin.demo.sampler.features.tabsheets.TabSheetScrolling; -import com.vaadin.demo.sampler.features.text.LabelPlain; -import com.vaadin.demo.sampler.features.text.LabelPreformatted; -import com.vaadin.demo.sampler.features.text.LabelRich; -import com.vaadin.demo.sampler.features.text.RichTextEditor; -import com.vaadin.demo.sampler.features.text.TextArea; -import com.vaadin.demo.sampler.features.text.TextFieldInputPrompt; -import com.vaadin.demo.sampler.features.text.TextFieldSecret; -import com.vaadin.demo.sampler.features.text.TextFieldSingle; -import com.vaadin.demo.sampler.features.trees.TreeActions; -import com.vaadin.demo.sampler.features.trees.TreeMouseEvents; -import com.vaadin.demo.sampler.features.trees.TreeMultiSelect; -import com.vaadin.demo.sampler.features.trees.TreeSingleSelect; -import com.vaadin.demo.sampler.features.upload.UploadBasic; -import com.vaadin.demo.sampler.features.upload.UploadWithProgressMonitoring; -import com.vaadin.demo.sampler.features.windows.NativeWindow; -import com.vaadin.demo.sampler.features.windows.Subwindow; -import com.vaadin.demo.sampler.features.windows.SubwindowAutoSized; -import com.vaadin.demo.sampler.features.windows.SubwindowClose; -import com.vaadin.demo.sampler.features.windows.SubwindowModal; -import com.vaadin.demo.sampler.features.windows.SubwindowPositioned; -import com.vaadin.demo.sampler.features.windows.SubwindowSized; - -/** - * Contains the FeatureSet implementation and the structure for the feature - * 'tree'. - * <p> - * Each set is implemented as it's own class to facilitate linking to sets in - * the same way as linking to individual features. - * </p> - * - */ -@SuppressWarnings("serial") -public class FeatureSet extends Feature { - - /* - * MAIN structure; root is always a FeatureSet that is not shown - */ - static final FeatureSet FEATURES = new FeatureSet("All", new Feature[] { - // Main sets - // new Blueprints(), disabled for now, until more samples are ready - new Components(), // - }); - - /* - * TOP LEVEL - */ - public static class Blueprints extends FeatureSet { - public Blueprints() { - super("Blueprints", new Feature[] { - // Blueprints - new ProminentPrimaryAction(), // - }); - } - } - - public static class Components extends FeatureSet { - public Components() { - super("Vaadin Core Components", new Feature[] { - // - new Common(), // - new Accordions(), // - new Buttons(), // - new Dates(), // - new Forms(), // - new Layouts(), // - new Links(), // - new Notifications(), // - new Panels(), // - new Selects(), // - new Tables(),// - new Tabsheets(), // - new Texts(), // - new TextFields(), // - new Trees(), // - new Windows(), // - new Uploads(), // - }); - } - } - - /* - * LEVEL 2 - */ - public static class Buttons extends FeatureSet { - public Buttons() { - super( - "Buttons", - "Buttons", - "A button is one of the fundamental building blocks of any application.", - new Feature[] { - // - new ButtonPush(), // basic - new ButtonLink(), // link - new ButtonSwitch(), // switch/checkbox - - }); - } - } - - public static class Links extends FeatureSet { - public Links() { - super( - "Links", - "Links", - "An external link. This is the basic HTML-style link, changing the url of the browser w/o triggering a server-side event (like the link-styled Button).", - new Feature[] { - // - new LinkCurrentWindow(), // basic - new LinkNoDecorations(), // new win - new LinkSizedWindow(), // new win - - }); - } - } - - public static class Notifications extends FeatureSet { - public Notifications() { - super( - "Notifications", - "Notifications", - "Notifications are lightweight informational messages, used to inform the user of various events.", - new Feature[] { - // - new NotificationHumanized(), // humanized - new NotificationWarning(), // warning - new NotificationTray(), // tray - new NotificationError(), // error - new NotificationCustom(), // error - }); - } - } - - public static class Common extends FeatureSet { - public Common() { - super("Common", new Feature[] { - // - new Tooltips(), // - new Icons(), // - new Errors(), // - new Validation(), // TODO this should point to Form instead - }); - } - } - - public static class Selects extends FeatureSet { - public Selects() { - super("Selects", new Feature[] { - // - new ListSelectSingle(), // - new ListSelectMultiple(), // - new TwinColumnSelect(), // - new NativeSelection(), // - new ComboBoxPlain(), // - new ComboBoxInputPrompt(), // - new ComboBoxStartsWith(), // - new ComboBoxContains(), // - new ComboBoxNewItems(), // - - }); - } - } - - public static class Layouts extends FeatureSet { - public Layouts() { - super( - "Layouts", - "Layouts", - "Making a usable, good looking, dynamic layout can be tricky, but with the right tools almost anything is possible.<br/>", - new Feature[] { - // - new LayoutMargin(), // - new LayoutSpacing(), // - new VerticalLayoutBasic(), // - new HorizontalLayoutBasic(), // - new GridLayoutBasic(), // - new LayoutAlignment(), // - new ExpandingComponent(), // - new SplitPanelBasic(), // - new ApplicationLayout(), // - new WebLayout(), // - new CustomLayouts(), // - new CssLayouts(),// - }); - } - } - - public static class Tabsheets extends FeatureSet { - public Tabsheets() { - super( - "Tabsheets", - "Tabsheets", - "A Tabsheet organizes multiple components so that only the one component associated with the currently selected 'tab' is shown. Typically a tab will contain a Layout, which in turn may contain many components.", - new Feature[] { - // - new TabSheetIcons(), // - new TabSheetScrolling(), // - new TabSheetDisabled(), // - }); - } - } - - public static class Accordions extends FeatureSet { - public Accordions() { - super( - "Accordions", - "Accordions", - "An accordion component is a specialized case of a tabsheet." - + " Within an accordion, the tabs are organized vertically," - + " and the content will be shown directly below the tab.", - new Feature[] { - // - new AccordionIcons(), // - new AccordionDisabled(), // - }); - } - } - - public static class Panels extends FeatureSet { - public Panels() { - super( - "Panels", - "Panels", - "Panel is a simple container that supports scrolling.<br/>It's internal layout (by default VerticalLayout) can be configured or exchanged to get desired results. Components that are added to the Panel will in effect be added to the layout.", - new Feature[] { - // - new PanelBasic(), // - new PanelLight(), // - }); - } - } - - public static class Forms extends FeatureSet { - public Forms() { - super("Forms", "Forms", - "The Form -component provides a convenient way to organize" - + " related fields visually.", new Feature[] { - // - new FormBasic(), // - }); - } - } - - public static class Uploads extends FeatureSet { - public Uploads() { - super( - "Uploads", - "Uploads", - "Upload is a component providing a method for clients to send files to server.", - new Feature[] { - // - new UploadBasic(), // - new UploadWithProgressMonitoring(), // - }); - } - } - - public static class Windows extends FeatureSet { - public Windows() { - super( - "Windows", - "Windows", - "Windows can (for instance) organize the UI, save space (popup windows), focus attention (modal windows), or provide multiple views for the same data for multitasking or dual screen setups (native browser windows).", - new Feature[] { - // - new Subwindow(), // - new SubwindowModal(), // - new SubwindowAutoSized(), // - new SubwindowSized(), // - new SubwindowPositioned(), // - new SubwindowClose(), // - new NativeWindow(), // - }); - } - } - - public static class Tables extends FeatureSet { - public Tables() { - super( - "Table (Grid)", - "Table (Grid)", - "A Table, also known as a (Data)Grid, can be used to show data in a tabular fashion. It's well suited for showing large datasets.", - new Feature[] { - // - new TableHeaderIcons(), // - new TableColumnHeaders(), // - new TableColumnReordering(), // - new TableColumnCollapsing(), // - new TableColumnAlignment(), // - new TableCellStyling(), // - new TableSorting(), // - new TableRowHeaders(), // - new TableRowStyling(), // - new TableActions(), // - new TableMouseEvents(), // - new TableLazyLoading(), // - }); - } - } - - public static class Texts extends FeatureSet { - public Texts() { - super( - "Texts", - "Texts", - "A label is a simple component that allows you to add (optionally formatted) text components to your application.", - new Feature[] { - // - new LabelPlain(), // - new LabelPreformatted(), // - new LabelRich(), // - }); - } - } - - public static class TextFields extends FeatureSet { - public TextFields() { - super( - "TextFields", - "Text inputs", - "Text inputs are probably the most needed components in any application that require user input or editing.", - new Feature[] { - // - new TextFieldSingle(), // - new TextFieldSecret(), // - new TextFieldInputPrompt(), // - new TextArea(), // - new RichTextEditor(), // - }); - } - } - - public static class Trees extends FeatureSet { - public Trees() { - super( - "Trees", - "Trees", - "The Tree component provides a natural way to represent data that has hierarchical relationships, such as filesystems or message threads.", - new Feature[] { - // - new TreeSingleSelect(), // - new TreeMultiSelect(), // - new TreeActions(), // - new TreeMouseEvents(), // - }); - } - } - - public static class Dates extends FeatureSet { - public Dates() { - super( - "Dates", - "Dates", - "The DateField component can be used to produce various date and time input fields with different resolutions. The date and time format used with this component is reported to Vaadin by the browser.", - new Feature[] { - // - new DatePopup(), // - new DateInline(), // - new DateLocale(), // - new DateResolution(), // - }); - } - } - - // ---------------------------------------------------------- - /* - * FeatureSet implementation follows. - */ - - private final String pathname; - - private final String name; - - private final String desc; - - private final String icon = "folder.gif"; - - private final Feature[] content; - - private HierarchicalContainer container = null; - - private final boolean containerRecursive = false; - - FeatureSet(String pathname, Feature[] content) { - this(pathname, pathname, "", content); - } - - FeatureSet(String pathname, String name, Feature[] content) { - this(pathname, name, "", content); - } - - FeatureSet(String pathname, String name, String desc, Feature[] content) { - this.pathname = pathname; - this.name = name; - this.desc = desc; - this.content = content; - } - - Feature[] getFeatures() { - return content; - } - - Feature getFeatureByPath(String path) { - LinkedList<String> parts = new LinkedList<String>(); - Collections.addAll(parts, path.split("/")); - FeatureSet f = this; - while (f != null) { - Feature[] fs = f.getFeatures(); - f = null; // break while if no new found - String part = parts.remove(0); - for (int i = 0; i < fs.length; i++) { - if (fs[i].getPathName().equalsIgnoreCase(part)) { - if (parts.isEmpty()) { - return fs[i]; - } else if (fs[i] instanceof FeatureSet) { - f = (FeatureSet) fs[i]; - break; - } else { - return null; - } - } - } - } - return null; - } - - HierarchicalContainer getContainer(boolean recurse) { - if (container == null || containerRecursive != recurse) { - container = new HierarchicalContainer(); - container.addContainerProperty(PROPERTY_NAME, String.class, ""); - container.addContainerProperty(PROPERTY_DESCRIPTION, String.class, - ""); - // fill - addFeatures(this, container, recurse); - } - return container; - } - - private void addFeatures(FeatureSet f, HierarchicalContainer c, - boolean recurse) { - Feature[] features = f.getFeatures(); - for (int i = 0; i < features.length; i++) { - Item item = c.addItem(features[i]); - Property property = item.getItemProperty(PROPERTY_NAME); - property.setValue(features[i].getName()); - property = item.getItemProperty(PROPERTY_DESCRIPTION); - property.setValue(features[i].getDescription()); - if (recurse) { - c.setParent(features[i], f); - if (features[i] instanceof FeatureSet) { - addFeatures((FeatureSet) features[i], c, recurse); - } - } - if (!(features[i] instanceof FeatureSet)) { - c.setChildrenAllowed(features[i], false); - } - } - } - - @Override - public String getDescription() { - return desc; - } - - @Override - public String getPathName() { - return pathname; - } - - @Override - public String getName() { - return name; - } - - @Override - public String getIconName() { - return icon; - } - - @Override - public APIResource[] getRelatedAPI() { - return null; - } - - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return null; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/FeatureView.java b/src/com/vaadin/demo/sampler/FeatureView.java deleted file mode 100644 index 3672520065..0000000000 --- a/src/com/vaadin/demo/sampler/FeatureView.java +++ /dev/null @@ -1,260 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.util.HashMap; - -import com.vaadin.demo.sampler.ActiveLink.LinkActivatedEvent; -import com.vaadin.demo.sampler.ActiveLink.LinkActivatedListener; -import com.vaadin.demo.sampler.SamplerApplication.SamplerWindow; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class FeatureView extends HorizontalLayout { - - private static final String MSG_SHOW_SRC = "Show Javaâ„¢ source »"; - - private Panel right; - private VerticalLayout left; - - private VerticalLayout controls; - - private ActiveLink showSrc; - - private HashMap<Feature, Component> exampleCache = new HashMap<Feature, Component>(); - - private Feature currentFeature; - - private Window srcWindow; - - public FeatureView() { - - setWidth("100%"); - setMargin(true); - setSpacing(true); - setStyleName("sample-view"); - - left = new VerticalLayout(); - left.setWidth("100%"); - left.setSpacing(true); - left.setMargin(false); - addComponent(left); - setExpandRatio(left, 1); - - VerticalLayout rightLayout = new VerticalLayout(); - right = new Panel(rightLayout); - rightLayout.setMargin(true, false, false, false); - right.setStyleName(Panel.STYLE_LIGHT); - right.addStyleName("feature-info"); - right.setWidth("369px"); - addComponent(right); - - controls = new VerticalLayout(); - controls.setWidth("100%"); - controls.setStyleName("feature-controls"); - - HorizontalLayout controlButtons = new HorizontalLayout(); - controls.addComponent(controlButtons); - - Button resetExample = new NativeButton("Reset example", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - resetExample(); - } - }); - resetExample.setStyleName(Button.STYLE_LINK); - resetExample.addStyleName("showcode"); - controlButtons.addComponent(resetExample); - - controlButtons.addComponent(new Label("|")); - - showSrc = new ActiveLink(); - showSrc - .setDescription("Right / middle / ctrl / shift -click for browser window/tab"); - showSrc.addListener(new LinkActivatedListener() { - - public void linkActivated(LinkActivatedEvent event) { - if (!event.isLinkOpened()) { - showSource(currentFeature.getSource()); - } - - } - - }); - showSrc.setCaption(MSG_SHOW_SRC); - showSrc.addStyleName("showcode"); - showSrc.setTargetBorder(Link.TARGET_BORDER_NONE); - controlButtons.addComponent(showSrc); - - } - - public void showSource(String source) { - if (srcWindow == null) { - srcWindow = new Window("Javaâ„¢ source"); - srcWindow.getContent().setSizeUndefined(); - srcWindow.setWidth("70%"); - srcWindow.setHeight("60%"); - srcWindow.setPositionX(100); - srcWindow.setPositionY(100); - } - srcWindow.removeAllComponents(); - srcWindow.addComponent(new CodeLabel(source)); - - if (srcWindow.getParent() == null) { - getWindow().addWindow(srcWindow); - } - } - - private void resetExample() { - if (currentFeature != null) { - Feature f = currentFeature; - currentFeature = null; - exampleCache.remove(f); - setFeature(f); - } - } - - public void setFeature(Feature feature) { - if (feature != currentFeature) { - currentFeature = feature; - right.removeAllComponents(); - left.removeAllComponents(); - - left.addComponent(controls); - controls.setCaption(feature.getName()); - - left.addComponent(getExampleFor(feature)); - - right.setCaption("Description and Resources"); - - final Feature parent = (Feature) SamplerApplication - .getAllFeatures().getParent(feature); - String desc = parent.getDescription(); - boolean hasParentDesc = false; - - final Label parentLabel = new Label(parent.getDescription()); - if (desc != null && desc != "") { - parentLabel.setContentMode(Label.CONTENT_XHTML); - right.addComponent(parentLabel); - hasParentDesc = true; - } - - desc = feature.getDescription(); - if (desc != null && desc != "") { - // Sample description uses additional decorations if a parent - // description is found - final Label l = new Label( - "<div class=\"outer-deco\"><div class=\"deco\"><span class=\"deco\"></span>" - + desc + "</div></div>", Label.CONTENT_XHTML); - right.addComponent(l); - if (hasParentDesc) { - l.setStyleName("sample-description"); - } else { - l.setStyleName("description"); - } - } - - { // open src in new window -link - String path = SamplerApplication.getPathFor(currentFeature); - showSrc.setTargetName(path); - showSrc.setResource(new ExternalResource(getApplication() - .getURL() - + "src/" + path)); - } - - NamedExternalResource[] resources = feature.getRelatedResources(); - if (resources != null) { - VerticalLayout res = new VerticalLayout(); - Label caption = new Label("<span>Additional Resources</span>", - Label.CONTENT_XHTML); - caption.setStyleName("section"); - caption.setWidth("100%"); - res.addComponent(caption); - res.setMargin(false, false, true, false); - for (NamedExternalResource r : resources) { - final Link l = new Link(r.getName(), r); - l.setIcon(new ThemeResource("../runo/icons/16/note.png")); - res.addComponent(l); - } - right.addComponent(res); - } - - APIResource[] apis = feature.getRelatedAPI(); - if (apis != null) { - VerticalLayout api = new VerticalLayout(); - Label caption = new Label("<span>API Documentation</span>", - Label.CONTENT_XHTML); - caption.setStyleName("section"); - caption.setWidth("100%"); - api.addComponent(caption); - api.setMargin(false, false, true, false); - for (APIResource r : apis) { - final Link l = new Link(r.getName(), r); - l.setIcon(new ThemeResource( - "../runo/icons/16/document-txt.png")); - api.addComponent(l); - } - right.addComponent(api); - } - - Class<? extends Feature>[] features = feature.getRelatedFeatures(); - if (features != null) { - VerticalLayout rel = new VerticalLayout(); - Label caption = new Label("<span>Related Samples</span>", - Label.CONTENT_XHTML); - caption.setStyleName("section"); - caption.setWidth("100%"); - rel.addComponent(caption); - rel.setMargin(false, false, true, false); - for (Class<? extends Feature> c : features) { - final Feature f = SamplerApplication.getFeatureFor(c); - if (f != null) { - String path = SamplerApplication.getPathFor(f); - ActiveLink al = new ActiveLink(f.getName(), - new ExternalResource(getApplication().getURL() - + "#" + path)); - al - .setIcon(new ThemeResource( - (f instanceof FeatureSet ? "../sampler/icons/category.gif" - : "../sampler/icons/sample.png"))); - al.addListener(new LinkActivatedListener() { - public void linkActivated(LinkActivatedEvent event) { - if (event.isLinkOpened()) { - getWindow() - .showNotification( - f.getName() - + " opened if new window/tab"); - } else { - SamplerWindow w = (SamplerWindow) getWindow(); - w.setFeature(f); - } - } - }); - rel.addComponent(al); - } - } - right.addComponent(rel); - } - } - - } - - private Component getExampleFor(Feature f) { - Component ex = exampleCache.get(f); - if (ex == null) { - ex = f.getExample(); - exampleCache.put(f, ex); - } - return ex; - } - -} diff --git a/src/com/vaadin/demo/sampler/GoogleAnalytics.java b/src/com/vaadin/demo/sampler/GoogleAnalytics.java deleted file mode 100644 index 9e4e56ba5e..0000000000 --- a/src/com/vaadin/demo/sampler/GoogleAnalytics.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.demo.sampler; - -import com.vaadin.demo.sampler.gwt.client.ui.VGoogleAnalytics; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.ClientWidget; - -@SuppressWarnings("serial") -@ClientWidget(VGoogleAnalytics.class) -public class GoogleAnalytics extends AbstractComponent { - - private String trackerId; - private String pageId; - private String domainName; - - private static final String TAG = "googleanalytics"; - - public GoogleAnalytics(String trackerId) { - this.trackerId = trackerId; - } - - public GoogleAnalytics(String trackerId, String domainName) { - this(trackerId); - this.domainName = domainName; - } - - public String getTrackerId() { - return trackerId; - } - - public String getDomainName() { - return domainName; - } - - public void trackPageview(String pageId) { - this.pageId = pageId; - requestRepaint(); - } - - @Override - public void paintContent(PaintTarget target) throws PaintException { - super.paintContent(target); - target.addAttribute("trackerid", trackerId); - if (pageId != null) { - target.addAttribute("pageid", pageId); - } - if (domainName != null) { - target.addAttribute("domain", domainName); - } - } - -} diff --git a/src/com/vaadin/demo/sampler/ModeSwitch.java b/src/com/vaadin/demo/sampler/ModeSwitch.java deleted file mode 100644 index 62a1ab8ef4..0000000000 --- a/src/com/vaadin/demo/sampler/ModeSwitch.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.util.HashMap; -import java.util.Iterator; - -import com.vaadin.terminal.Resource; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class ModeSwitch extends CustomComponent { - - GridLayout layout = new GridLayout(3, 1); - - HashMap<Object, Button> idToButton = new HashMap<Object, Button>(); - Object mode = null; - - public ModeSwitch() { - setSizeUndefined(); - layout.setSizeUndefined(); - setCompositionRoot(layout); - setStyleName("ModeSwitch"); - } - - public Object getMode() { - return mode; - } - - public void setMode(Object mode) { - if (idToButton.containsKey(mode)) { - this.mode = mode; - updateStyles(); - fireEvent(new ModeSwitchEvent()); - } - } - - public void addListener(ModeSwitchListener listener) { - super.addListener(listener); - } - - public void addMode(Object id, String caption, String description, - Resource icon) { - if (idToButton.containsKey(id)) { - removeMode(id); - } - Button b = new NativeButton(); - if (caption != null) { - b.setCaption(caption); - } - if (description != null) { - b.setDescription(description); - } - if (icon != null) { - b.setIcon(icon); - } - b.setData(id); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - setMode(event.getButton().getData()); - } - }); - idToButton.put(id, b); - layout.addComponent(b); - updateStyles(); - } - - public void removeMode(Object id) { - Button b = idToButton.remove(id); - layout.removeComponent(b); - updateStyles(); - } - - @SuppressWarnings("unchecked") - private void updateStyles() { - boolean first = true; - for (Iterator<Button> it = layout.getComponentIterator(); it.hasNext();) { - Button b = it.next(); - String isOn = (b.getData() == mode ? "-on" : ""); - if (first) { - first = false; - b.setStyleName("first" + isOn); - } else if (!it.hasNext()) { - b.setStyleName("last" + isOn); - } else { - b.setStyleName("mid" + isOn); - } - } - } - - public interface ModeSwitchListener extends Listener { - - } - - public class ModeSwitchEvent extends Event { - - public ModeSwitchEvent() { - super(ModeSwitch.this); - } - - public Object getMode() { - return ModeSwitch.this.getMode(); - } - } - -} diff --git a/src/com/vaadin/demo/sampler/NamedExternalResource.java b/src/com/vaadin/demo/sampler/NamedExternalResource.java deleted file mode 100644 index 9f6f7e76bc..0000000000 --- a/src/com/vaadin/demo/sampler/NamedExternalResource.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.vaadin.demo.sampler; - -import com.vaadin.terminal.ExternalResource; - -@SuppressWarnings("serial") -public class NamedExternalResource extends ExternalResource { - - private String name; - - public NamedExternalResource(String name, String sourceURL) { - super(sourceURL); - this.name = name; - } - - public String getName() { - return name; - } - -} diff --git a/src/com/vaadin/demo/sampler/SamplerApplication.java b/src/com/vaadin/demo/sampler/SamplerApplication.java deleted file mode 100644 index db88d13294..0000000000 --- a/src/com/vaadin/demo/sampler/SamplerApplication.java +++ /dev/null @@ -1,832 +0,0 @@ -package com.vaadin.demo.sampler; - -import java.net.URI; -import java.net.URL; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.demo.sampler.ActiveLink.LinkActivatedEvent; -import com.vaadin.demo.sampler.ModeSwitch.ModeSwitchEvent; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.URIHandler; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.NativeButton; -import com.vaadin.ui.Panel; -import com.vaadin.ui.PopupView; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Tree; -import com.vaadin.ui.UriFragmentUtility; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.PopupView.PopupVisibilityEvent; -import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent; -import com.vaadin.ui.UriFragmentUtility.FragmentChangedListener; - -@SuppressWarnings("serial") -public class SamplerApplication extends Application { - - // All features in one container - private static final HierarchicalContainer allFeatures = FeatureSet.FEATURES - .getContainer(true); - - // init() inits - private static final String[] THEMES = { "reindeer", "runo" }; - private static final String SAMPLER_THEME_NAME = "sampler"; - - // used when trying to guess theme location - private static String APP_URL = null; - - private String currentApplicationTheme = SAMPLER_THEME_NAME + "-" - + THEMES[0]; - - @Override - public void init() { - setMainWindow(new SamplerWindow()); - APP_URL = getURL().toString(); - } - - /** - * Tries to guess theme location. - * - * @return - */ - public static String getThemeBase() { - try { - URI uri = new URI(APP_URL + "../VAADIN/themes/" - + SAMPLER_THEME_NAME + "/"); - return uri.normalize().toString(); - } catch (Exception e) { - System.err.println("Theme location could not be resolved:" + e); - } - return "/VAADIN/themes/" + SAMPLER_THEME_NAME + "/"; - } - - // Supports multiple browser windows - @Override - public Window getWindow(String name) { - Window w = super.getWindow(name); - if (w == null) { - if (name.startsWith("src")) { - w = new SourceWindow(); - } else { - w = new SamplerWindow(); - w.setName(name); - } - - addWindow(w); - } - return w; - - } - - /** - * Gets absolute path for given Feature - * - * @param f - * the Feature whose path to get, of null if not found - * @return the path of the Feature - */ - public static String getPathFor(Feature f) { - if (f == null) { - return ""; - } - if (allFeatures.containsId(f)) { - String path = f.getPathName(); - f = (Feature) allFeatures.getParent(f); - while (f != null) { - path = f.getPathName() + "/" + path; - f = (Feature) allFeatures.getParent(f); - } - return path; - } - return ""; - } - - /** - * Gets the instance for the given Feature class, e.g DummyFeature.class. - * - * @param clazz - * @return - */ - @SuppressWarnings("unchecked") - public static Feature getFeatureFor(Class clazz) { - for (Iterator<Feature> it = allFeatures.getItemIds().iterator(); it - .hasNext();) { - Feature f = it.next(); - if (f.getClass() == clazz) { - return f; - } - } - return null; - } - - /** - * The main window for Sampler, contains the full application UI. - * - */ - class SamplerWindow extends Window { - - private final ThemeResource EMPTY_THEME_ICON = new ThemeResource( - "../sampler/sampler/icon-empty.png"); - - private final ThemeResource SELECTED_THEME_ICON = new ThemeResource( - "../sampler/sampler/select-bullet.png"); - - private FeatureList currentList = new FeatureGrid(); - private final FeatureView featureView = new FeatureView(); - private final ObjectProperty currentFeature = new ObjectProperty(null, - Feature.class); - - private final ModeSwitch mode; - - private final SplitPanel mainSplit; - private final Tree navigationTree; - // itmill: UA-658457-6 - private final GoogleAnalytics webAnalytics = new GoogleAnalytics( - "UA-658457-6", "none"); - // "backbutton" - UriFragmentUtility uriFragmentUtility = new UriFragmentUtility(); - - // breadcrumbs - BreadCrumbs breadcrumbs = new BreadCrumbs(); - - Button previousSample; - Button nextSample; - private ComboBox search; - private ComboBox theme; - - @Override - public void detach() { - super.detach(); - - search.setContainerDataSource(null); - navigationTree.setContainerDataSource(null); - } - - SamplerWindow() { - // Main top/expanded-bottom layout - VerticalLayout mainExpand = new VerticalLayout(); - setContent(mainExpand); - setSizeFull(); - mainExpand.setSizeFull(); - setCaption("Vaadin Sampler"); - setTheme(currentApplicationTheme); - - // topbar (navigation) - HorizontalLayout nav = new HorizontalLayout(); - mainExpand.addComponent(nav); - nav.setHeight("44px"); - nav.setWidth("100%"); - nav.setStyleName("topbar"); - nav.setSpacing(true); - nav.setMargin(false, true, false, false); - - // Upper left logo - Component logo = createLogo(); - nav.addComponent(logo); - nav.setComponentAlignment(logo, Alignment.MIDDLE_LEFT); - - // Breadcrumbs - nav.addComponent(breadcrumbs); - nav.setExpandRatio(breadcrumbs, 1); - nav.setComponentAlignment(breadcrumbs, Alignment.MIDDLE_LEFT); - - // invisible analytics -component - nav.addComponent(webAnalytics); - - // "backbutton" - nav.addComponent(uriFragmentUtility); - uriFragmentUtility.addListener(new FragmentChangedListener() { - public void fragmentChanged(FragmentChangedEvent source) { - String frag = source.getUriFragmentUtility().getFragment(); - setFeature(frag); - } - }); - - // Main left/right split; hidden menu tree - mainSplit = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - mainSplit.setSizeFull(); - mainSplit.setStyleName("main-split"); - mainExpand.addComponent(mainSplit); - mainExpand.setExpandRatio(mainSplit, 1); - - // List/grid/coverflow - mode = createModeSwitch(); - mode.setMode(currentList); - nav.addComponent(mode); - nav.setComponentAlignment(mode, Alignment.MIDDLE_LEFT); - - // Select theme - Component themeSelect = createThemeSelect(); - nav.addComponent(themeSelect); - nav.setComponentAlignment(themeSelect, Alignment.MIDDLE_LEFT); - - // Layouts for top area buttons - HorizontalLayout quicknav = new HorizontalLayout(); - HorizontalLayout arrows = new HorizontalLayout(); - nav.addComponent(quicknav); - nav.addComponent(arrows); - nav.setComponentAlignment(quicknav, Alignment.MIDDLE_LEFT); - nav.setComponentAlignment(arrows, Alignment.MIDDLE_LEFT); - quicknav.setStyleName("segment"); - arrows.setStyleName("segment"); - - // Previous sample - previousSample = createPrevButton(); - arrows.addComponent(previousSample); - // Next sample - nextSample = createNextButton(); - arrows.addComponent(nextSample); - // "Search" combobox - // TODO add input prompt - Component searchComponent = createSearch(); - quicknav.addComponent(searchComponent); - - // Menu tree, initially hidden - navigationTree = createMenuTree(); - mainSplit.setFirstComponent(navigationTree); - - // Show / hide tree - Component treeSwitch = createTreeSwitch(); - quicknav.addComponent(treeSwitch); - - addListener(new CloseListener() { - public void windowClose(CloseEvent e) { - if (getMainWindow() != SamplerWindow.this) { - SamplerApplication.this - .removeWindow(SamplerWindow.this); - } - } - }); - } - - @SuppressWarnings("unchecked") - public void removeSubwindows() { - Collection<Window> wins = getChildWindows(); - if (null != wins) { - for (Window w : wins) { - removeWindow(w); - } - } - } - - /** - * Displays a Feature(Set) - * - * @param f - * the Feature(Set) to show - */ - public void setFeature(Feature f) { - removeSubwindows(); - currentFeature.setValue(f); - String path = getPathFor(f); - webAnalytics.trackPageview(path); - uriFragmentUtility.setFragment(path, false); - breadcrumbs.setPath(path); - - previousSample.setEnabled(f != null); - nextSample.setEnabled(!allFeatures.isLastId(f)); - - updateFeatureList(currentList); - } - - /** - * Displays a Feature(Set) matching the given path, or the main view if - * no matching Feature(Set) is found. - * - * @param path - * the path of the Feature(Set) to show - */ - public void setFeature(String path) { - Feature f = FeatureSet.FEATURES.getFeatureByPath(path); - setFeature(f); - } - - /* - * SamplerWindow helpers - */ - - private Component createSearch() { - search = new ComboBox(); - search.setWidth("160px"); - search.setNewItemsAllowed(false); - search.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS); - search.setNullSelectionAllowed(true); - search.setImmediate(true); - search.setContainerDataSource(allFeatures); - for (Iterator<?> it = allFeatures.getItemIds().iterator(); it - .hasNext();) { - Object id = it.next(); - if (id instanceof FeatureSet) { - search.setItemIcon(id, new ClassResource("folder.gif", - SamplerApplication.this)); - } - } - search.addListener(new ComboBox.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Feature f = (Feature) event.getProperty().getValue(); - if (f != null) { - SamplerWindow.this.setFeature(f); - event.getProperty().setValue(null); - } - - } - }); - // TODO add icons for section/sample - /* - * PopupView pv = new PopupView("", search) { public void - * changeVariables(Object source, Map variables) { - * super.changeVariables(source, variables); if (isPopupVisible()) { - * search.focus(); } } }; - */ - final PopupView pv = new PopupView("<span></span>", search); - pv.addListener(new PopupView.PopupVisibilityListener() { - public void popupVisibilityChange(PopupVisibilityEvent event) { - if (event.isPopupVisible()) { - search.focus(); - } - } - }); - pv.setStyleName("quickjump"); - pv.setDescription("Quick jump"); - - return pv; - } - - private Component createThemeSelect() { - theme = new ComboBox(); - theme.setWidth("32px"); - theme.setNewItemsAllowed(false); - theme.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS); - theme.setImmediate(true); - theme.setNullSelectionAllowed(false); - for (String themeName : THEMES) { - String id = SAMPLER_THEME_NAME + "-" + themeName; - theme.addItem(id); - theme.setItemCaption(id, themeName.substring(0, 1) - .toUpperCase() - + themeName.substring(1) + " theme"); - theme.setItemIcon(id, EMPTY_THEME_ICON); - } - - final String currentWindowTheme = getTheme(); - theme.setValue(currentWindowTheme); - theme.setItemIcon(currentWindowTheme, SELECTED_THEME_ICON); - - theme.addListener(new ComboBox.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - - final String newTheme = event.getProperty().getValue() - .toString(); - setTheme(newTheme); - - for (String themeName : THEMES) { - String id = SAMPLER_THEME_NAME + "-" + themeName; - theme.setItemIcon(id, EMPTY_THEME_ICON); - } - - theme.setItemIcon(newTheme, SELECTED_THEME_ICON); - currentApplicationTheme = newTheme; - } - }); - - theme.setStyleName("theme-select"); - theme.setDescription("Select Theme"); - - return theme; - } - - private Component createLogo() { - Button logo = new NativeButton("", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - setFeature((Feature) null); - } - }); - logo.setDescription("↶ Home"); - logo.setStyleName(Button.STYLE_LINK); - logo.addStyleName("logo"); - return logo; - } - - private Button createNextButton() { - Button b = new NativeButton("", new ClickListener() { - public void buttonClick(ClickEvent event) { - Object curr = currentFeature.getValue(); - Object next = allFeatures.nextItemId(curr); - while (next != null && next instanceof FeatureSet) { - next = allFeatures.nextItemId(next); - } - if (next != null) { - currentFeature.setValue(next); - } else { - // could potentially occur if there is an empty section - showNotification("Last sample"); - } - } - }); - b.setStyleName("next"); - b.setDescription("Jump to the next sample"); - return b; - } - - private Button createPrevButton() { - Button b = new NativeButton("", new ClickListener() { - public void buttonClick(ClickEvent event) { - Object curr = currentFeature.getValue(); - Object prev = allFeatures.prevItemId(curr); - while (prev != null && prev instanceof FeatureSet) { - prev = allFeatures.prevItemId(prev); - } - currentFeature.setValue(prev); - } - }); - b.setEnabled(false); - b.setStyleName("previous"); - b.setDescription("Jump to the previous sample"); - return b; - } - - private Component createTreeSwitch() { - final Button b = new NativeButton(); - b.setStyleName("tree-switch"); - b.setDescription("Toggle sample tree visibility"); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (b.getStyleName().contains("down")) { - b.removeStyleName("down"); - mainSplit.setSplitPosition(0); - navigationTree.setVisible(false); - mainSplit.setLocked(true); - } else { - b.addStyleName("down"); - mainSplit.setSplitPosition(20); - mainSplit.setLocked(false); - navigationTree.setVisible(true); - } - } - }); - mainSplit.setSplitPosition(0); - navigationTree.setVisible(false); - mainSplit.setLocked(true); - return b; - } - - private ModeSwitch createModeSwitch() { - ModeSwitch m = new ModeSwitch(); - m.addMode(currentList, "", "View as Icons", new ThemeResource( - "../sampler/sampler/grid.png")); - /*- no CoverFlow yet - m.addMode(coverFlow, "", "View as Icons", new ThemeResource( - "../sampler/sampler/flow.gif")); - */ - m.addMode(new FeatureTable(), "", "View as List", - new ThemeResource("../sampler/sampler/list.png")); - m.addListener(new ModeSwitch.ModeSwitchListener() { - public void componentEvent(Event event) { - if (event instanceof ModeSwitchEvent) { - updateFeatureList((FeatureList) ((ModeSwitchEvent) event) - .getMode()); - } - } - }); - return m; - } - - private Tree createMenuTree() { - final Tree tree = new Tree(); - tree.setImmediate(true); - tree.setStyleName("menu"); - tree.setContainerDataSource(allFeatures); - currentFeature.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Feature f = (Feature) event.getProperty().getValue(); - Feature v = (Feature) tree.getValue(); - if ((f != null && !f.equals(v)) || (f == null && v != null)) { - tree.setValue(f); - } - } - }); - for (int i = 0; i < FeatureSet.FEATURES.getFeatures().length; i++) { - tree - .expandItemsRecursively(FeatureSet.FEATURES - .getFeatures()[i]); - } - tree.expandItemsRecursively(FeatureSet.FEATURES); - tree.addListener(new Tree.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Feature f = (Feature) event.getProperty().getValue(); - setFeature(f); - } - }); - return tree; - } - - private void updateFeatureList(FeatureList list) { - currentList = list; - Feature val = (Feature) currentFeature.getValue(); - if (val == null) { - currentList.setFeatureContainer(allFeatures); - mainSplit.setSecondComponent(currentList); - mode.setVisible(true); - } else if (val instanceof FeatureSet) { - currentList.setFeatureContainer(((FeatureSet) val) - .getContainer(true)); - mainSplit.setSecondComponent(currentList); - mode.setVisible(true); - } else { - mainSplit.setSecondComponent(featureView); - featureView.setFeature(val); - mode.setVisible(false); - } - - } - - } - - private class BreadCrumbs extends CustomComponent implements - ActiveLink.LinkActivatedListener { - HorizontalLayout layout; - - BreadCrumbs() { - layout = new HorizontalLayout(); - layout.setSpacing(true); - setCompositionRoot(layout); - setStyleName("breadcrumbs"); - setPath(null); - } - - public void setPath(String path) { - // could be optimized: always builds path from scratch - layout.removeAllComponents(); - - { // home - ActiveLink link = new ActiveLink("Home", new ExternalResource( - "#")); - link.addListener(this); - layout.addComponent(link); - } - - if (path != null && !"".equals(path)) { - String parts[] = path.split("/"); - String current = ""; - ActiveLink link = null; - for (int i = 0; i < parts.length; i++) { - layout.addComponent(new Label("»", - Label.CONTENT_XHTML)); - current += (i > 0 ? "/" : "") + parts[i]; - Feature f = FeatureSet.FEATURES.getFeatureByPath(current); - link = new ActiveLink(f.getName(), new ExternalResource("#" - + getPathFor(f))); - link.setData(f); - link.addListener(this); - layout.addComponent(link); - } - if (link != null) { - link.setStyleName("bold"); - } - } - - } - - public void linkActivated(LinkActivatedEvent event) { - if (!event.isLinkOpened()) { - ((SamplerWindow) getWindow()).setFeature((Feature) event - .getActiveLink().getData()); - } - } - } - - /** - * Components capable of listing Features should implement this. - * - */ - interface FeatureList extends Component { - /** - * Shows the given Features - * - * @param c - * Container with Features to show. - */ - public void setFeatureContainer(HierarchicalContainer c); - } - - /** - * Table -mode FeatureList. Displays the features in a Table. - */ - private class FeatureTable extends Table implements FeatureList { - private final HashMap<Object, Resource> iconCache = new HashMap<Object, Resource>(); - - FeatureTable() { - setStyleName("featuretable"); - alwaysRecalculateColumnWidths = true; - setSelectable(false); - setSizeFull(); - setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); - addGeneratedColumn(Feature.PROPERTY_ICON, - new Table.ColumnGenerator() { - public Component generateCell(Table source, - Object itemId, Object columnId) { - Feature f = (Feature) itemId; - if (f instanceof FeatureSet) { - // no icon for sections - return null; - } - String resId = "75-" + f.getIconName(); - Resource res = iconCache.get(resId); - if (res == null) { - res = new ClassResource(f.getClass(), resId, - SamplerApplication.this); - iconCache.put(resId, res); - - } - Embedded emb = new Embedded("", res); - emb.setWidth("48px"); - emb.setHeight("48px"); - emb.setType(Embedded.TYPE_IMAGE); - return emb; - } - - }); - addGeneratedColumn("", new Table.ColumnGenerator() { - public Component generateCell(Table source, Object itemId, - Object columnId) { - final Feature feature = (Feature) itemId; - if (feature instanceof FeatureSet) { - return null; - } else { - ActiveLink b = new ActiveLink("View sample ‣", - new ExternalResource("#" + getPathFor(feature))); - b.addListener(new ActiveLink.LinkActivatedListener() { - public void linkActivated(LinkActivatedEvent event) { - if (!event.isLinkOpened()) { - ((SamplerWindow) getWindow()) - .setFeature(feature); - } - } - }); - - b.setStyleName(Button.STYLE_LINK); - return b; - } - } - - }); - - addListener(new ItemClickListener() { - public void itemClick(ItemClickEvent event) { - Feature f = (Feature) event.getItemId(); - if (event.getButton() == ItemClickEvent.BUTTON_MIDDLE - || event.isCtrlKey() || event.isShiftKey()) { - getWindow().open( - new ExternalResource(getURL() + "#" - + getPathFor(f)), "_blank"); - } else { - ((SamplerWindow) getWindow()).setFeature(f); - } - } - }); - - setCellStyleGenerator(new CellStyleGenerator() { - public String getStyle(Object itemId, Object propertyId) { - if (propertyId == null && itemId instanceof FeatureSet) { - if (allFeatures.isRoot(itemId)) { - return "section"; - } else { - return "subsection"; - } - - } - return null; - } - }); - } - - public void setFeatureContainer(HierarchicalContainer c) { - setContainerDataSource(c); - setVisibleColumns(new Object[] { Feature.PROPERTY_ICON, - Feature.PROPERTY_NAME, "" }); - setColumnWidth(Feature.PROPERTY_ICON, 60); - - } - - } - - private class FeatureGrid extends Panel implements FeatureList { - - CssLayout grid = new CssLayout(); - private final HashMap<Object, Resource> iconCache = new HashMap<Object, Resource>(); - - FeatureGrid() { - setSizeFull(); - setContent(grid); - setStyleName(Panel.STYLE_LIGHT); - grid.setStyleName("grid"); - } - - @SuppressWarnings("unchecked") - public void setFeatureContainer(HierarchicalContainer c) { - grid.removeAllComponents(); - Collection<Feature> features = c.getItemIds(); - for (Iterator<Feature> it = features.iterator(); it.hasNext();) { - final Feature f = it.next(); - if (f instanceof FeatureSet) { - Label title = new Label(f.getName()); - if (c.isRoot(f)) { - title.setStyleName("section"); - grid.addComponent(title); - } else { - String text = "<h3>" + f.getName() + "</h3>"; - if (f.getDescription() != null - && f.getDescription() != "") { - text += f.getDescription().substring(0, - f.getDescription().indexOf(".") + 1); - } - title = new Label(text, Label.CONTENT_XHTML); - title.setStyleName("subsection"); - title.setSizeUndefined(); - grid.addComponent(title); - } - - } else { - Button b = new Button(f.getName()); - b.setStyleName(Button.STYLE_LINK); - b.addStyleName("screenshot"); - String resId = "75-" + f.getIconName(); - Resource res = iconCache.get(resId); - if (res == null) { - res = new ClassResource(f.getClass(), resId, - SamplerApplication.this); - iconCache.put(resId, res); - } - b.setIcon(res); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - ((SamplerWindow) getWindow()).setFeature(f); - } - }); - grid.addComponent(b); - } - } - } - } - - public static HierarchicalContainer getAllFeatures() { - return allFeatures; - } - - public class SourceWindow extends Window { - public SourceWindow() { - addURIHandler(new URIHandler() { - public DownloadStream handleURI(URL context, String relativeUri) { - Feature f = FeatureSet.FEATURES - .getFeatureByPath(relativeUri); - if (f != null) { - addComponent(new CodeLabel(f.getSource())); - } else { - addComponent(new Label("Sorry, no source found for " - + relativeUri)); - } - return null; - } - - }); - - addListener(new CloseListener() { - public void windowClose(CloseEvent e) { - SamplerApplication.this.removeWindow(SourceWindow.this); - } - }); - } - } - - @Override - public void close() { - removeWindow(getMainWindow()); - - super.close(); - } - -} diff --git a/src/com/vaadin/demo/sampler/features/accordions/75-AccordionDisabled.png b/src/com/vaadin/demo/sampler/features/accordions/75-AccordionDisabled.png Binary files differdeleted file mode 100644 index fb3e3fe844..0000000000 --- a/src/com/vaadin/demo/sampler/features/accordions/75-AccordionDisabled.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/accordions/75-AccordionIcons.png b/src/com/vaadin/demo/sampler/features/accordions/75-AccordionIcons.png Binary files differdeleted file mode 100644 index c38a1aefc8..0000000000 --- a/src/com/vaadin/demo/sampler/features/accordions/75-AccordionIcons.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabled.java b/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabled.java deleted file mode 100644 index 2bdd3fd078..0000000000 --- a/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabled.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.accordions;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Accordion;
-
-@SuppressWarnings("serial")
-public class AccordionDisabled extends Feature {
- @Override
- public String getName() {
- return "Accordion, disabled tabs";
- }
-
- @Override
- public String getDescription() {
- return "You can disable, enable, hide and show accordion 'tabs'.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Accordion.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { AccordionIcons.class, FeatureSet.Tabsheets.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java b/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java deleted file mode 100644 index 6566144a3f..0000000000 --- a/src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.vaadin.demo.sampler.features.accordions;
-
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.Accordion;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-import com.vaadin.ui.TabSheet.Tab;
-
-@SuppressWarnings("serial")
-public class AccordionDisabledExample extends VerticalLayout implements
- Accordion.SelectedTabChangeListener, Button.ClickListener {
-
- private Accordion a;
- private Button b1;
- private Button b2;
- private Label l1;
- private Label l2;
- private Label l3;
- @SuppressWarnings("unused")
- private Tab t1;
- private Tab t2;
- private Tab t3;
-
- private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");
- private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");
- private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");
-
- public AccordionDisabledExample() {
- setSpacing(true);
-
- l1 = new Label("There are no previously saved actions.");
- l2 = new Label("There are no saved notes.");
- l3 = new Label("There are currently no issues.");
-
- a = new Accordion();
- a.setHeight("300px");
- a.setWidth("400px");
- t1 = a.addTab(l1, "Saved actions", icon1);
- t2 = a.addTab(l2, "Notes", icon2);
- t3 = a.addTab(l3, "Issues", icon3);
- a.addListener(this);
-
- b1 = new Button("Disable 'Notes' tab");
- b2 = new Button("Hide 'Issues' tab");
- b1.addListener(this);
- b2.addListener(this);
-
- HorizontalLayout hl = new HorizontalLayout();
- hl.setSpacing(true);
- hl.addComponent(b1);
- hl.addComponent(b2);
-
- addComponent(a);
- addComponent(hl);
- }
-
- public void selectedTabChange(SelectedTabChangeEvent event) {
- String c = a.getTab(event.getTabSheet().getSelectedTab()).getCaption();
- getWindow().showNotification("Selected tab: " + c);
- }
-
- public void buttonClick(ClickEvent event) {
- if (b1.equals(event.getButton())) { // b1 clicked
- if (t2.isEnabled()) {
- t2.setEnabled(false);
- b1.setCaption("Enable 'Notes' tab");
- } else {
- t2.setEnabled(true);
- b1.setCaption("Disable 'Notes' tab");
- }
- } else { // b2 clicked
- if (t3.isVisible()) {
- t3.setVisible(false);
- b2.setCaption("Show 'Issues' tab");
- } else {
- t3.setVisible(true);
- b2.setCaption("Hide 'Issues' tab");
- }
- }
- a.requestRepaint();
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/accordions/AccordionIcons.java b/src/com/vaadin/demo/sampler/features/accordions/AccordionIcons.java deleted file mode 100644 index d9dd990446..0000000000 --- a/src/com/vaadin/demo/sampler/features/accordions/AccordionIcons.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.demo.sampler.features.accordions;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Accordion;
-
-@SuppressWarnings("serial")
-public class AccordionIcons extends Feature {
- @Override
- public String getName() {
- return "Accordion with icons";
- }
-
- @Override
- public String getDescription() {
- return "The accordion 'tabs' can contain icons in addition to the caption.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Accordion.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { AccordionDisabled.class,
- FeatureSet.Tabsheets.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java b/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java deleted file mode 100644 index fa21952c38..0000000000 --- a/src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.demo.sampler.features.accordions;
-
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.Accordion;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-import com.vaadin.ui.TabSheet.Tab;
-
-@SuppressWarnings("serial")
-public class AccordionIconsExample extends HorizontalLayout implements
- Accordion.SelectedTabChangeListener {
-
- private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");
- private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");
- private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");
-
- private Accordion a;
-
- public AccordionIconsExample() {
- setSpacing(true);
-
- Label l1 = new Label("There are no previously saved actions.");
- Label l2 = new Label("There are no saved notes.");
- Label l3 = new Label("There are currently no issues.");
-
- a = new Accordion();
- a.setHeight("300px");
- a.setWidth("400px");
- a.addTab(l1, "Saved actions", icon1);
- a.addTab(l2, "Notes", icon2);
- a.addTab(l3, "Issues", icon3);
- a.addListener(this);
-
- addComponent(a);
- }
-
- public void selectedTabChange(SelectedTabChangeEvent event) {
- TabSheet tabsheet = event.getTabSheet();
- Tab tab = tabsheet.getTab(tabsheet.getSelectedTab());
- if (tab != null) {
- getWindow().showNotification("Selected tab: " + tab.getCaption());
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/blueprints/75-ProminentPrimaryAction.png b/src/com/vaadin/demo/sampler/features/blueprints/75-ProminentPrimaryAction.png Binary files differdeleted file mode 100644 index d249324e0c..0000000000 --- a/src/com/vaadin/demo/sampler/features/blueprints/75-ProminentPrimaryAction.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/blueprints/ProminentPrimaryAction.java b/src/com/vaadin/demo/sampler/features/blueprints/ProminentPrimaryAction.java deleted file mode 100644 index 9409a86da4..0000000000 --- a/src/com/vaadin/demo/sampler/features/blueprints/ProminentPrimaryAction.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.demo.sampler.features.blueprints; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.buttons.ButtonLink; -import com.vaadin.demo.sampler.features.buttons.ButtonPush; -import com.vaadin.ui.Button; -import com.vaadin.ui.Link; - -@SuppressWarnings("serial") -public class ProminentPrimaryAction extends Feature { - - @Override - public String getName() { - return "Prominent primary action"; - } - - @Override - public String getDescription() { - return "A primary action is an action that is clearly the" - + " default, and it should be visually more prominent" - + " than the secondary actions.<br/>Good candidates" - + " include <i>Save</i>, <i>Submit</i>, <i>Continue</i>, <i>Next</i>," - + " <i>Finish</i> and so on.<br/>Note that 'dangerous' actions" - + " that can not be undone should not be primary, and that it's" - + " not always possible to identify a primary action" - + " - don't force it if it's not obvious."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Button.class), - new APIResource(Link.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { ButtonPush.class, ButtonLink.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return new NamedExternalResource[] { - - new NamedExternalResource("CSS for 'Sign up' button", - getThemeBase() + "prominentprimaryaction/styles.css"), - - new NamedExternalResource( - "Article: Primary & Secondary Actions in Web Forms (LukeW)", - "http://www.lukew.com/resources/articles/psactions.asp"), - new NamedExternalResource( - "Article: Primary & Secondary Actions (UI Pattern Factory)", - "http://uipatternfactory.com/p=primary-and-secondary-actions/") }; - } -} diff --git a/src/com/vaadin/demo/sampler/features/blueprints/ProminentPrimaryActionExample.java b/src/com/vaadin/demo/sampler/features/blueprints/ProminentPrimaryActionExample.java deleted file mode 100644 index b7a7fba8ad..0000000000 --- a/src/com/vaadin/demo/sampler/features/blueprints/ProminentPrimaryActionExample.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.vaadin.demo.sampler.features.blueprints; - -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class ProminentPrimaryActionExample extends VerticalLayout implements - Button.ClickListener { - - public ProminentPrimaryActionExample() { - setSpacing(true); - - { // Cancel / Save - HorizontalLayout horiz = new HorizontalLayout(); - horiz.setCaption("Save/cancel example:"); - horiz.setSpacing(true); - horiz.setMargin(true); - addComponent(horiz); - Button secondary = new Button("Cancel", this); - secondary.setStyleName(Button.STYLE_LINK); - horiz.addComponent(secondary); - Button primary = new Button("Save", this); - horiz.addComponent(primary); - } - - { // Sign up / Sign in - HorizontalLayout horiz = new HorizontalLayout(); - horiz.setCaption("Sign up example:"); - horiz.setSpacing(true); - horiz.setMargin(true); - addComponent(horiz); - Button primary = new Button("Sign up", this); - primary.addStyleName("primary"); - horiz.addComponent(primary); - Button secondary = new Button("or Sign in", this); - secondary.setStyleName(Button.STYLE_LINK); - horiz.addComponent(secondary); - horiz.setComponentAlignment(secondary, Alignment.MIDDLE_LEFT); - } - - { // Login / Forgot password? - VerticalLayout vert = new VerticalLayout(); - vert.setCaption("Login example:"); - vert.setSizeUndefined(); - vert.setSpacing(true); - vert.setMargin(true); - addComponent(vert); - Button primary = new Button("Login", this); - vert.addComponent(primary); - vert.setComponentAlignment(primary, Alignment.BOTTOM_RIGHT); - Button secondary = new Button("Forgot your password?", this); - secondary.setStyleName(Button.STYLE_LINK); - vert.addComponent(secondary); - vert.setComponentAlignment(secondary, Alignment.BOTTOM_RIGHT); - } - - } - - /* - * Shows a notification when a button is clicked. - */ - public void buttonClick(ClickEvent event) { - getWindow().showNotification( - "\"" + event.getButton().getCaption() + "\" clicked"); - } -} diff --git a/src/com/vaadin/demo/sampler/features/buttons/75-ButtonLink.png b/src/com/vaadin/demo/sampler/features/buttons/75-ButtonLink.png Binary files differdeleted file mode 100644 index 4e6963f8d1..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/75-ButtonLink.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/buttons/75-ButtonPush.png b/src/com/vaadin/demo/sampler/features/buttons/75-ButtonPush.png Binary files differdeleted file mode 100644 index 6520e205ff..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/75-ButtonPush.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/buttons/75-ButtonSwitch.png b/src/com/vaadin/demo/sampler/features/buttons/75-ButtonSwitch.png Binary files differdeleted file mode 100644 index 6df1b3935d..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/75-ButtonSwitch.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonLink.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonLink.java deleted file mode 100644 index 435dbdf5de..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonLink.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.buttons; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.blueprints.ProminentPrimaryAction; -import com.vaadin.demo.sampler.features.link.LinkCurrentWindow; -import com.vaadin.ui.Button; - -@SuppressWarnings("serial") -public class ButtonLink extends Feature { - - @Override - public String getName() { - return "Link button"; - } - - @Override - public String getDescription() { - return "A link-styled button works like a push button, but looks like" - + " a Link.<br/> It does not actually link somewhere, but" - + " triggers a server-side event, just like a regular button."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Button.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { ButtonPush.class, ButtonSwitch.class, - LinkCurrentWindow.class, ProminentPrimaryAction.class, - FeatureSet.Links.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java deleted file mode 100644 index f328c3dfac..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonLinkExample.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.demo.sampler.features.buttons; - -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class ButtonLinkExample extends VerticalLayout implements - Button.ClickListener { - - private static final String CAPTION = "Help"; - private static final String TOOLTIP = "Show help"; - private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_info.gif"); - private static final String NOTIFICATION = "Help clicked"; - - public ButtonLinkExample() { - setSpacing(true); - - // Button w/ text and tooltip - Button b = new Button(CAPTION); - b.setStyleName(Button.STYLE_LINK); - b.setDescription(TOOLTIP); - b.addListener(this); // react to clicks - addComponent(b); - - // Button w/ text, icon and tooltip - b = new Button(CAPTION); - b.setStyleName(Button.STYLE_LINK); - b.setDescription(TOOLTIP); - b.setIcon(ICON); - b.addListener(this); // react to clicks - addComponent(b); - - // Button w/ icon and tooltip - b = new Button(); - b.setStyleName(Button.STYLE_LINK); - b.setDescription(TOOLTIP); - b.setIcon(ICON); - b.addListener(this); // react to clicks - addComponent(b); - - } - - /* - * Shows a notification when a button is clicked. - */ - public void buttonClick(ClickEvent event) { - getWindow().showNotification(NOTIFICATION); - } -} diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonPush.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonPush.java deleted file mode 100644 index 37d2b4d6a1..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonPush.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.demo.sampler.features.buttons; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.blueprints.ProminentPrimaryAction; -import com.vaadin.ui.Button; - -@SuppressWarnings("serial") -public class ButtonPush extends Feature { - - @Override - public String getName() { - return "Push button"; - } - - @Override - public String getDescription() { - return "A push-button, which can be considered a 'regular' button," - + " returns to it's 'unclicked' state after emitting an event" - + " when the user clicks it."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Button.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { ButtonLink.class, ButtonSwitch.class, - ProminentPrimaryAction.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java deleted file mode 100644 index c9e3943770..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonPushExample.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.buttons; - -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class ButtonPushExample extends VerticalLayout implements - Button.ClickListener { - - private static final String CAPTION = "Save"; - private static final String TOOLTIP = "Save changes"; - private static final ThemeResource ICON = new ThemeResource("../sampler/icons/action_save.gif"); - private static final String NOTIFICATION = "Changes have been saved"; - - public ButtonPushExample() { - setSpacing(true); - - // Button w/ text and tooltip - Button b = new Button(CAPTION); - b.setDescription(TOOLTIP); - b.addListener(this); // react to clicks - addComponent(b); - - // Button w/ text, icon and tooltip - b = new Button(CAPTION); - b.setDescription(TOOLTIP); - b.setIcon(ICON); - b.addListener(this); // react to clicks - addComponent(b); - - // Button w/ icon and tooltip - b = new Button(); - b.setDescription(TOOLTIP); - b.setIcon(ICON); - b.addListener(this); // react to clicks - addComponent(b); - - } - - /* - * Shows a notification when a button is clicked. - */ - public void buttonClick(ClickEvent event) { - getWindow().showNotification(NOTIFICATION); - } -} diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitch.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitch.java deleted file mode 100644 index 5d0f56d51a..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitch.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.buttons; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Button; - -@SuppressWarnings("serial") -public class ButtonSwitch extends Feature { - - @Override - public String getName() { - return "Switch button"; - } - - @Override - public String getDescription() { - return "A switch button works like a regular push button, triggering" - + " a server-side event, but it's state is 'sticky': the button" - + " toggles between it's on and off states, instead of popping" - + " right back out.<br/>Also know as a CheckBox."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Button.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { ButtonPush.class, ButtonLink.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java b/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java deleted file mode 100644 index 3a9c8a8fdc..0000000000 --- a/src/com/vaadin/demo/sampler/features/buttons/ButtonSwitchExample.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.demo.sampler.features.buttons; - -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class ButtonSwitchExample extends VerticalLayout implements - Button.ClickListener { - - private static final String CAPTION = "Allow HTML"; - private static final String TOOLTIP = "Allow/disallow HTML in comments"; - private static final ThemeResource ICON = new ThemeResource("../sampler/icons/page_code.gif"); - - public ButtonSwitchExample() { - setSpacing(true); - - // Button w/ text and tooltip - Button b = new Button(CAPTION); - b.setSwitchMode(true); - b.setDescription(TOOLTIP); - b.addListener(this); // react to clicks - addComponent(b); - - // Button w/ text, icon and tooltip - b = new Button(CAPTION); - b.setSwitchMode(true); - b.setDescription(TOOLTIP); - b.setIcon(ICON); - b.addListener(this); // react to clicks - addComponent(b); - - // Button w/ icon and tooltip - b = new Button(); - b.setSwitchMode(true); - b.setDescription(TOOLTIP); - b.setIcon(ICON); - b.addListener(this); // react to clicks - addComponent(b); - - } - - /* - * Shows a notification when a button is clicked. - */ - public void buttonClick(ClickEvent event) { - boolean enabled = event.getButton().booleanValue(); - getWindow().showNotification( - "HTML " + (enabled ? "enabled" : "disabled")); - } -} diff --git a/src/com/vaadin/demo/sampler/features/commons/75-Errors.png b/src/com/vaadin/demo/sampler/features/commons/75-Errors.png Binary files differdeleted file mode 100644 index 26b29ce24f..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/75-Errors.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/commons/75-Icons.png b/src/com/vaadin/demo/sampler/features/commons/75-Icons.png Binary files differdeleted file mode 100644 index 23c733579b..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/75-Icons.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/commons/75-Tooltips.png b/src/com/vaadin/demo/sampler/features/commons/75-Tooltips.png Binary files differdeleted file mode 100644 index 217daeb920..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/75-Tooltips.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/commons/75-Validation.png b/src/com/vaadin/demo/sampler/features/commons/75-Validation.png Binary files differdeleted file mode 100644 index 058ec7db9f..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/75-Validation.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/commons/Errors.java b/src/com/vaadin/demo/sampler/features/commons/Errors.java deleted file mode 100644 index 7df9ec300f..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/Errors.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.form.FormBasic; -import com.vaadin.demo.sampler.features.notifications.NotificationError; -import com.vaadin.ui.AbstractComponent; - -@SuppressWarnings("serial") -public class Errors extends Feature { - - private static final String desc = "A <i>component error</i> can be set to" - + " indicate an error - an error indicator icon will appear," - + " and the error message will appear as a 'tooltip' when" - + " mousing over.<br/>" - + "You can do this on almost any component, but please note" - + " that from a usability standpoint it's not always the best" - + " solution.<br/>" - + "<i>Component error</i> is most useful to indicate what is" - + " causing the error (e.g an 'email' TextField), so that the user" - + " can find and correct the problem. <br/>" - + "On the other hand, it is usually not a good idea to set an error" - + " on a Button: the user can not click 'Save' differently to" - + " correct the error.<br/>" - + "If there is no component causing the error, consider using a" - + " (styled) Label or a Notification to indicate the error."; - - @Override - public String getName() { - return "Error indicator"; - } - - @Override - public String getDescription() { - return desc; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(AbstractComponent.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - // TODO link validation sample, form sample - return new Class[] { Validation.class, FormBasic.class, - NotificationError.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/commons/ErrorsExample.java b/src/com/vaadin/demo/sampler/features/commons/ErrorsExample.java deleted file mode 100644 index 89e53ee224..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/ErrorsExample.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class ErrorsExample extends VerticalLayout { - - public ErrorsExample() { - setSpacing(true); - - Panel panel = new Panel("Configure this"); - panel.setComponentError(new UserError("'Input' contains an error")); - addComponent(panel); - - TextField input = new TextField("Input"); - input - .setComponentError(new UserError( - "This field is never satisfied.")); - panel.addComponent(input); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/commons/Icons.java b/src/com/vaadin/demo/sampler/features/commons/Icons.java deleted file mode 100644 index dece0523cb..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/Icons.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.FileResource; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.StreamResource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Component; - -@SuppressWarnings("serial") -public class Icons extends Feature { - - @Override - public String getName() { - return "Icons"; - } - - @Override - public String getDescription() { - return "Most components can have an <i>icon</i>," - + " which is usually displayed next to the caption.<br/>" - + "When used correctly, icons can make it significantly" - + " easier for the user to find a specific functionality." - + " Beware of overuse, which will have the opposite effect."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Component.class), - new APIResource(Resource.class), - new APIResource(ApplicationResource.class), - new APIResource(ClassResource.class), - new APIResource(ExternalResource.class), - new APIResource(FileResource.class), - new APIResource(StreamResource.class), - new APIResource(ThemeResource.class) }; - } - - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - // TODO link embedded sample - return null; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/commons/IconsExample.java b/src/com/vaadin/demo/sampler/features/commons/IconsExample.java deleted file mode 100644 index 911e2338c3..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/IconsExample.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class IconsExample extends VerticalLayout { - - public IconsExample() { - setSpacing(true); - - /* Button w/ icon */ - Button button = new Button("Save"); - button.setIcon(new ThemeResource("../sampler/icons/action_save.gif")); - addComponent(button); - - /* Label */; - Label l = new Label("Icons are very handy"); - l.setCaption("Comment"); - l.setIcon(new ThemeResource("../sampler/icons/comment_yellow.gif")); - addComponent(l); - - /* Panel w/ links */ - Panel p = new Panel("Handy links"); - p.setIcon(new ThemeResource("../sampler/icons/icon_info.gif")); - addComponent(p); - Link lnk = new Link("http://www.vaadin.com", new ExternalResource( - "http://www.vaadin.com")); - lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif")); - p.addComponent(lnk); - lnk = new Link("http://www.vaadin.com/learn", new ExternalResource( - "http://www.vaadin.com/learn")); - lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif")); - p.addComponent(lnk); - lnk = new Link("http://dev.vaadin.com/", new ExternalResource( - "http://dev.vaadin.com/")); - lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif")); - p.addComponent(lnk); - lnk = new Link("http://www.vaadin.com/forum", new ExternalResource( - "http://www.vaadin.com/forum")); - lnk.setIcon(new ThemeResource("../sampler/icons/icon_world.gif")); - p.addComponent(lnk); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/commons/Tooltips.java b/src/com/vaadin/demo/sampler/features/commons/Tooltips.java deleted file mode 100644 index 73365d56df..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/Tooltips.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.AbstractComponent; - -@SuppressWarnings("serial") -public class Tooltips extends Feature { - - @Override - public String getName() { - return "Tooltips"; - } - - @Override - public String getDescription() { - return "Most components can have a <i>description</i>," - + " which is shown as a <i>\"tooltip\"</i>." - + " Descriptions may have formatted ('rich') content.<br/>" - + ""; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(AbstractComponent.class) }; - } - - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - // TODO Auto-generated method stub - return null; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/commons/TooltipsExample.java b/src/com/vaadin/demo/sampler/features/commons/TooltipsExample.java deleted file mode 100644 index 607e42681b..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/TooltipsExample.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.ui.Button; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class TooltipsExample extends VerticalLayout { - - private static final String editTxt = "Edit tooltip"; - private static final String applyTxt = "Apply"; - - public TooltipsExample() { - setSpacing(true); - - /* Plain tooltip (description) */ - Button plain = new Button("Mouse over for plain tooltip"); - plain.setStyleName(Button.STYLE_LINK); - // add the tooltip: - plain.setDescription("A simple plaintext tooltip"); - addComponent(plain); - - /* Richtext tooltip (description) */ - Button rich = new Button("Mouse over for richtext tooltip"); - rich.setStyleName(Button.STYLE_LINK); - // add the tooltip: - rich - .setDescription("<h2><img src=\"../VAADIN/themes/sampler/icons/comment_yellow.gif\"/>A richtext tooltip</h2>" - + "<ul>" - + "<li>HTML formatting</li><li>Images<br/>" - + "</li><li>etc...</li></ul>"); - addComponent(rich); - - /* Edit */ - final RichTextArea rte = new RichTextArea(); - rte.setValue("Click <b>" + editTxt - + "</b> to edit this tooltip, then <b>" + applyTxt + "</b>"); - rte.setVisible(false); // hide editor initially - addComponent(rte); - Button apply = new Button(editTxt, new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (rte.isVisible()) { - rte.setVisible(false); - event.getButton().setDescription((String) rte.getValue()); - event.getButton().setCaption(editTxt); - } else { - rte.setVisible(true); - event.getButton().setCaption(applyTxt); - } - } - }); - apply.setDescription((String) rte.getValue()); - addComponent(apply); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/commons/Validation.java b/src/com/vaadin/demo/sampler/features/commons/Validation.java deleted file mode 100644 index b8c0c22559..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/Validation.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import com.vaadin.data.Validatable; -import com.vaadin.data.Validator; -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.form.FormPojoExample; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; - -@SuppressWarnings("serial") -public class Validation extends Feature { - - @Override - public String getName() { - return "Validation"; - } - - private static final String desc = "Fields can have Validators that check" - + " entered values. This is most useful when used within a Form, but" - + " but can be used to validate single, stand-alone Fields as well."; - - @Override - public Component getExample() { - return new FormPojoExample(); - } - - @Override - public String getDescription() { - return desc; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Validatable.class), - new APIResource(Validator.class), new APIResource(Form.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { Errors.class, FeatureSet.Forms.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/commons/ValidationExample.java b/src/com/vaadin/demo/sampler/features/commons/ValidationExample.java deleted file mode 100644 index 1c88312d76..0000000000 --- a/src/com/vaadin/demo/sampler/features/commons/ValidationExample.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.vaadin.demo.sampler.features.commons; - -import java.util.HashSet; - -import com.vaadin.data.Validator; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.validator.CompositeValidator; -import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class ValidationExample extends VerticalLayout { - - HashSet<String> usernames = new HashSet<String>(); - - public ValidationExample() { - setSpacing(true); - - TextField pin = new TextField("PIN"); - pin.setWidth("50px"); - // optional; validate at once instead of when clicking 'save' (e.g) - pin.setImmediate(true); - addComponent(pin); - // add the validator - pin.addValidator(new StringLengthValidator("Must be 4-6 characters", 4, - 6, false)); - - TextField username = new TextField("Username"); - // optional; validate at once instead of when clicking 'save' (e.g) - username.setImmediate(true); - addComponent(username); - CompositeValidator usernameValidator = new CompositeValidator(); - username.addValidator(usernameValidator); - usernameValidator.addValidator(new StringLengthValidator( - "Username must be at least 4 characters", 4, 255, false)); - usernameValidator.addValidator(new Validator() { - - public boolean isValid(Object value) { - return !usernames.contains(value); - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new Validator.InvalidValueException("Username " - + value + " already in use"); - } - } - }); - username.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - TextField tf = (TextField) event.getProperty(); - tf.validate(); - if (tf.getValue() != null) { - usernames.add(tf.getValue().toString()); - addComponent(new Label("Added " + tf.getValue() - + " to usernames")); - } - } - }); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/dates/75-DateInline.png b/src/com/vaadin/demo/sampler/features/dates/75-DateInline.png Binary files differdeleted file mode 100644 index 4368f420a9..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/75-DateInline.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/dates/75-DateLocale.png b/src/com/vaadin/demo/sampler/features/dates/75-DateLocale.png Binary files differdeleted file mode 100644 index a608e59873..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/75-DateLocale.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/dates/75-DatePopup.png b/src/com/vaadin/demo/sampler/features/dates/75-DatePopup.png Binary files differdeleted file mode 100644 index 1030469dc2..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/75-DatePopup.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/dates/75-DateResolution.png b/src/com/vaadin/demo/sampler/features/dates/75-DateResolution.png Binary files differdeleted file mode 100644 index ca6ddcf16e..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/75-DateResolution.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/dates/DateInline.java b/src/com/vaadin/demo/sampler/features/dates/DateInline.java deleted file mode 100644 index ea47131952..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DateInline.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.InlineDateField;
-
-@SuppressWarnings("serial")
-public class DateInline extends Feature {
- @Override
- public String getName() {
- return "Inline date selection";
- }
-
- @Override
- public String getDescription() {
- return "In this example, the resolution is set to be one day"
- + " and the DateField component is shown as an inline calendar"
- + " component.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(DateField.class),
- new APIResource(InlineDateField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { DatePopup.class, DateLocale.class,
- DateResolution.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DateInlineExample.java b/src/com/vaadin/demo/sampler/features/dates/DateInlineExample.java deleted file mode 100644 index 9666ac49b9..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DateInlineExample.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import java.text.DateFormat;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.InlineDateField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class DateInlineExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private InlineDateField datetime;
-
- public DateInlineExample() {
- setSpacing(true);
-
- datetime = new InlineDateField("Please select the starting time:");
-
- // Set the value of the PopupDateField to current date
- datetime.setValue(new java.util.Date());
-
- // Set the correct resolution
- datetime.setResolution(InlineDateField.RESOLUTION_DAY);
-
- // Add valuechangelistener
- datetime.addListener(this);
- datetime.setImmediate(true);
-
- addComponent(datetime);
- }
-
- public void valueChange(ValueChangeEvent event) {
- // Get the new value and format it to the current locale
- DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT);
- String dateOut = dateFormatter.format(event.getProperty().getValue());
- // Show notification
- getWindow().showNotification("Starting date: " + dateOut);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DateLocale.java b/src/com/vaadin/demo/sampler/features/dates/DateLocale.java deleted file mode 100644 index cf3ef581a0..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DateLocale.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import java.util.Locale;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.InlineDateField;
-
-@SuppressWarnings("serial")
-public class DateLocale extends Feature {
- @Override
- public String getName() {
- return "Date selection, locale";
- }
-
- @Override
- public String getDescription() {
- return "In this example, you can select a different locale"
- + " from the combo box and see how the calendar component"
- + " is localized.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(DateField.class),
- new APIResource(InlineDateField.class),
- new APIResource(Locale.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { DateInline.class, DatePopup.class,
- DateResolution.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DateLocaleExample.java b/src/com/vaadin/demo/sampler/features/dates/DateLocaleExample.java deleted file mode 100644 index 86bf451c35..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DateLocaleExample.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import java.util.Locale;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.InlineDateField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class DateLocaleExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private InlineDateField datetime;
- private ComboBox localeSelection;
-
- public DateLocaleExample() {
- setSpacing(true);
-
- datetime = new InlineDateField("Please select the starting time:");
-
- // Set the value of the PopupDateField to current date
- datetime.setValue(new java.util.Date());
-
- // Set the correct resolution
- datetime.setResolution(InlineDateField.RESOLUTION_MIN);
- datetime.setImmediate(true);
-
- // Create selection and fill it with locales
- localeSelection = new ComboBox("Select date format:");
- localeSelection.addListener(this);
- localeSelection.setImmediate(true);
- localeSelection
- .setContainerDataSource(ExampleUtil.getLocaleContainer());
-
- addComponent(datetime);
- addComponent(localeSelection);
- }
-
- public void valueChange(ValueChangeEvent event) {
- Item selected = localeSelection.getItem(event.getProperty().getValue());
- datetime.setLocale((Locale) selected.getItemProperty(
- ExampleUtil.locale_PROPERTY_LOCALE).getValue());
- datetime.requestRepaint();
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DatePopup.java b/src/com/vaadin/demo/sampler/features/dates/DatePopup.java deleted file mode 100644 index a5c3393131..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DatePopup.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.PopupDateField;
-
-@SuppressWarnings("serial")
-public class DatePopup extends Feature {
- @Override
- public String getName() {
- return "Pop-up date selection";
- }
-
- @Override
- public String getDescription() {
- return "In this example, the resolution is set to be one day"
- + " and the DateField component is shown as a calendar pop-up.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(DateField.class),
- new APIResource(PopupDateField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { DateInline.class, DateLocale.class,
- DateResolution.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DatePopupExample.java b/src/com/vaadin/demo/sampler/features/dates/DatePopupExample.java deleted file mode 100644 index b1deade8d1..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DatePopupExample.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import java.text.DateFormat;
-import java.util.Date;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.PopupDateField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class DatePopupExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private PopupDateField datetime;
-
- public DatePopupExample() {
- setSpacing(true);
-
- datetime = new PopupDateField("Please select the starting time:");
-
- // Set the value of the PopupDateField to current date
- datetime.setValue(new java.util.Date());
-
- // Set the correct resolution
- datetime.setResolution(PopupDateField.RESOLUTION_DAY);
-
- // Add valuechangelistener
- datetime.addListener(this);
- datetime.setImmediate(true);
-
- addComponent(datetime);
- }
-
- public void valueChange(ValueChangeEvent event) {
- // Get the new value and format it to the current locale
- DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT);
- Object value = event.getProperty().getValue();
- if (value == null || !(value instanceof Date)) {
- getWindow().showNotification("Invalid date entered");
- } else {
- String dateOut = dateFormatter.format(value);
- // Show notification
- getWindow().showNotification("Starting date: " + dateOut);
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DateResolution.java b/src/com/vaadin/demo/sampler/features/dates/DateResolution.java deleted file mode 100644 index d4d64e0357..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DateResolution.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.InlineDateField;
-
-@SuppressWarnings("serial")
-public class DateResolution extends Feature {
- @Override
- public String getName() {
- return "Date selection, resolution";
- }
-
- @Override
- public String getDescription() {
- return "In this example, you can select a different resolution"
- + " from the combo box and see how the calendar component"
- + " changes.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(DateField.class),
- new APIResource(InlineDateField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { DateInline.class, DatePopup.class,
- DateLocale.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/dates/DateResolutionExample.java b/src/com/vaadin/demo/sampler/features/dates/DateResolutionExample.java deleted file mode 100644 index 154c091151..0000000000 --- a/src/com/vaadin/demo/sampler/features/dates/DateResolutionExample.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.vaadin.demo.sampler.features.dates;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.InlineDateField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class DateResolutionExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- public static final Object resolution_PROPERTY_NAME = "name";
- // Resolution fields from DateField
- private static final int[] resolutions = { InlineDateField.RESOLUTION_YEAR,
- InlineDateField.RESOLUTION_MONTH, InlineDateField.RESOLUTION_DAY,
- InlineDateField.RESOLUTION_HOUR, InlineDateField.RESOLUTION_MIN,
- InlineDateField.RESOLUTION_SEC, InlineDateField.RESOLUTION_MSEC };
- private static final String[] resolutionNames = { "Year", "Month", "Day",
- "Hour", "Minute", "Second", "Millisecond" };
-
- private InlineDateField datetime;
- private ComboBox localeSelection;
-
- public DateResolutionExample() {
- setSpacing(true);
-
- datetime = new InlineDateField("Please select the starting time:");
-
- // Set the value of the PopupDateField to current date
- datetime.setValue(new java.util.Date());
-
- // Set the correct resolution
- datetime.setResolution(InlineDateField.RESOLUTION_DAY);
- datetime.setImmediate(true);
-
- // Create selection
- localeSelection = new ComboBox("Select resolution:");
- localeSelection.setNullSelectionAllowed(false);
- localeSelection.addListener(this);
- localeSelection.setImmediate(true);
-
- // Fill the selection with choices, set captions correctly
- localeSelection.setContainerDataSource(getResolutionContainer());
- localeSelection.setItemCaptionPropertyId(resolution_PROPERTY_NAME);
- localeSelection.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY);
-
- addComponent(datetime);
- addComponent(localeSelection);
- }
-
- public void valueChange(ValueChangeEvent event) {
- datetime.setResolution((Integer) event.getProperty().getValue());
- datetime.requestRepaint();
- }
-
- private IndexedContainer getResolutionContainer() {
- IndexedContainer resolutionContainer = new IndexedContainer();
- resolutionContainer.addContainerProperty(resolution_PROPERTY_NAME,
- String.class, null);
- for (int i = 0; i < resolutions.length; i++) {
- Item added = resolutionContainer.addItem(resolutions[i]);
- added.getItemProperty(resolution_PROPERTY_NAME).setValue(
- resolutionNames[i]);
- }
- return resolutionContainer;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/form/75-FormBasic.png b/src/com/vaadin/demo/sampler/features/form/75-FormBasic.png Binary files differdeleted file mode 100644 index 5044c729a6..0000000000 --- a/src/com/vaadin/demo/sampler/features/form/75-FormBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/form/75-FormPojo.png b/src/com/vaadin/demo/sampler/features/form/75-FormPojo.png Binary files differdeleted file mode 100644 index df237b7cfc..0000000000 --- a/src/com/vaadin/demo/sampler/features/form/75-FormPojo.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/form/FormBasic.java b/src/com/vaadin/demo/sampler/features/form/FormBasic.java deleted file mode 100644 index 4aa6e1a7fc..0000000000 --- a/src/com/vaadin/demo/sampler/features/form/FormBasic.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.demo.sampler.features.form; - -import com.vaadin.data.Validatable; -import com.vaadin.data.Validator; -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.commons.Errors; -import com.vaadin.demo.sampler.features.commons.Validation; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; - -@SuppressWarnings("serial") -public class FormBasic extends Feature { - - @Override - public String getName() { - return "Form"; - } - - @Override - public Component getExample() { - return new FormPojoExample(); - } - - @Override - public String getDescription() { - return "A Form is most useful when connected to a data source, and" - + " provides buffering and customization features to support" - + " that scenario. A Form can easily be used as a POJO" - + " or Bean editor by wrapping the bean using BeanItem. <br/>" - + "The basic functionality only requires a couple of lines of" - + " code, then Validators and other customizations can be " - + "applied to taste. <br/>Enter something and try discarding or " - + "applying."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Validatable.class), - new APIResource(Validator.class), new APIResource(Form.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { Validation.class, Errors.class, - FeatureSet.Forms.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/form/FormPojo.java b/src/com/vaadin/demo/sampler/features/form/FormPojo.java deleted file mode 100644 index 42b6e5506f..0000000000 --- a/src/com/vaadin/demo/sampler/features/form/FormPojo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.demo.sampler.features.form; - -import com.vaadin.data.Validatable; -import com.vaadin.data.Validator; -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.commons.Errors; -import com.vaadin.demo.sampler.features.commons.Validation; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; - -@SuppressWarnings("serial") -public class FormPojo extends Feature { - - @Override - public String getName() { - return "Bean-bound form"; - } - - @Override - public Component getExample() { - return new FormPojoExample(); - } - - @Override - public String getDescription() { - return "A Form can easily be used as a POJO or Bean editor by wrapping the" - + " bean using BeanItem. The basic functionality only requires" - + " a couple of lines of code, then Validators and other" - + " customizations can be applied to taste."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Validatable.class), - new APIResource(Validator.class), new APIResource(Form.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { Validation.class, Errors.class, - FeatureSet.Forms.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/form/FormPojoExample.java b/src/com/vaadin/demo/sampler/features/form/FormPojoExample.java deleted file mode 100644 index e7e83c9c40..0000000000 --- a/src/com/vaadin/demo/sampler/features/form/FormPojoExample.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.vaadin.demo.sampler.features.form; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.Date; -import java.util.UUID; - -import com.vaadin.data.Item; -import com.vaadin.data.Validator; -import com.vaadin.data.util.BeanItem; -import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.demo.sampler.ExampleUtil; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class FormPojoExample extends VerticalLayout { - - // the 'POJO' we're editing - Person person; - - public FormPojoExample() { - - person = new Person(); // a person POJO - BeanItem personItem = new BeanItem(person); // item from POJO - - // Create the Form - final Form personForm = new Form(); - personForm.setWriteThrough(false); // we want explicit 'apply' - personForm.setInvalidCommitted(false); // no invalid values in datamodel - - // FieldFactory for customizing the fields and adding validators - personForm.setFormFieldFactory(new PersonFieldFactory()); - personForm.setItemDataSource(personItem); // bind to POJO via BeanItem - - // Determines which properties are shown, and in which order: - personForm.setVisibleItemProperties(Arrays.asList(new String[] { - "firstName", "lastName", "countryCode", "password", - "birthdate", "shoesize", "uuid" })); - - // Add form to layout - addComponent(personForm); - - // The cancel / apply buttons - HorizontalLayout buttons = new HorizontalLayout(); - buttons.setSpacing(true); - Button discardChanges = new Button("Discard changes", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - personForm.discard(); - } - }); - discardChanges.setStyleName(Button.STYLE_LINK); - buttons.addComponent(discardChanges); - - Button apply = new Button("Apply", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - try { - personForm.commit(); - } catch (Exception e) { - // Ingnored, we'll let the Form handle the errors - } - } - }); - buttons.addComponent(apply); - personForm.getLayout().addComponent(buttons); - - // button for showing the internal state of the POJO - Button showPojoState = new Button("Show POJO internal state", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - showPojoState(); - } - }); - addComponent(showPojoState); - } - - private void showPojoState() { - Window.Notification n = new Window.Notification("POJO state", - Window.Notification.TYPE_TRAY_NOTIFICATION); - n.setPosition(Window.Notification.POSITION_CENTERED); - n.setDescription("First name: " + person.getFirstName() - + "<br/>Last name: " + person.getLastName() + "<br/>Country: " - + person.getCountryCode() + "<br/>Birthdate: " - + person.getBirthdate() + "<br/>Shoe size: " - + +person.getShoesize() + "<br/>Password: " - + person.getPassword() + "<br/>UUID: " + person.getUuid()); - getWindow().showNotification(n); - } - - private class PersonFieldFactory extends DefaultFieldFactory { - - final ComboBox countries = new ComboBox("Country"); - - public PersonFieldFactory() { - countries.setWidth("30em"); - countries.setContainerDataSource(ExampleUtil.getISO3166Container()); - countries - .setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME); - countries.setItemIconPropertyId(ExampleUtil.iso3166_PROPERTY_FLAG); - countries.setFilteringMode(ComboBox.FILTERINGMODE_STARTSWITH); - } - - @Override - public Field createField(Item item, Object propertyId, - Component uiContext) { - if ("countryCode".equals(propertyId)) { - // filtering ComboBox w/ country names - return countries; - } - Field f = super.createField(item, propertyId, uiContext); - if ("firstName".equals(propertyId)) { - TextField tf = (TextField) f; - tf.setRequired(true); - tf.setRequiredError("Please enter a First Name"); - tf.setWidth("15em"); - tf.addValidator(new StringLengthValidator( - "First Name must be 3-25 characters", 3, 25, false)); - } else if ("lastName".equals(propertyId)) { - TextField tf = (TextField) f; - tf.setRequired(true); - tf.setRequiredError("Please enter a Last Name"); - tf.setWidth("20em"); - tf.addValidator(new StringLengthValidator( - "Last Name must be 3-50 characters", 3, 50, false)); - } else if ("password".equals(propertyId)) { - TextField tf = (TextField) f; - tf.setSecret(true); - tf.setRequired(true); - tf.setRequiredError("Please enter a password"); - tf.setWidth("10em"); - tf.addValidator(new StringLengthValidator( - "Password must be 6-20 characters", 6, 20, false)); - } else if ("shoesize".equals(propertyId)) { - TextField tf = (TextField) f; - tf.addValidator(new IntegerValidator( - "Shoe size must be an Integer")); - tf.setWidth("2em"); - } else if ("uuid".equals(propertyId)) { - TextField tf = (TextField) f; - tf.setWidth("20em"); - } - - return f; - } - } - - public class Person implements Serializable { - - private String firstName = ""; - private String lastName = ""; - private Date birthdate; - private int shoesize = 42; - private String password = ""; - private UUID uuid; - private String countryCode = ""; - - public Person() { - uuid = UUID.fromString("3856c3da-ea56-4717-9f58-85f6c5f560a5"); - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public Date getBirthdate() { - return birthdate; - } - - public void setBirthdate(Date birthdate) { - this.birthdate = birthdate; - } - - public int getShoesize() { - return shoesize; - } - - public void setShoesize(int shoesize) { - this.shoesize = shoesize; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public UUID getUuid() { - return uuid; - } - - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - - } - - public class IntegerValidator implements Validator { - - private String message; - - public IntegerValidator(String message) { - this.message = message; - } - - public boolean isValid(Object value) { - if (value == null || !(value instanceof String)) { - return false; - } - try { - Integer.parseInt((String) value); - } catch (Exception e) { - return false; - } - return true; - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException(message); - } - } - - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-ApplicationLayout.png b/src/com/vaadin/demo/sampler/features/layouts/75-ApplicationLayout.png Binary files differdeleted file mode 100644 index ee1d0a1c78..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-ApplicationLayout.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-CssLayouts.png b/src/com/vaadin/demo/sampler/features/layouts/75-CssLayouts.png Binary files differdeleted file mode 100644 index 6d269afb81..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-CssLayouts.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-CustomLayouts.png b/src/com/vaadin/demo/sampler/features/layouts/75-CustomLayouts.png Binary files differdeleted file mode 100644 index a37e342d9e..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-CustomLayouts.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-ExpandingComponent.png b/src/com/vaadin/demo/sampler/features/layouts/75-ExpandingComponent.png Binary files differdeleted file mode 100644 index dcc9ac5550..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-ExpandingComponent.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-GridLayoutBasic.png b/src/com/vaadin/demo/sampler/features/layouts/75-GridLayoutBasic.png Binary files differdeleted file mode 100644 index a9c298cf3f..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-GridLayoutBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-HorizontalLayoutBasic.png b/src/com/vaadin/demo/sampler/features/layouts/75-HorizontalLayoutBasic.png Binary files differdeleted file mode 100644 index d83a7183d5..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-HorizontalLayoutBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-LayoutAlignment.png b/src/com/vaadin/demo/sampler/features/layouts/75-LayoutAlignment.png Binary files differdeleted file mode 100644 index 3aedc76879..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-LayoutAlignment.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-LayoutMargin.png b/src/com/vaadin/demo/sampler/features/layouts/75-LayoutMargin.png Binary files differdeleted file mode 100644 index 802ef00a86..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-LayoutMargin.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-LayoutSpacing.png b/src/com/vaadin/demo/sampler/features/layouts/75-LayoutSpacing.png Binary files differdeleted file mode 100644 index 502bdc169b..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-LayoutSpacing.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-SplitPanelBasic.png b/src/com/vaadin/demo/sampler/features/layouts/75-SplitPanelBasic.png Binary files differdeleted file mode 100644 index 562d6af32b..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-SplitPanelBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-VerticalLayoutBasic.png b/src/com/vaadin/demo/sampler/features/layouts/75-VerticalLayoutBasic.png Binary files differdeleted file mode 100644 index 2e6bf6b484..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-VerticalLayoutBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/75-WebLayout.png b/src/com/vaadin/demo/sampler/features/layouts/75-WebLayout.png Binary files differdeleted file mode 100644 index a9405c768c..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/75-WebLayout.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/layouts/ApplicationLayout.java b/src/com/vaadin/demo/sampler/features/layouts/ApplicationLayout.java deleted file mode 100644 index 919e6d1ae0..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/ApplicationLayout.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ApplicationLayout extends Feature {
-
- @Override
- public String getName() {
- return "Application-style layout";
- }
-
- @Override
- public String getDescription() {
- return "It can be helpful to distinguish between <i>web-style</i> and"
- + " <i>application-style</i> layouting (although this is a"
- + " simplification). Both styles are supported, and can be used"
- + " simultaneously.<br/> Application-style layouting uses relatively"
- + " -sized components, growing dynamically with the window, and"
- + " causing scrollbars to appear on well-defined areas within the"
- + " window."
- + "<br/>Try resizing the window to see how the content reacts.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(HorizontalLayout.class),
- new APIResource(VerticalLayout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { WebLayout.class, CustomLayouts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/ApplicationLayoutExample.java b/src/com/vaadin/demo/sampler/features/layouts/ApplicationLayoutExample.java deleted file mode 100644 index 64be08f74b..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/ApplicationLayoutExample.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import java.util.Iterator;
-
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window.CloseEvent;
-
-@SuppressWarnings("serial")
-public class ApplicationLayoutExample extends VerticalLayout {
-
- Window win = new ApplicationLayoutWindow();
- Button open = new Button("Open sample in subwindow");
-
- public ApplicationLayoutExample() {
- setMargin(true);
-
- // We'll open this example in a separate window, configure it
- win.setWidth("70%");
- win.setHeight("70%");
- win.center();
- // Allow opening window again when closed
- win.addListener(new Window.CloseListener() {
- public void windowClose(CloseEvent e) {
- open.setEnabled(true);
- }
- });
-
- // 'open sample' button
- addComponent(open);
- open.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- getWindow().addWindow(win);
- open.setEnabled(false);
- }
- });
- addComponent(new Label(
- ("Don't worry: the content of the window is not supposed to make sense...")));
-
- }
-
- class ApplicationLayoutWindow extends Window {
- ApplicationLayoutWindow() {
- // Our main layout is a horizontal layout
- HorizontalLayout main = new HorizontalLayout();
- main.setSizeFull();
- setContent(main);
-
- // Tree to the left
- Panel treePanel = new Panel(); // for scrollbars
- treePanel.setStyleName(Panel.STYLE_LIGHT);
- treePanel.setHeight("100%");
- treePanel.setWidth(null);
- treePanel.getContent().setSizeUndefined();
- addComponent(treePanel);
-
- Tree tree = new Tree();
- tree.setContainerDataSource(ExampleUtil.getHardwareContainer());
- tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);
- for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {
- tree.expandItemsRecursively(it.next());
- }
- treePanel.addComponent(tree);
-
- // vertically divide the right area
- VerticalLayout left = new VerticalLayout();
- left.setSizeFull();
- addComponent(left);
- main.setExpandRatio(left, 1.0f); // use all available space
-
- // table on top
- Table tbl = new Table();
- tbl.setWidth("100%");
- tbl.setContainerDataSource(ExampleUtil.getISO3166Container());
- tbl.setSortDisabled(true);
- tbl.setPageLength(7);
- left.addComponent(tbl);
-
- // Label on bottom
- Panel textPanel = new Panel(); // for scrollbars
- textPanel.setStyleName(Panel.STYLE_LIGHT);
- textPanel.setSizeFull();
- left.addComponent(textPanel);
- left.setExpandRatio(textPanel, 1.0f); // use all available space
-
- Label text = new Label(ExampleUtil.lorem, Label.CONTENT_XHTML);
- text.setWidth("500px"); // some limit is good for text
- textPanel.addComponent(text);
-
- }
- }
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java b/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java deleted file mode 100644 index d7a7165752..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/CssLayouts.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class CssLayouts extends Feature {
-
- @Override
- public String getName() {
- return "Css layout";
- }
-
- @Override
- public String getDescription() {
- return "Most commonly developers using Vaadin don't want to think "
- + "of the browser environment at all. With the flexible "
- + "layout API found from Grid, Horizontal and Vertical "
- + "layouts, developers can build almost anything with plain "
- + "Java. But sometimes experienced web developers miss the "
- + "flexibility that pure CSS and HTML can offer.<br /><br />"
- + "CssLayout is a simple layout that places its contained "
- + "components into a <code>DIV</code> element. It has a "
- + "simple DOM structure and it leaves all the power to the "
- + "CSS designer's hands. While having a very narrow feature "
- + "set, CssLayout is the fastest layout to render in Vaadin.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(HorizontalLayout.class),
- new APIResource(VerticalLayout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ApplicationLayout.class, CustomLayouts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] { new NamedExternalResource(
- "CSS for the layout", getThemeBase() + "layouts/cssexample.css") };
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java b/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java deleted file mode 100644 index 9e3d5aa3a9..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/CssLayoutsExample.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.ui.Component;
-import com.vaadin.ui.CssLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class CssLayoutsExample extends VerticalLayout {
-
- public CssLayoutsExample() {
- setMargin(true);
-
- /*
- * Note, that this code example may not be self explanatory without
- * checking out the related CSS file in the sampler theme.
- */
-
- final Panel panel = new Panel("Panel");
- panel.setStyleName("floatedpanel");
- panel.setWidth("30%");
- panel.setHeight("370px");
- panel.addComponent(new Label("This panel is 30% wide "
- + "and 370px high (defined on the server side) "
- + "and floated right (with custom css). "
- + "Try resizing the browser window to see "
- + "how the black boxes (floated left) "
- + "behave. Every third of them has colored text "
- + "to demonstrate the dynamic css injection."));
-
- final Label bottomCenter = new Label(
- "I'm a 3 inches wide footer at the bottom of the layout");
- bottomCenter.setSizeUndefined(); // disable 100% default width
- bottomCenter.setStyleName("footer");
-
- CssLayout cssLayout = new CssLayout() {
- int brickCounter = 0;
-
- @Override
- protected String getCss(Component c) {
- // colorize every third rendered brick
- if (c instanceof Brick) {
- brickCounter++;
- if (brickCounter % 3 == 0) {
- // make every third brick colored and italic
- return "color: #ff6611; font-style: italic;";
- }
- }
- return null;
- }
- };
-
- cssLayout.setWidth("100%");
-
- cssLayout.addComponent(panel);
- for (int i = 0; i < 15; i++) {
- // add black labels that float left
- cssLayout.addComponent(new Brick());
- }
- cssLayout.addComponent(bottomCenter);
-
- addComponent(cssLayout);
- }
-
- /**
- * A simple label containing text "Brick" and themed black square.
- */
- static class Brick extends Label {
- public Brick() {
- super("Brick");
- // disable 100% width that label has by default
- setSizeUndefined();
- setStyleName("brick");
- }
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/layouts/CustomLayouts.java b/src/com/vaadin/demo/sampler/features/layouts/CustomLayouts.java deleted file mode 100644 index c21de24577..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/CustomLayouts.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.CustomLayout;
-
-@SuppressWarnings("serial")
-public class CustomLayouts extends Feature {
-
- @Override
- public String getName() {
- return "Custom layout";
- }
-
- @Override
- public String getDescription() {
- return "The CustomLayout allows you to make a layout in regular HTML,"
- + " using styles and embedding images to suit your needs."
- + " You can even make the layout using a WYSIWYG editor.<br/>"
- + " Marking an area in the HTML as a named <i>location</i>"
- + " will allow you to replace that area with a component later."
- + "<br/>HTML prototypes can often be quickly converted into a"
- + " working application this way, providing a clear path from"
- + " design to implementation.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(CustomLayout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { WebLayout.class, ApplicationLayout.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] { new NamedExternalResource(
- "Layout HTML (view source)", getThemeBase()
- + "layouts/examplecustomlayout.html") };
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java b/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java deleted file mode 100644 index e759ea5421..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/CustomLayoutsExample.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class CustomLayoutsExample extends VerticalLayout {
-
- public CustomLayoutsExample() {
- setMargin(true);
-
- // Create the custom layout and set it as a component in
- // the current layout
- CustomLayout custom = new CustomLayout(
- "../../sampler/layouts/examplecustomlayout");
- addComponent(custom);
-
- // Create components and bind them to the location tags
- // in the custom layout.
- TextField username = new TextField();
- custom.addComponent(username, "username");
-
- TextField password = new TextField();
- password.setSecret(true);
- custom.addComponent(password, "password");
-
- Button ok = new Button("Login");
- custom.addComponent(ok, "okbutton");
- }
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/layouts/ExpandingComponent.java b/src/com/vaadin/demo/sampler/features/layouts/ExpandingComponent.java deleted file mode 100644 index 26dcb33c8f..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/ExpandingComponent.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.HorizontalLayout;
-
-@SuppressWarnings("serial")
-public class ExpandingComponent extends Feature {
-
- @Override
- public String getName() {
- return "Expanding components";
- }
-
- @Override
- public String getDescription() {
- return "You can <i>expand</i> components to make them"
- + " occupy the space left over by other components.<br/>"
- + " If more than one component is expanded, the <i>ratio</i>"
- + " determines how the leftover space is shared between the"
- + " expanded components.<br/>Mousover each component for a"
- + " description (tooltip).<br/> Also try resizing the window.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(HorizontalLayout.class),
-
- };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] {};
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/ExpandingComponentExample.java b/src/com/vaadin/demo/sampler/features/layouts/ExpandingComponentExample.java deleted file mode 100644 index fd18f27d65..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/ExpandingComponentExample.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ExpandingComponentExample extends VerticalLayout {
-
- public ExpandingComponentExample() {
- setSpacing(true);
-
- { // Basic scenario: single expanded component
- HorizontalLayout layout = new HorizontalLayout();
- layout.setWidth("100%"); // make the layout grow with the window
- // size
- addComponent(layout);
-
- Button naturalButton = new Button("Natural");
- naturalButton
- .setDescription("This button does not have an explicit size - instead, its size depends on it's content - a.k.a <i>natural size.</i>");
- layout.addComponent(naturalButton);
-
- Button expandedButton = new Button("Expanded");
- expandedButton.setWidth("100%");
- expandedButton
- .setDescription("The width of this button is set to 100% and expanded, and will thus occupy the space left over by the other components.");
- layout.addComponent(expandedButton);
- layout.setExpandRatio(expandedButton, 1.0f);
-
- Button sizedButton = new Button("Explicit");
- sizedButton.setWidth("150px");
- sizedButton
- .setDescription("This button is explicitly set to be 150 pixels wide.");
- layout.addComponent(sizedButton);
- }
-
- { // Ratio example
- HorizontalLayout layout = new HorizontalLayout();
- layout.setWidth("100%"); // make the layout grow with the window
- // size
- addComponent(layout);
-
- Button naturalButton = new Button("Natural");
- naturalButton
- .setDescription("This button does not have an explicit size - instead, its size depends on it's content - a.k.a <i>natural size.</i>");
- layout.addComponent(naturalButton);
-
- Button expandedButton1 = new Button("Ratio 1.0");
- expandedButton1.setWidth("100%");
- expandedButton1
- .setDescription("The width of this button is set to 100% and expanded with a ratio of 1.0, and will in this example occupy 1:3 of the leftover space.");
- layout.addComponent(expandedButton1);
- layout.setExpandRatio(expandedButton1, 1.0f);
-
- Button expandedButton2 = new Button("Ratio 2.0");
- expandedButton2.setWidth("100%");
- expandedButton2
- .setDescription("The width of this button is set to 100% and expanded with a ratio of 2.0, and will in this example occupy 2:3 of the leftover space.");
- layout.addComponent(expandedButton2);
- layout.setExpandRatio(expandedButton2, 2.0f);
- }
-
- }
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/layouts/GridLayoutBasic.java b/src/com/vaadin/demo/sampler/features/layouts/GridLayoutBasic.java deleted file mode 100644 index b8215b3139..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/GridLayoutBasic.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.GridLayout;
-
-@SuppressWarnings("serial")
-public class GridLayoutBasic extends Feature {
-
- @Override
- public String getName() {
- return "Grid layout";
- }
-
- @Override
- public String getDescription() {
- return "The GridLayout allows you to create a grid of components."
- + " The grid may have an arbitrary number of cells in each direction"
- + " and you can easily set components to fill multiple cells.<br/>It supports all basic features, plus some advanced stuff - including spacing, margin, alignment, and expand ratios.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(GridLayout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { HorizontalLayoutBasic.class,
- VerticalLayoutBasic.class, LayoutSpacing.class,
- LayoutMargin.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] { new NamedExternalResource(
- "CSS for the layout", getThemeBase()
- + "layouts/gridexample.css") };
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/GridLayoutBasicExample.java b/src/com/vaadin/demo/sampler/features/layouts/GridLayoutBasicExample.java deleted file mode 100644 index c56b5645e1..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/GridLayoutBasicExample.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.terminal.Sizeable;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class GridLayoutBasicExample extends VerticalLayout {
-
- public GridLayoutBasicExample() {
- // Create a grid layout
- final GridLayout grid = new GridLayout(3, 3);
- grid.setSpacing(true);
-
- // The style allows us to visualize the cell borders in this example.
- grid.addStyleName("gridexample");
-
- grid.setWidth(400, Sizeable.UNITS_PIXELS);
- grid.setHeight(400, Sizeable.UNITS_PIXELS);
-
- // First we insert four components that occupy one cell each
- Button topleft = new Button("Top Left");
- grid.addComponent(topleft, 0, 0);
- grid.setComponentAlignment(topleft, Alignment.MIDDLE_CENTER);
-
- Button topcenter = new Button("Top Center");
- grid.addComponent(topcenter, 1, 0);
- grid.setComponentAlignment(topcenter, Alignment.MIDDLE_CENTER);
-
- Button bottomleft = new Button("Bottom Left");
- grid.addComponent(bottomleft, 0, 2);
- grid.setComponentAlignment(bottomleft, Alignment.MIDDLE_CENTER);
-
- Button bottomcenter = new Button("Bottom Center");
- grid.addComponent(bottomcenter, 1, 2);
- grid.setComponentAlignment(bottomcenter, Alignment.MIDDLE_CENTER);
-
- // Insert a component that occupies all the rightmost cells
- Button topright = new Button("Extra height");
- grid.addComponent(topright, 2, 0, 2, 2);
- grid.setComponentAlignment(topright, Alignment.MIDDLE_CENTER);
-
- // Insert a component that occupies two cells in horizontal direction
- Button middleleft = new Button("This is a wide cell in GridLayout");
- grid.addComponent(middleleft, 0, 1, 1, 1);
- grid.setComponentAlignment(middleleft, Alignment.MIDDLE_CENTER);
-
- // Add the layout to the containing layout.
- addComponent(grid);
-
- // Align the grid itself within its container layout.
- setComponentAlignment(grid, Alignment.MIDDLE_CENTER);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/HorizontalLayoutBasic.java b/src/com/vaadin/demo/sampler/features/layouts/HorizontalLayoutBasic.java deleted file mode 100644 index 4f72e20026..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/HorizontalLayoutBasic.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.HorizontalLayout; - -@SuppressWarnings("serial") -public class HorizontalLayoutBasic extends Feature { - - @Override - public String getName() { - return "Horizontal layout"; - } - - @Override - public String getDescription() { - return "The HorizontalLayout arranges components horizontally.<br/>It supports all basic features, plus some advanced stuff - including spacing, margin, alignment, and expand ratios."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(HorizontalLayout.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { VerticalLayoutBasic.class, LayoutSpacing.class, - LayoutAlignment.class, }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/HorizontalLayoutBasicExample.java b/src/com/vaadin/demo/sampler/features/layouts/HorizontalLayoutBasicExample.java deleted file mode 100644 index 047aba949d..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/HorizontalLayoutBasicExample.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; - -@SuppressWarnings("serial") -public class HorizontalLayoutBasicExample extends HorizontalLayout { - - public HorizontalLayoutBasicExample() { - // this is a HorizontalLayout - - // First TextField - TextField tf = new TextField(); - tf.setWidth("70px"); - addComponent(tf); - - // A dash - Label dash = new Label("-"); - addComponent(dash); - setComponentAlignment(dash, "middle"); - - // Second TextField - tf = new TextField(); - tf.setWidth("70px"); - addComponent(tf); - - // Another dash - dash = new Label("-"); - addComponent(dash); - setComponentAlignment(dash, "middle"); - - // Third TextField - tf = new TextField(); - tf.setWidth("70px"); - addComponent(tf); - - // Yet another dash - dash = new Label("-"); - addComponent(dash); - setComponentAlignment(dash, "middle"); - - // Forth and last TextField - tf = new TextField(); - tf.setWidth("70px"); - addComponent(tf); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/LayoutAlignment.java b/src/com/vaadin/demo/sampler/features/layouts/LayoutAlignment.java deleted file mode 100644 index 337134f457..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/LayoutAlignment.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LayoutAlignment extends Feature { - - @Override - public String getName() { - return "Component alignment"; - } - - @Override - public String getDescription() { - return "GridLayout, VerticalLayout, and HorizontalLayout, " - + "which are tabular layouts consisting of cells, " - + "support alignment of components within the layout cells. " - + "The alignment of a component within its respective cell " - + "is set with setComponentAlignment()."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(VerticalLayout.class), - new APIResource(HorizontalLayout.class), - new APIResource(GridLayout.class), }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { HorizontalLayoutBasic.class, - VerticalLayoutBasic.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/LayoutAlignmentExample.java b/src/com/vaadin/demo/sampler/features/layouts/LayoutAlignmentExample.java deleted file mode 100644 index 9dd14f04cc..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/LayoutAlignmentExample.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.terminal.gwt.client.ui.AlignmentInfo.Bits; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LayoutAlignmentExample extends VerticalLayout { - - public LayoutAlignmentExample() { - // Create a grid layout - final GridLayout grid = new GridLayout(1, 9); - grid.setSpacing(true); - - // The style allows us to visualize the cell borders in this example. - grid.addStyleName("gridexample"); - - grid.setWidth("300px"); - grid.setHeight("500px"); - - // Put a component in each cell with respective alignment. - // We'll use different ways to set the alignment: constants, bitmasks, - // and string-shorthand. - - // Here we use the shorthand constants to set the alignment: - // Alignment.TOP_LEFT, Alignment.TOP_CENTER, Alignment.TOP_RIGHT - // Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER, - // Alignment.MIDDLE_RIGHT - // Alignment.BOTTOM_LEFT, Alignment.BOTTOM_CENTER, - // Alignment.BOTTOM_RIGHT - - Button topleft = new Button("Top Left"); - grid.addComponent(topleft); - grid.setComponentAlignment(topleft, Alignment.TOP_LEFT); - - Button topcenter = new Button("Top Center"); - grid.addComponent(topcenter); - grid.setComponentAlignment(topcenter, Alignment.TOP_CENTER); - - Button topright = new Button("Top Right"); - grid.addComponent(topright); - grid.setComponentAlignment(topright, Alignment.TOP_RIGHT); - - // Here we use bit additions to set the alignment: - // Bits.ALIGNMENT_LEFT, Bits.ALIGNMENT_RIGHT - // Bits.ALIGNMENT_TOP, Bits.ALIGNMENT_BOTTOM - // Bits.ALIGNMENT_VERTICAL_CENTER, Bits.ALIGNMENT_HORIZONTAL_CENTER - - Button middleleft = new Button("Middle Left"); - grid.addComponent(middleleft); - grid.setComponentAlignment(middleleft, new Alignment( - Bits.ALIGNMENT_VERTICAL_CENTER | Bits.ALIGNMENT_LEFT)); - - Button middlecenter = new Button("Middle Center"); - grid.addComponent(middlecenter); - grid.setComponentAlignment(middlecenter, new Alignment( - Bits.ALIGNMENT_VERTICAL_CENTER - | Bits.ALIGNMENT_HORIZONTAL_CENTER)); - - Button middleright = new Button("Middle Right"); - grid.addComponent(middleright); - grid.setComponentAlignment(middleright, new Alignment( - Bits.ALIGNMENT_VERTICAL_CENTER | Bits.ALIGNMENT_RIGHT)); - - // Here we'll use the convenient string-shorthand: - - Button bottomleft = new Button("Bottom Left"); - grid.addComponent(bottomleft); - grid.setComponentAlignment(bottomleft, "bottom left"); - - Button bottomcenter = new Button("Bottom Center"); - grid.addComponent(bottomcenter); - grid.setComponentAlignment(bottomcenter, "bottom center"); - - Button bottomright = new Button("Bottom Right"); - grid.addComponent(bottomright); - grid.setComponentAlignment(bottomright, "bottom right"); - - // Add the layout to the containing layout. - addComponent(grid); - - // Align the grid itself within its container layout. - setComponentAlignment(grid, Alignment.MIDDLE_CENTER); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/LayoutMargin.java b/src/com/vaadin/demo/sampler/features/layouts/LayoutMargin.java deleted file mode 100644 index f956ab46fd..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/LayoutMargin.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LayoutMargin extends Feature { - - @Override - public String getName() { - return "Layout margin"; - } - - @Override - public String getDescription() { - return "Layouts can have margins on any of the sides. The actual size" - + " of the margin is determined by the theme, and can be" - + " customized using CSS - in this example, the right margin" - + " size is increased.<br/>Note that <i>margin</i>" - + " is the space around the layout as a whole, and" - + " <i>spacing</i> is the space between the components within" - + " the layout."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(VerticalLayout.class), - new APIResource(HorizontalLayout.class), - new APIResource(GridLayout.class), }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { LayoutSpacing.class, HorizontalLayoutBasic.class, - VerticalLayoutBasic.class, GridLayoutBasic.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return new NamedExternalResource[] { new NamedExternalResource( - "CSS for the layout", getThemeBase() - + "layouts/marginexample.css") }; - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/LayoutMarginExample.java b/src/com/vaadin/demo/sampler/features/layouts/LayoutMarginExample.java deleted file mode 100644 index dead8fe5e3..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/LayoutMarginExample.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class LayoutMarginExample extends GridLayout implements - Button.ClickListener { - - VerticalLayout marginLayout; - Button topMargin; - Button rightMargin; - Button bottomMargin; - Button leftMargin; - - public LayoutMarginExample() { - super(3, 3); - - space(); - topMargin = new Button("Top margin", this); - topMargin.setSwitchMode(true); - addComponent(topMargin); - setComponentAlignment(topMargin, "center"); - - space(); - leftMargin = new Button("Left margin", this); - leftMargin.setSwitchMode(true); - addComponent(leftMargin); - setComponentAlignment(leftMargin, "middle"); - - marginLayout = new VerticalLayout(); - marginLayout.setStyleName("marginexample"); - marginLayout.setSizeUndefined(); - addComponent(marginLayout); - marginLayout.addComponent(new Label("Margins all around?")); - - rightMargin = new Button("Right margin", this); - rightMargin.setSwitchMode(true); - addComponent(rightMargin); - setComponentAlignment(rightMargin, "middle"); - - space(); - bottomMargin = new Button("Bottom margin", this); - bottomMargin.setSwitchMode(true); - addComponent(bottomMargin); - setComponentAlignment(bottomMargin, "center"); - - } - - public void buttonClick(ClickEvent event) { - marginLayout.setMargin(topMargin.booleanValue(), rightMargin - .booleanValue(), bottomMargin.booleanValue(), leftMargin - .booleanValue()); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/LayoutSpacing.java b/src/com/vaadin/demo/sampler/features/layouts/LayoutSpacing.java deleted file mode 100644 index ced7dde671..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/LayoutSpacing.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LayoutSpacing extends Feature { - - @Override - public String getName() { - return "Layout spacing"; - } - - @Override - public String getDescription() { - return "Spacing between components can be enabled or disabled." - + " The actual size of the spacing is determined by the theme," - + " and can be customized with CSS.<br/>Note that <i>spacing</i>" - + " is the space between components within the layout, and" - + " <i>margin</i> is the space around the layout as a whole."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(VerticalLayout.class), - new APIResource(HorizontalLayout.class), - new APIResource(GridLayout.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { LayoutMargin.class, HorizontalLayoutBasic.class, - VerticalLayoutBasic.class, GridLayoutBasic.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/LayoutSpacingExample.java b/src/com/vaadin/demo/sampler/features/layouts/LayoutSpacingExample.java deleted file mode 100644 index 96f76f43fd..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/LayoutSpacingExample.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class LayoutSpacingExample extends VerticalLayout { - - public LayoutSpacingExample() { - // Create a grid layout. - final GridLayout grid = new GridLayout(3, 3); - - // Add the layout to the containing layout. - addComponent(grid); - - // Add a style to allow customization of the layout. - grid.addStyleName("spacingexample"); - - // Populate the layout with components. - for (int i = 0; i < 9; i++) { - grid.addComponent(new Button("Component " + (i + 1))); - } - - // CheckBox for toggling spacing on and off - final CheckBox spacing = new CheckBox("Spacing enabled"); - spacing.setImmediate(true); - spacing.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - grid.setSpacing(spacing.booleanValue()); - } - }); - addComponent(spacing); - - setSpacing(true); // enable spacing for the example itself - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/SplitPanelBasic.java b/src/com/vaadin/demo/sampler/features/layouts/SplitPanelBasic.java deleted file mode 100644 index 58ef65c18b..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/SplitPanelBasic.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.SplitPanel;
-
-@SuppressWarnings("serial")
-public class SplitPanelBasic extends Feature {
-
- @Override
- public String getName() {
- return "Split panel";
- }
-
- @Override
- public String getDescription() {
- return "The SplitPanel has two resizable component areas, either"
- + " vertically or horizontally oriented. The split position"
- + " can optionally be locked.<br/> By nesting split panels,"
- + " one can make quite complicated, dynamic layouts.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(SplitPanel.class),
-
- };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] {};
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/SplitPanelBasicExample.java b/src/com/vaadin/demo/sampler/features/layouts/SplitPanelBasicExample.java deleted file mode 100644 index e9cbabd6b3..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/SplitPanelBasicExample.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.SplitPanel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SplitPanelBasicExample extends VerticalLayout {
-
- public static final String brownFox = "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. ";
-
- public SplitPanelBasicExample() {
- // First a vertical SplitPanel
- final SplitPanel vert = new SplitPanel();
- vert.setHeight("450px");
- vert.setWidth("100%");
- // vert.setOrientation(SplitPanel.ORIENTATION_VERTICAL); // default
- vert.setSplitPosition(150, SplitPanel.UNITS_PIXELS);
- addComponent(vert);
-
- // add a label to the upper area
- vert.addComponent(new Label(brownFox));
-
- // Add a horizontal SplitPanel to the lower area
- final SplitPanel horiz = new SplitPanel();
- horiz.setOrientation(SplitPanel.ORIENTATION_HORIZONTAL);
- horiz.setSplitPosition(50); // percent
- vert.addComponent(horiz);
-
- // left component:
- horiz.addComponent(new Label(brownFox));
-
- // right component:
- horiz.addComponent(new Label(brownFox));
-
- // Lock toggle button
- Button toggleLocked = new Button("Splits locked",
- new Button.ClickListener() {
- // inline click.listener
- public void buttonClick(ClickEvent event) {
- vert.setLocked(event.getButton().booleanValue());
- horiz.setLocked(event.getButton().booleanValue());
- }
- });
- toggleLocked.setSwitchMode(true);
- addComponent(toggleLocked);
-
- }
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/layouts/VerticalLayoutBasic.java b/src/com/vaadin/demo/sampler/features/layouts/VerticalLayoutBasic.java deleted file mode 100644 index af55c514dd..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/VerticalLayoutBasic.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class VerticalLayoutBasic extends Feature { - - @Override - public String getName() { - return "Vertical layout"; - } - - @Override - public String getDescription() { - return "The VerticalLayout arranges components vertically. " - + " It is 100% wide by default, which is nice in many cases," - + " but something to be aware of if trouble arises.<br/>It supports all basic features, plus some advanced stuff - including spacing, margin, alignment, and expand ratios."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(VerticalLayout.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { HorizontalLayoutBasic.class, LayoutSpacing.class, - LayoutAlignment.class, }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/VerticalLayoutBasicExample.java b/src/com/vaadin/demo/sampler/features/layouts/VerticalLayoutBasicExample.java deleted file mode 100644 index f17c67defb..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/VerticalLayoutBasicExample.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts; - -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class VerticalLayoutBasicExample extends VerticalLayout { - - public VerticalLayoutBasicExample() { - // this is a VerticalLayout - // let's add some components - for (int i = 0; i < 5; i++) { - TextField tf = new TextField("Row " + (i + 1)); - tf.setWidth("300px"); - // Add the component to the VerticalLayout - addComponent(tf); - } - } -} diff --git a/src/com/vaadin/demo/sampler/features/layouts/WebLayout.java b/src/com/vaadin/demo/sampler/features/layouts/WebLayout.java deleted file mode 100644 index 3ef7b9676c..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/WebLayout.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class WebLayout extends Feature {
-
- @Override
- public String getName() {
- return "Web-style layout";
- }
-
- @Override
- public String getDescription() {
- return "It can be helpful to distinguish between <i>web-style</i> and"
- + " <i>application-style</i> layouting (although this is a"
- + " simplification). Both styles are supported, and can be used"
- + " simultaneously.<br/> Web-style layouting allows the content"
- + " to dictate the size of the components by \"pushing\" the"
- + " size, causing scrollbars to appear for the whole window"
- + " when needed. This can be achieved by not setting the size"
- + " for components, or setting an absolute size (e.g 200px)."
- + "<br/>Try resizing the window to see how the content reacts.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(HorizontalLayout.class),
- new APIResource(VerticalLayout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ApplicationLayout.class, CustomLayouts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/layouts/WebLayoutExample.java b/src/com/vaadin/demo/sampler/features/layouts/WebLayoutExample.java deleted file mode 100644 index 9aaded5432..0000000000 --- a/src/com/vaadin/demo/sampler/features/layouts/WebLayoutExample.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.vaadin.demo.sampler.features.layouts;
-
-import java.util.Iterator;
-
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window.CloseEvent;
-
-@SuppressWarnings("serial")
-public class WebLayoutExample extends VerticalLayout {
-
- Window win = new WebLayoutWindow();
- Button open = new Button("Open sample in subwindow");
-
- public WebLayoutExample() {
- setMargin(true);
-
- // We'll open this example in a separate window, configure it
- win.setWidth("70%");
- win.setHeight("70%");
- win.center();
- // Allow opening window again when closed
- win.addListener(new Window.CloseListener() {
- public void windowClose(CloseEvent e) {
- open.setEnabled(true);
- }
- });
-
- // 'open sample' button
- addComponent(open);
- open.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- getWindow().addWindow(win);
- open.setEnabled(false);
- }
- });
-
- addComponent(new Label(
- ("Don't worry: the content of the window is not supposed to make sense...")));
-
- }
-
- class WebLayoutWindow extends Window {
- WebLayoutWindow() {
- // Our main layout is a horiozontal layout
- HorizontalLayout main = new HorizontalLayout();
- main.setMargin(true);
- main.setSpacing(true);
- setContent(main);
-
- // Tree to the left
- Tree tree = new Tree();
- tree.setContainerDataSource(ExampleUtil.getHardwareContainer());
- tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);
- for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {
- tree.expandItemsRecursively(it.next());
- }
- addComponent(tree);
-
- // vertically divide the right area
- VerticalLayout left = new VerticalLayout();
- left.setSpacing(true);
- addComponent(left);
-
- // table on top
- Table tbl = new Table();
- tbl.setWidth("500px");
- tbl.setContainerDataSource(ExampleUtil.getISO3166Container());
- tbl.setSortDisabled(true);
- tbl.setPageLength(7);
- left.addComponent(tbl);
-
- // Label on bottom
- Label text = new Label(ExampleUtil.lorem, Label.CONTENT_XHTML);
- text.setWidth("500px"); // some limit is good for text
- left.addComponent(text);
-
- }
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/link/75-LinkCurrentWindow.png b/src/com/vaadin/demo/sampler/features/link/75-LinkCurrentWindow.png Binary files differdeleted file mode 100644 index c9bcfd729e..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/75-LinkCurrentWindow.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/link/75-LinkNoDecorations.png b/src/com/vaadin/demo/sampler/features/link/75-LinkNoDecorations.png Binary files differdeleted file mode 100644 index 6ec2449a59..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/75-LinkNoDecorations.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/link/75-LinkSizedWindow.png b/src/com/vaadin/demo/sampler/features/link/75-LinkSizedWindow.png Binary files differdeleted file mode 100644 index 46333cd88d..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/75-LinkSizedWindow.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindow.java b/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindow.java deleted file mode 100644 index fdd2c2970e..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindow.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.link; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.buttons.ButtonLink; -import com.vaadin.ui.Link; - -@SuppressWarnings("serial") -public class LinkCurrentWindow extends Feature { - - @Override - public String getName() { - return "Link"; - } - - @Override - public String getDescription() { - return "By default, links open in the current browser window (use the browser back-button to get back)."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Link.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { LinkNoDecorations.class, LinkSizedWindow.class, - ButtonLink.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java b/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java deleted file mode 100644 index 855fb0ab93..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/LinkCurrentWindowExample.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.link; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Link; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LinkCurrentWindowExample extends VerticalLayout { - - private static final String CAPTION = "Open Google"; - private static final String TOOLTIP = "http://www.google.com"; - private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_world.gif"); - - public LinkCurrentWindowExample() { - setSpacing(true); - - // Link w/ text and tooltip - Link l = new Link(CAPTION, - new ExternalResource("http://www.google.com")); - l.setDescription(TOOLTIP); - addComponent(l); - - // Link w/ text, icon and tooltip - l = new Link(CAPTION, new ExternalResource("http://www.google.com")); - l.setDescription(TOOLTIP); - l.setIcon(ICON); - addComponent(l); - - // Link w/ icon and tooltip - l = new Link(); - l.setResource(new ExternalResource("http://www.google.com")); - l.setDescription(TOOLTIP); - l.setIcon(ICON); - addComponent(l); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/link/LinkNoDecorations.java b/src/com/vaadin/demo/sampler/features/link/LinkNoDecorations.java deleted file mode 100644 index 4d3f22a54b..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/LinkNoDecorations.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.link; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.buttons.ButtonLink; -import com.vaadin.ui.Link; - -@SuppressWarnings("serial") -public class LinkNoDecorations extends Feature { - - @Override - public String getName() { - return "Link, configure window"; - } - - @Override - public String getDescription() { - return "Links can open new browser windows, and configure the amount of browser features shown, such as toolbar and addressbar.<br/>These links open a browser window without decorations."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Link.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { LinkCurrentWindow.class, LinkSizedWindow.class, - ButtonLink.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java b/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java deleted file mode 100644 index e5457191c9..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/LinkNoDecorationsExample.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.demo.sampler.features.link; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Link; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LinkNoDecorationsExample extends VerticalLayout { - - private static final String CAPTION = "Open Google in new window"; - private static final String TOOLTIP = "http://www.google.com (opens in new window)"; - private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_world.gif"); - - public LinkNoDecorationsExample() { - setSpacing(true); - - // Link w/ text and tooltip - Link l = new Link(CAPTION, - new ExternalResource("http://www.google.com")); - l.setTargetName("_blank"); - l.setTargetBorder(Link.TARGET_BORDER_NONE); - l.setDescription(TOOLTIP); - addComponent(l); - - // Link w/ text, icon and tooltip - l = new Link(CAPTION, new ExternalResource("http://www.google.com")); - l.setTargetName("_blank"); - l.setTargetBorder(Link.TARGET_BORDER_NONE); - l.setDescription(TOOLTIP); - l.setIcon(ICON); - addComponent(l); - - // Link w/ icon and tooltip - l = new Link(); - l.setResource(new ExternalResource("http://www.google.com")); - l.setTargetName("_blank"); - l.setTargetBorder(Link.TARGET_BORDER_NONE); - l.setDescription(TOOLTIP); - l.setIcon(ICON); - addComponent(l); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/link/LinkSizedWindow.java b/src/com/vaadin/demo/sampler/features/link/LinkSizedWindow.java deleted file mode 100644 index dce9314dc8..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/LinkSizedWindow.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.link; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.demo.sampler.features.buttons.ButtonLink; -import com.vaadin.ui.Link; - -@SuppressWarnings("serial") -public class LinkSizedWindow extends Feature { - - @Override - public String getName() { - return "Link, sized window"; - } - - @Override - public String getDescription() { - return "Links can configure the size of the opened window.<br/>These links open a small fixed size window without decorations."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Link.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { LinkCurrentWindow.class, LinkNoDecorations.class, - ButtonLink.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java b/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java deleted file mode 100644 index b7667982bc..0000000000 --- a/src/com/vaadin/demo/sampler/features/link/LinkSizedWindowExample.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.demo.sampler.features.link; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Link; -import com.vaadin.ui.VerticalLayout; - -@SuppressWarnings("serial") -public class LinkSizedWindowExample extends VerticalLayout { - - private static final String CAPTION = "Open Google in small window"; - private static final String TOOLTIP = "http://www.google.com (opens in small window)"; - private static final ThemeResource ICON = new ThemeResource("../sampler/icons/icon_world.gif"); - private static final Resource TARGET = new ExternalResource( - "http://www.google.com/m"); - - public LinkSizedWindowExample() { - setSpacing(true); - - // Link w/ text and tooltip - Link l = new Link(CAPTION, TARGET); - l.setTargetName("_blank"); - l.setTargetWidth(300); - l.setTargetHeight(300); - l.setTargetBorder(Link.TARGET_BORDER_NONE); - l.setDescription(TOOLTIP); - addComponent(l); - - // Link w/ text, icon and tooltip - l = new Link(CAPTION, TARGET); - l.setTargetName("_blank"); - l.setTargetWidth(300); - l.setTargetHeight(300); - l.setTargetBorder(Link.TARGET_BORDER_NONE); - l.setDescription(TOOLTIP); - l.setIcon(ICON); - addComponent(l); - - // Link w/ icon and tooltip - l = new Link(); - l.setResource(TARGET); - l.setTargetName("_blank"); - l.setTargetWidth(300); - l.setTargetHeight(300); - l.setTargetBorder(Link.TARGET_BORDER_NONE); - l.setDescription(TOOLTIP); - l.setIcon(ICON); - addComponent(l); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationCustom.png b/src/com/vaadin/demo/sampler/features/notifications/75-NotificationCustom.png Binary files differdeleted file mode 100644 index 87aebc88f0..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationCustom.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationError.png b/src/com/vaadin/demo/sampler/features/notifications/75-NotificationError.png Binary files differdeleted file mode 100644 index e16a49ddef..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationError.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationHumanized.png b/src/com/vaadin/demo/sampler/features/notifications/75-NotificationHumanized.png Binary files differdeleted file mode 100644 index a2dd395f84..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationHumanized.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationTray.png b/src/com/vaadin/demo/sampler/features/notifications/75-NotificationTray.png Binary files differdeleted file mode 100644 index 31c256673f..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationTray.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationWarning.png b/src/com/vaadin/demo/sampler/features/notifications/75-NotificationWarning.png Binary files differdeleted file mode 100644 index 0626d17bda..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/75-NotificationWarning.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationCustom.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationCustom.java deleted file mode 100644 index c01f75a794..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationCustom.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class NotificationCustom extends Feature { - - @Override - public String getName() { - return "Customized notification"; - } - - @Override - public String getDescription() { - return "A notification can have a caption, a richtext" - + " description, and an icon. Position and delay can" - + " also be customized.<br/>Note that more often than" - + " not, less is more: try to make the messages short" - + " and to the point."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Window.class), - new APIResource(Window.Notification.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { NotificationHumanized.class, - NotificationWarning.class, NotificationError.class, - NotificationTray.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return new NamedExternalResource[] { new NamedExternalResource( - "Monolog Boxes and Transparent Messages", - "http://humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/") }; - - } - -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationCustomExample.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationCustomExample.java deleted file mode 100644 index 8821e8cec1..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationCustomExample.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Slider; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Window.Notification; - -@SuppressWarnings("serial") -public class NotificationCustomExample extends VerticalLayout { - - private static final String CAPTION_PROPERTY = "CAPTION"; - - public NotificationCustomExample() { - setSpacing(true); - setWidth(null); // layout will grow with content - - final TextField caption = new TextField("Caption", "Message sent"); - caption - .setDescription("Main info; a short caption-only notification is often most effective."); - caption.setWidth("200px"); - addComponent(caption); - - final RichTextArea description = new RichTextArea(); - description.setValue("<p>to <i>john.doe@example.com</i></p>"); - description.setCaption("Description"); - description - .setDescription("Additional information; try to keep it short."); - addComponent(description); - - HorizontalLayout horiz = new HorizontalLayout(); - horiz.setSpacing(true); - addComponent(horiz); - - final NativeSelect position = new NativeSelect("Position"); - position.setNullSelectionAllowed(false); - horiz.addComponent(position); - initPositionItems(position); - - final NativeSelect style = new NativeSelect("Style"); - style.setNullSelectionAllowed(false); - horiz.addComponent(style); - initTypeItems(style); - - final Slider delay = new Slider("Delay (msec), -1 means click to hide"); - delay - .setDescription("Delay before fading<br/>Pull all the way to the left to get -1, which means forever (click to hide)."); - delay.setWidth("100%"); // 'description' will push width - delay.setMin(Notification.DELAY_FOREVER); - delay.setMax(10000); - addComponent(delay); - - // TODO icon select - - Button show = new Button("Show notification", - new Button.ClickListener() { - // "Inline" click listener; this is where the - // notification is actually created and shown. - public void buttonClick(ClickEvent event) { - // create Notification instance and customize - Notification n = new Notification((String) caption - .getValue(), (String) description.getValue(), - (Integer) style.getValue()); - n.setPosition((Integer) position.getValue()); - Double d = (Double) delay.getValue(); - n.setDelayMsec(d.intValue()); // sec->msec - getWindow().showNotification(n); - } - }); - addComponent(show); - setComponentAlignment(show, Alignment.MIDDLE_RIGHT); - - } - - /* - * Helper to fill the position select with the various possibilities - */ - private void initPositionItems(NativeSelect position) { - position.addContainerProperty(CAPTION_PROPERTY, String.class, null); - position.setItemCaptionPropertyId(CAPTION_PROPERTY); - Item i = position.addItem(Notification.POSITION_TOP_LEFT); - Property c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Top left"); - i = position.addItem(Notification.POSITION_CENTERED_TOP); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Top centered"); - i = position.addItem(Notification.POSITION_TOP_RIGHT); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Top right"); - i = position.addItem(Notification.POSITION_CENTERED); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Centered"); - i = position.addItem(Notification.POSITION_BOTTOM_LEFT); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Bottom left"); - i = position.addItem(Notification.POSITION_CENTERED_BOTTOM); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Bottom, centered"); - i = position.addItem(Notification.POSITION_BOTTOM_RIGHT); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Bottom right"); - position.setValue(Notification.POSITION_CENTERED); - } - - /* - * Helper to fill the position select with the various possibilities - */ - private void initTypeItems(NativeSelect type) { - type.addContainerProperty(CAPTION_PROPERTY, String.class, null); - type.setItemCaptionPropertyId(CAPTION_PROPERTY); - Item i = type.addItem(Notification.TYPE_HUMANIZED_MESSAGE); - Property c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Humanized"); - i = type.addItem(Notification.TYPE_WARNING_MESSAGE); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Warning"); - i = type.addItem(Notification.TYPE_ERROR_MESSAGE); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Error"); - i = type.addItem(Notification.TYPE_TRAY_NOTIFICATION); - c = i.getItemProperty(CAPTION_PROPERTY); - c.setValue("Tray"); - - type.setValue(Notification.TYPE_HUMANIZED_MESSAGE); - } - -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationError.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationError.java deleted file mode 100644 index 7cd6478839..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationError.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class NotificationError extends Feature { - - @Override - public String getName() { - return "Error notification"; - } - - @Override - public String getDescription() { - return "<p>The <i>Error</i> notification is modal, and is to be used for" - + " messages that must be seen by the user.<br/>" - + " The <i>Error</i> message must be closed by clicking" - + " the notification.</p><p>Candidates for an" - + " <i>Error</i> notification include 'Save failed'," - + " 'Permission denied', and other situations that the" - + " user must be made aware of.<br/>It's a good idea to" - + " provide hints about what went wrong, and how the user'" - + " can proceed to correct the situation.</p>"; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Window.class), - new APIResource(Window.Notification.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { NotificationHumanized.class, - NotificationTray.class, NotificationWarning.class, - NotificationCustom.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationErrorExample.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationErrorExample.java deleted file mode 100644 index ae10f86ca5..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationErrorExample.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Window.Notification; - -@SuppressWarnings("serial") -public class NotificationErrorExample extends VerticalLayout { - - public NotificationErrorExample() { - setSpacing(true); - setWidth(null); // layout will grow with content - - final TextField caption = new TextField("Caption", "Upload failed"); - caption.setWidth("200px"); - addComponent(caption); - - final TextField description = new TextField( - "Description", - "Invoices-2008.csv could not be read.<br/>" - + "Perhaps the file is damaged, or in the wrong format?<br/>" - + "Try re-exporting and uploading the file again."); - description.setWidth("300px"); - addComponent(description); - - Button show = new Button("Show notification", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - getWindow().showNotification( - (String) caption.getValue(), - (String) description.getValue(), - Notification.TYPE_ERROR_MESSAGE); - - } - }); - addComponent(show); - setComponentAlignment(show, Alignment.MIDDLE_RIGHT); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationHumanized.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationHumanized.java deleted file mode 100644 index af6900f2f4..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationHumanized.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class NotificationHumanized extends Feature { - - @Override - public String getName() { - return "Humanized notification"; - } - - @Override - public String getDescription() { - return "<p>The <i>Humanized</i> notification is an implementation of" - + " the <i>transparent message</i> -pattern, and can be used" - + " to indicate non-critical events while interrupting" - + " the user as little as possible.<br/>" - + "The <i>Humanized</i> message quickly fades away once" - + " the user interacts with the application (i.e. moves" - + " mouse, types).</p><p>Candidates for a" - + " <i>Humanized</i> notification include 'XYZ saved'," - + " 'Added XYZ', and other messages that the user can" - + " safely ignore, once the application is familliar.</p>"; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Window.class), - new APIResource(Window.Notification.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { NotificationTray.class, NotificationWarning.class, - NotificationError.class, NotificationCustom.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return new NamedExternalResource[] { new NamedExternalResource( - "Monolog Boxes and Transparent Messages", - "http://humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/") }; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationHumanizedExample.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationHumanizedExample.java deleted file mode 100644 index 69c1bf59c4..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationHumanizedExample.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class NotificationHumanizedExample extends VerticalLayout { - - public NotificationHumanizedExample() { - setSpacing(true); - setWidth(null); // layout will grow with content - - final TextField caption = new TextField("Caption", "Document saved"); - caption.setWidth("200px"); - addComponent(caption); - - final TextField description = new TextField("Description", - "Invoices-2008.csv"); - description.setWidth("300px"); - addComponent(description); - - Button show = new Button("Show notification", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - getWindow().showNotification( - (String) caption.getValue(), - (String) description.getValue()); - - } - }); - addComponent(show); - setComponentAlignment(show, Alignment.MIDDLE_RIGHT); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationTray.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationTray.java deleted file mode 100644 index 4d4ebf0fb7..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationTray.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class NotificationTray extends Feature { - - @Override - public String getName() { - return "Tray notification"; - } - - @Override - public String getDescription() { - return "<p>The <i>Tray</i> notification shows up in the lower right corner," - + " and is meant to interrupt the user as little as possible" - + " even if it's shown for a while. " - + "The <i>Tray</i> message fades away after a few moments" - + " once the user interacts with the application (e.g. moves" - + " mouse, types)</p><p>Candidates for a" - + " <i>Tray</i> notification include 'New message received'," - + " 'Job XYZ completed' – generally notifications about events" - + " that have been delayed, or occur in the background" - + " (as opposed to being a direct result of the users last action.)</p>"; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Window.class), - new APIResource(Window.Notification.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { NotificationHumanized.class, - NotificationWarning.class, NotificationError.class, - NotificationCustom.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return new NamedExternalResource[] { new NamedExternalResource( - "Monolog Boxes and Transparent Messages", - "http://humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/") }; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationTrayExample.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationTrayExample.java deleted file mode 100644 index cd8a63f88e..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationTrayExample.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Window.Notification; - -@SuppressWarnings("serial") -public class NotificationTrayExample extends VerticalLayout { - - public NotificationTrayExample() { - setSpacing(true); - setWidth(null); // layout will grow with content - - final TextField caption = new TextField("Caption", "New message"); - caption.setWidth("200px"); - addComponent(caption); - - final TextField description = new TextField("Description", - "<b>John:</b> Could you upload Invoices-2008.csv so that..."); - description.setWidth("300px"); - addComponent(description); - - Button show = new Button("Show notification", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - getWindow().showNotification( - (String) caption.getValue(), - (String) description.getValue(), - Notification.TYPE_TRAY_NOTIFICATION); - - } - }); - addComponent(show); - setComponentAlignment(show, Alignment.MIDDLE_RIGHT); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationWarning.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationWarning.java deleted file mode 100644 index 066709c417..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationWarning.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class NotificationWarning extends Feature { - - @Override - public String getName() { - return "Warning notification"; - } - - @Override - public String getDescription() { - return "<p>The <i>Warning</i> notification is an implementation of" - + " the <i>transparent message</i> -pattern, and is meant" - + " to interrupt the user as little as possible, while" - + " still drawing the needed attention." - + "The <i>Warning</i> message fades away after a few moments" - + " once the user interacts with the application (e.g. moves" - + " mouse, types)</p><p>Candidates for a" - + " <i>Warning</i> notification include 'You canceled XYZ'," - + " 'XYZ deleted', and other situations that the user should" - + " be made aware of, but are probably intentional.</p>"; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Window.class), - new APIResource(Window.Notification.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { NotificationHumanized.class, - NotificationTray.class, NotificationError.class, - NotificationCustom.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return new NamedExternalResource[] { new NamedExternalResource( - "Monolog Boxes and Transparent Messages", - "http://humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/") }; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/notifications/NotificationWarningExample.java b/src/com/vaadin/demo/sampler/features/notifications/NotificationWarningExample.java deleted file mode 100644 index 06df02379f..0000000000 --- a/src/com/vaadin/demo/sampler/features/notifications/NotificationWarningExample.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.notifications; - -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Window.Notification; - -@SuppressWarnings("serial") -public class NotificationWarningExample extends VerticalLayout { - - public NotificationWarningExample() { - setSpacing(true); - setWidth(null); // layout will grow with content - - final TextField caption = new TextField("Caption", "Upload canceled"); - caption.setWidth("200px"); - addComponent(caption); - - final TextField description = new TextField("Description", - "Invoices-2008.csv will not be processed"); - description.setWidth("300px"); - addComponent(description); - - Button show = new Button("Show notification", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - getWindow().showNotification( - (String) caption.getValue(), - (String) description.getValue(), - Notification.TYPE_WARNING_MESSAGE); - - } - }); - addComponent(show); - setComponentAlignment(show, Alignment.MIDDLE_RIGHT); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/panels/75-PanelBasic.png b/src/com/vaadin/demo/sampler/features/panels/75-PanelBasic.png Binary files differdeleted file mode 100644 index 3307b22067..0000000000 --- a/src/com/vaadin/demo/sampler/features/panels/75-PanelBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/panels/75-PanelLight.png b/src/com/vaadin/demo/sampler/features/panels/75-PanelLight.png Binary files differdeleted file mode 100644 index c36e16af47..0000000000 --- a/src/com/vaadin/demo/sampler/features/panels/75-PanelLight.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/panels/PanelBasic.java b/src/com/vaadin/demo/sampler/features/panels/PanelBasic.java deleted file mode 100644 index 6562360860..0000000000 --- a/src/com/vaadin/demo/sampler/features/panels/PanelBasic.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.panels;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.Panel;
-
-@SuppressWarnings("serial")
-public class PanelBasic extends Feature {
- @Override
- public String getName() {
- return "Panel";
- }
-
- @Override
- public String getDescription() {
- return "";
-
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Panel.class),
- new APIResource(Layout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { PanelLight.class, FeatureSet.Layouts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/panels/PanelBasicExample.java b/src/com/vaadin/demo/sampler/features/panels/PanelBasicExample.java deleted file mode 100644 index 1d81dd1246..0000000000 --- a/src/com/vaadin/demo/sampler/features/panels/PanelBasicExample.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.panels;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-@SuppressWarnings("serial")
-public class PanelBasicExample extends VerticalLayout implements ClickListener {
-
- private Panel panel;
-
- public PanelBasicExample() {
- setSpacing(true);
-
- // Panel 1 - with caption
- panel = new Panel("This is a standard Panel");
- panel.setHeight("200px"); // we want scrollbars
-
- // let's adjust the panels default layout (a VerticalLayout)
- VerticalLayout layout = (VerticalLayout) panel.getContent();
- layout.setMargin(true); // we want a margin
- layout.setSpacing(true); // and spacing between components
- addComponent(panel);
-
- // Let's add a few rows to provoke scrollbars:
- for (int i = 0; i < 20; i++) {
- panel.addComponent(new Label(
- "The quick brown fox jumps over the lazy dog."));
- }
-
- // Caption toggle:
- Button b = new Button("Toggle caption");
- b.addListener(this);
- addComponent(b);
-
- }
-
- public void buttonClick(ClickEvent event) {
- if (panel.getCaption().equals("")) {
- panel.setCaption("This is a standard Panel");
- } else {
- panel.setCaption("");
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/panels/PanelLight.java b/src/com/vaadin/demo/sampler/features/panels/PanelLight.java deleted file mode 100644 index 803460932c..0000000000 --- a/src/com/vaadin/demo/sampler/features/panels/PanelLight.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.panels;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.Panel;
-
-@SuppressWarnings("serial")
-public class PanelLight extends Feature {
- @Override
- public String getName() {
- return "Panel, light style";
- }
-
- @Override
- public String getDescription() {
- return "The 'light' panel has less decorations than the regular Panel style.";
-
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Panel.class),
- new APIResource(Layout.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { PanelBasic.class, FeatureSet.Layouts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/panels/PanelLightExample.java b/src/com/vaadin/demo/sampler/features/panels/PanelLightExample.java deleted file mode 100644 index 25fe68c3a0..0000000000 --- a/src/com/vaadin/demo/sampler/features/panels/PanelLightExample.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.demo.sampler.features.panels;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-@SuppressWarnings("serial")
-public class PanelLightExample extends VerticalLayout implements ClickListener {
-
- private Panel panel;
-
- public PanelLightExample() {
- setSpacing(true);
-
- setSpacing(true);
-
- // Panel 1 - with caption
- panel = new Panel("This is a light Panel");
- panel.setStyleName(Panel.STYLE_LIGHT);
- panel.setHeight("200px"); // we want scrollbars
-
- // let's adjust the panels default layout (a VerticalLayout)
- VerticalLayout layout = (VerticalLayout) panel.getContent();
- layout.setMargin(true); // we want a margin
- layout.setSpacing(true); // and spacing between components
- addComponent(panel);
-
- // Let's add a few rows to provoke scrollbars:
- for (int i = 0; i < 20; i++) {
- panel.addComponent(new Label(
- "The quick brown fox jumps over the lazy dog."));
- }
-
- // Caption toggle:
- Button b = new Button("Toggle caption");
- b.addListener(this);
- addComponent(b);
- }
-
- public void buttonClick(ClickEvent event) {
- if (panel.getCaption() == null) {
- panel.setCaption("This is a light Panel");
- } else {
- panel.setCaption(null);
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxContains.png b/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxContains.png Binary files differdeleted file mode 100644 index af8cdf2215..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxContains.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxInputPrompt.png b/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxInputPrompt.png Binary files differdeleted file mode 100644 index 3ef7a48faa..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxInputPrompt.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxNewItems.png b/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxNewItems.png Binary files differdeleted file mode 100644 index c79228fdcf..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxNewItems.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxPlain.png b/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxPlain.png Binary files differdeleted file mode 100644 index 603c8c6cab..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxPlain.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxStartsWith.png b/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxStartsWith.png Binary files differdeleted file mode 100644 index 2b5d0f1bd0..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ComboBoxStartsWith.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ListSelectMultiple.png b/src/com/vaadin/demo/sampler/features/selects/75-ListSelectMultiple.png Binary files differdeleted file mode 100644 index 628b5787f8..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ListSelectMultiple.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-ListSelectSingle.png b/src/com/vaadin/demo/sampler/features/selects/75-ListSelectSingle.png Binary files differdeleted file mode 100644 index b4ac1f4999..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-ListSelectSingle.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-NativeSelection.png b/src/com/vaadin/demo/sampler/features/selects/75-NativeSelection.png Binary files differdeleted file mode 100644 index 8d39ff69b5..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-NativeSelection.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/75-TwinColumnSelect.png b/src/com/vaadin/demo/sampler/features/selects/75-TwinColumnSelect.png Binary files differdeleted file mode 100644 index b8e0dae88a..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/75-TwinColumnSelect.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxContains.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxContains.java deleted file mode 100644 index 425895946f..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxContains.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.ComboBox;
-
-@SuppressWarnings("serial")
-public class ComboBoxContains extends Feature {
- @Override
- public String getName() {
- return "Combobox, suggesting (contains)";
- }
-
- @Override
- public String getDescription() {
- return "A drop-down selection component with single item selection.<br/>"
- + " A 'contains' filter has been used in this example,"
- + " so you can key in some text and only the options"
- + " containing your input will be shown.<br/>"
- + " Because there are so many options, they are loaded on-demand"
- + " (\"lazy-loading\") from the server when paging or"
- + " filtering. This behavior is built-in and requires no extra"
- + " code.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ComboBox.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ComboBoxPlain.class, ComboBoxStartsWith.class,
- ComboBoxNewItems.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxContainsExample.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxContainsExample.java deleted file mode 100644 index e74e6ab385..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxContainsExample.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.AbstractSelect.Filtering;
-
-@SuppressWarnings("serial")
-public class ComboBoxContainsExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- public ComboBoxContainsExample() {
- setSpacing(true);
-
- // Creates a new combobox using an existing container
- ComboBox l = new ComboBox("Please select your country", ExampleUtil
- .getISO3166Container());
-
- // Sets the combobox to show a certain property as the item caption
- l.setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME);
- l.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-
- // Sets the icon to use with the items
- l.setItemIconPropertyId(ExampleUtil.iso3166_PROPERTY_FLAG);
-
- // Set a reasonable width
- l.setWidth(350, UNITS_PIXELS);
-
- // Set the appropriate filtering mode for this example
- l.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
- l.setImmediate(true);
- l.addListener(this);
-
- // Disallow null selections
- l.setNullSelectionAllowed(false);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- Property selected = ExampleUtil.getISO3166Container()
- .getContainerProperty(event.getProperty().toString(), "name");
- getWindow().showNotification("Selected country: " + selected);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPrompt.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPrompt.java deleted file mode 100644 index da38ecc56f..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPrompt.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.demo.sampler.features.text.TextFieldInputPrompt;
-import com.vaadin.ui.ComboBox;
-
-@SuppressWarnings("serial")
-public class ComboBoxInputPrompt extends Feature {
- @Override
- public String getName() {
- return "Combobox with input prompt";
- }
-
- @Override
- public String getDescription() {
- return "ComboBox is a drop-down selection component with single item selection."
- + " It can have an <i>input prompt</i> - a textual hint that is shown within"
- + " the select when no value is selected.<br/>"
- + " You can use an input prompt instead of a caption to save"
- + " space, but only do so if the function of the ComboBox is"
- + " still clear when a value is selected and the prompt is no"
- + " longer visible.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ComboBox.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ComboBoxStartsWith.class, ComboBoxContains.class,
- ComboBoxNewItems.class, TextFieldInputPrompt.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] { new NamedExternalResource(
- "UI Patterns, Input Prompt",
- "http://ui-patterns.com/pattern/InputPrompt") };
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java deleted file mode 100644 index b9a0469127..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxInputPromptExample.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ComboBoxInputPromptExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private static final String[] cities = new String[] { "Berlin", "Brussels",
- "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };
-
- public ComboBoxInputPromptExample() {
- setMargin(true, false, false, false); // for looks: more 'air'
-
- // Create & set input prompt
- ComboBox l = new ComboBox();
- l.setInputPrompt("Please select a city");
-
- // configure & load content
- l.setImmediate(true);
- l.addListener(this);
- for (int i = 0; i < cities.length; i++) {
- l.addItem(cities[i]);
- }
-
- // add to the layout
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Selected city: " + event.getProperty());
-
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxNewItems.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxNewItems.java deleted file mode 100644 index b9ec8025ea..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxNewItems.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.ComboBox;
-
-@SuppressWarnings("serial")
-public class ComboBoxNewItems extends Feature {
- @Override
- public String getName() {
- return "Combobox, enter new items";
- }
-
- @Override
- public String getDescription() {
- return "A drop-down selection component with single item selection.<br/>"
- + " This example also allows you to input your own"
- + " choice - your input will be added to the selection"
- + " of available choices. This behavior is built-in and can"
- + " be enabled with one method call. Note that by using this"
- + " feature, one can easily create <i>suggestion box</i> -type"
- + " inputs that for example remembers the users previous input,"
- + " or provides suggestions from a list of popular choices."
- + " Configured like this (and optionally with a filter), the"
- + " ComboBox can be a powerful alternative to TextField.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ComboBox.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ComboBoxPlain.class, ComboBoxStartsWith.class,
- ComboBoxContains.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxNewItemsExample.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxNewItemsExample.java deleted file mode 100644 index 2f3c36e908..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxNewItemsExample.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ComboBoxNewItemsExample extends VerticalLayout implements
- Property.ValueChangeListener, AbstractSelect.NewItemHandler {
- private static final String[] cities = new String[] { "Berlin", "Brussels",
- "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };
- private ComboBox l;
- private Boolean lastAdded = false;
-
- public ComboBoxNewItemsExample() {
- setSpacing(true);
-
- l = new ComboBox("Please select a city");
- for (int i = 0; i < cities.length; i++) {
- l.addItem(cities[i]);
- }
-
- l.setNewItemsAllowed(true);
- l.setNewItemHandler(this);
- l.setImmediate(true);
- l.addListener(this);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- if (!lastAdded) {
- getWindow().showNotification(
- "Selected city: " + event.getProperty());
- }
- lastAdded = false;
- }
-
- public void addNewItem(String newItemCaption) {
- if (!l.containsId(newItemCaption)) {
- getWindow().showNotification("Added city: " + newItemCaption);
- lastAdded = true;
- l.addItem(newItemCaption);
- l.setValue(newItemCaption);
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxPlain.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxPlain.java deleted file mode 100644 index 299534dfcc..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxPlain.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.ComboBox;
-
-@SuppressWarnings("serial")
-public class ComboBoxPlain extends Feature {
- @Override
- public String getName() {
- return "Combobox";
- }
-
- @Override
- public String getDescription() {
- return "A drop-down selection component with single item selection."
- + " Shown here is the most basic variant, which basically"
- + " provides the same functionality as a NativeSelect with"
- + " added lazy-loading if there are many options.<br/>"
- + " See related examples for more advanced features.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ComboBox.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ComboBoxStartsWith.class, ComboBoxContains.class,
- ComboBoxNewItems.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxPlainExample.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxPlainExample.java deleted file mode 100644 index 8e96d93871..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxPlainExample.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.AbstractSelect.Filtering;
-
-@SuppressWarnings("serial")
-public class ComboBoxPlainExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private static final String[] cities = new String[] { "Berlin", "Brussels",
- "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };
-
- public ComboBoxPlainExample() {
- setSpacing(true);
-
- ComboBox l = new ComboBox("Please select a city");
- for (int i = 0; i < cities.length; i++) {
- l.addItem(cities[i]);
- }
-
- l.setFilteringMode(Filtering.FILTERINGMODE_OFF);
- l.setImmediate(true);
- l.addListener(this);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Selected city: " + event.getProperty());
-
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWith.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWith.java deleted file mode 100644 index 49a3e67685..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWith.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.ComboBox;
-
-@SuppressWarnings("serial")
-public class ComboBoxStartsWith extends Feature {
- @Override
- public String getName() {
- return "Combobox, suggesting (starts-with)";
- }
-
- @Override
- public String getDescription() {
- return "A drop-down selection component with single item selection.<br/>"
- + " A 'starts-with' filter has been used in this example,"
- + " so you can key in some text and only the options"
- + " beginning with your input will be shown.<br/>"
- + " Because there are so many options, they are loaded on-demand"
- + " (\"lazy-loading\") from the server when paging or"
- + " filtering. This behavior is built-in and requires no extra"
- + " code.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ComboBox.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ComboBoxPlain.class, ComboBoxContains.class,
- ComboBoxNewItems.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWithExample.java b/src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWithExample.java deleted file mode 100644 index c98c105557..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWithExample.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.AbstractSelect.Filtering;
-
-@SuppressWarnings("serial")
-public class ComboBoxStartsWithExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- public ComboBoxStartsWithExample() {
- setSpacing(true);
-
- // Creates a new combobox using an existing container
- ComboBox l = new ComboBox("Please select your country", ExampleUtil
- .getISO3166Container());
-
- // Sets the combobox to show a certain property as the item caption
- l.setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME);
- l.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-
- // Sets the icon to use with the items
- l.setItemIconPropertyId(ExampleUtil.iso3166_PROPERTY_FLAG);
-
- // Set a reasonable width
- l.setWidth(350, UNITS_PIXELS);
-
- // Set the appropriate filtering mode for this example
- l.setFilteringMode(Filtering.FILTERINGMODE_STARTSWITH);
- l.setImmediate(true);
- l.addListener(this);
-
- // Disallow null selections
- l.setNullSelectionAllowed(false);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- Property selected = ExampleUtil.getISO3166Container()
- .getContainerProperty(event.getProperty().toString(), "name");
- getWindow().showNotification("Selected country: " + selected);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ListSelectMultiple.java b/src/com/vaadin/demo/sampler/features/selects/ListSelectMultiple.java deleted file mode 100644 index 776d191343..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ListSelectMultiple.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.ListSelect;
-
-@SuppressWarnings("serial")
-public class ListSelectMultiple extends Feature {
- @Override
- public String getName() {
- return "List select, multiple selections";
- }
-
- @Override
- public String getDescription() {
- return "A simple list select component with multiple item selection."
- + " You can allow or disallow <i>null selection</i> - i.e the"
- + " possibility to make an empty selection. Null selection is"
- + " allowed in this example.<br/>"
- + "You can select multiple items from the list by holding"
- + " the CTRL of SHIFT key while clicking the items.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ListSelect.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { NativeSelection.class, ListSelectSingle.class,
- TwinColumnSelect.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ListSelectMultipleExample.java b/src/com/vaadin/demo/sampler/features/selects/ListSelectMultipleExample.java deleted file mode 100644 index 6bb02bc2aa..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ListSelectMultipleExample.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.ListSelect;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ListSelectMultipleExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private static final String[] cities = new String[] { "Berlin", "Brussels",
- "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };
-
- public ListSelectMultipleExample() {
- setSpacing(true);
-
- ListSelect l = new ListSelect("Please select some cities");
- for (int i = 0; i < cities.length; i++) {
- l.addItem(cities[i]);
- }
- l.setRows(7);
- l.setNullSelectionAllowed(true);
- l.setMultiSelect(true);
- l.setImmediate(true);
- l.addListener(this);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Selected cities: " + event.getProperty());
-
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ListSelectSingle.java b/src/com/vaadin/demo/sampler/features/selects/ListSelectSingle.java deleted file mode 100644 index dfaeefeb89..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ListSelectSingle.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.ListSelect;
-
-@SuppressWarnings("serial")
-public class ListSelectSingle extends Feature {
- @Override
- public String getName() {
- return "List select, single selection";
- }
-
- @Override
- public String getDescription() {
- return "A simple list select component with single item selection.<br/>"
- + "You can allow or disallow <i>null selection</i> - i.e the"
- + " possibility to make an empty selection. Null selection is"
- + " not allowed in this example.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(ListSelect.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { NativeSelection.class, ListSelectMultiple.class,
- TwinColumnSelect.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/ListSelectSingleExample.java b/src/com/vaadin/demo/sampler/features/selects/ListSelectSingleExample.java deleted file mode 100644 index bff69f5e91..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/ListSelectSingleExample.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.ListSelect;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class ListSelectSingleExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private static final List<String> cities = Arrays.asList(new String[] {
- "Berlin", "Brussels", "Helsinki", "Madrid", "Oslo", "Paris",
- "Stockholm" });
-
- public ListSelectSingleExample() {
- setSpacing(true);
-
- // 'Shorthand' constructor - also supports data binding using Containers
- ListSelect citySelect = new ListSelect("Please select a city", cities);
-
- citySelect.setRows(7); // perfect length in out case
- citySelect.setNullSelectionAllowed(false); // user can not 'unselect'
- citySelect.select("Berlin"); // select this by default
- citySelect.setImmediate(true); // send the change to the server at once
- citySelect.addListener(this); // react when the user selects something
-
- addComponent(citySelect);
- }
-
- /*
- * Shows a notification when a selection is made. The listener will be
- * called whenever the value of the component changes, i.e when the user
- * makes a new selection.
- */
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Selected city: " + event.getProperty());
-
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/NativeSelection.java b/src/com/vaadin/demo/sampler/features/selects/NativeSelection.java deleted file mode 100644 index 7d3e886985..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/NativeSelection.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.NativeSelect;
-
-@SuppressWarnings("serial")
-public class NativeSelection extends Feature {
- @Override
- public String getName() {
- return "Native select";
- }
-
- @Override
- public String getDescription() {
- return "A NativeSelect is a a simple drop-down list"
- + " for selecting one item. It is called <i>native</i>"
- + " because it uses the look and feel from the browser in use.<br/>"
- + " The ComboBox component is a much more versatile variant,"
- + " but without the native look and feel.<br/>"
- + " From a usability standpoint, you might also want to"
- + " consider using a ListSelect in single-select-mode, so that"
- + " the user can see all options right away.";
-
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(NativeSelect.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { ComboBoxPlain.class, ListSelectSingle.class,
- FeatureSet.Selects.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/NativeSelectionExample.java b/src/com/vaadin/demo/sampler/features/selects/NativeSelectionExample.java deleted file mode 100644 index f1798f0a83..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/NativeSelectionExample.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class NativeSelectionExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private static final String[] cities = new String[] { "Berlin", "Brussels",
- "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };
-
- public NativeSelectionExample() {
- setSpacing(true);
-
- NativeSelect l = new NativeSelect("Please select a city");
- for (int i = 0; i < cities.length; i++) {
- l.addItem(cities[i]);
- }
-
- l.setNullSelectionAllowed(false);
- l.setValue("Berlin");
- l.setImmediate(true);
- l.addListener(this);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Selected city: " + event.getProperty());
-
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/TwinColumnSelect.java b/src/com/vaadin/demo/sampler/features/selects/TwinColumnSelect.java deleted file mode 100644 index ec8c61db8b..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/TwinColumnSelect.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.TwinColSelect;
-
-@SuppressWarnings("serial")
-public class TwinColumnSelect extends Feature {
- @Override
- public String getName() {
- return "Twin column select (list builder)";
- }
-
- @Override
- public String getDescription() {
- return "The TwinColumnSelect is a multiple selection component"
- + " that shows two lists side by side. The list on the left"
- + " shows the available items and the list on the right shows"
- + " the selected items. <br>You can select items"
- + " from the list on the left and click on the >> button to move"
- + " them to the list on the right. Items can be moved back by"
- + " selecting them and clicking on the << button.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TwinColSelect.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { NativeSelection.class, ListSelectMultiple.class,
- ListSelectSingle.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] { new NamedExternalResource(
- "Open Source Design Pattern Library; List Builder",
- "http://www.uidesignpatterns.org/designPatterns/List-Builder") };
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/selects/TwinColumnSelectExample.java b/src/com/vaadin/demo/sampler/features/selects/TwinColumnSelectExample.java deleted file mode 100644 index 61168f7985..0000000000 --- a/src/com/vaadin/demo/sampler/features/selects/TwinColumnSelectExample.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.selects;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.TwinColSelect;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class TwinColumnSelectExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private static final String[] cities = new String[] { "Berlin", "Brussels",
- "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" };
-
- public TwinColumnSelectExample() {
- setSpacing(true);
-
- TwinColSelect l = new TwinColSelect("Please select some cities");
- for (int i = 0; i < cities.length; i++) {
- l.addItem(cities[i]);
- }
- l.setRows(7);
- l.setNullSelectionAllowed(true);
- l.setMultiSelect(true);
- l.setImmediate(true);
- l.addListener(this);
-
- addComponent(l);
- }
-
- /*
- * Shows a notification when a selection is made.
- */
- public void valueChange(ValueChangeEvent event) {
- if (!event.getProperty().toString().equals("[]")) {
- getWindow().showNotification(
- "Selected cities: " + event.getProperty());
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableActions.png b/src/com/vaadin/demo/sampler/features/table/75-TableActions.png Binary files differdeleted file mode 100644 index dacd3aea86..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableActions.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableCellStyling.png b/src/com/vaadin/demo/sampler/features/table/75-TableCellStyling.png Binary files differdeleted file mode 100644 index 798ec20b4f..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableCellStyling.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableColumnAlignment.png b/src/com/vaadin/demo/sampler/features/table/75-TableColumnAlignment.png Binary files differdeleted file mode 100644 index 87d6a18a51..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableColumnAlignment.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableColumnCollapsing.png b/src/com/vaadin/demo/sampler/features/table/75-TableColumnCollapsing.png Binary files differdeleted file mode 100644 index b0922dc00b..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableColumnCollapsing.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableColumnHeaders.png b/src/com/vaadin/demo/sampler/features/table/75-TableColumnHeaders.png Binary files differdeleted file mode 100644 index b277610f8d..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableColumnHeaders.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableColumnReordering.png b/src/com/vaadin/demo/sampler/features/table/75-TableColumnReordering.png Binary files differdeleted file mode 100644 index 6c689212cc..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableColumnReordering.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableHeaderIcons.png b/src/com/vaadin/demo/sampler/features/table/75-TableHeaderIcons.png Binary files differdeleted file mode 100644 index b277610f8d..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableHeaderIcons.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableLazyLoading.png b/src/com/vaadin/demo/sampler/features/table/75-TableLazyLoading.png Binary files differdeleted file mode 100644 index e5a294cf65..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableLazyLoading.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableMouseEvents.png b/src/com/vaadin/demo/sampler/features/table/75-TableMouseEvents.png Binary files differdeleted file mode 100644 index 798ec20b4f..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableMouseEvents.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableRowHeaders.png b/src/com/vaadin/demo/sampler/features/table/75-TableRowHeaders.png Binary files differdeleted file mode 100644 index b277610f8d..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableRowHeaders.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableRowStyling.png b/src/com/vaadin/demo/sampler/features/table/75-TableRowStyling.png Binary files differdeleted file mode 100644 index f523a049fe..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableRowStyling.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/75-TableSorting.png b/src/com/vaadin/demo/sampler/features/table/75-TableSorting.png Binary files differdeleted file mode 100644 index 4014d3aec7..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/75-TableSorting.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/table/TableActions.java b/src/com/vaadin/demo/sampler/features/table/TableActions.java deleted file mode 100644 index 224524ff0a..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableActions.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableActions extends Feature { - - @Override - public String getName() { - return "Table, context menu"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "Actions can be added to each row, and are show in a" - + " context menu when right-clicking."; - - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableCellStyling.java b/src/com/vaadin/demo/sampler/features/table/TableCellStyling.java deleted file mode 100644 index 74bdee713c..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableCellStyling.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableCellStyling extends Feature { - - @Override - public String getName() { - return "Table, styling cells"; - } - - @Override - public Component getExample() { - return new TableStylingExample(); - } - - @Override - public String getDescription() { - return "Individual cells can be styled in a Table by using a" - + " CellStyleGenerator. Regular CSS is used to create the" - + " actual style.<br/>Double click a first or last name to" - + " mark/unmark that cell."; - - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableColumnAlignment.java b/src/com/vaadin/demo/sampler/features/table/TableColumnAlignment.java deleted file mode 100644 index 130e558ca9..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableColumnAlignment.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableColumnAlignment extends Feature { - - @Override - public String getName() { - return "Table, column alignment"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "Columns can be aligned left (default), center or right."; - - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableColumnCollapsing.java b/src/com/vaadin/demo/sampler/features/table/TableColumnCollapsing.java deleted file mode 100644 index cdf2748b1d..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableColumnCollapsing.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableColumnCollapsing extends Feature { - - @Override - public String getName() { - return "Table, column collapsing"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "Columns can be 'collapsed', which means that it's not shown," - + " but the user can make the column re-appear by using the" - + " menu in the upper right of the table.<br/>" - + " Columns can also be made invisible, in which case they can" - + " not be brought back by the user."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableColumnHeaders.java b/src/com/vaadin/demo/sampler/features/table/TableColumnHeaders.java deleted file mode 100644 index cf0f996397..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableColumnHeaders.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableColumnHeaders extends Feature { - - @Override - public String getName() { - return "Table, column headers"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "A Table can have column headers, which support different modes" - + " with automatic or explicitly set caption and/or icon."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableColumnReordering.java b/src/com/vaadin/demo/sampler/features/table/TableColumnReordering.java deleted file mode 100644 index 4a92c94d2c..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableColumnReordering.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableColumnReordering extends Feature { - - @Override - public String getName() { - return "Table, column drag&drop"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "The columns can be rearranged with drag&drop - a feature" - + " which can be enabled or disabled."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableHeaderIcons.java b/src/com/vaadin/demo/sampler/features/table/TableHeaderIcons.java deleted file mode 100644 index e097b09811..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableHeaderIcons.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableHeaderIcons extends Feature { - - @Override - public String getName() { - return "Table, icons in headers"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "A Table can have icons in the column- and rowheaders. " - + " The rowheader icon can come from a item property, or be" - + " explicitly set."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableLazyLoading.java b/src/com/vaadin/demo/sampler/features/table/TableLazyLoading.java deleted file mode 100644 index ef9f9014c6..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableLazyLoading.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableLazyLoading extends Feature { - - @Override - public String getName() { - return "Table, lazy loading"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "Table supports lazy-loading, which means that the content is" - + " loaded from the server only when needed. This allows the " - + " table to stay efficient even when scrolling hundreds of" - + " thousands of rows.<br/>Try scrolling a fair amount quickly!"; - - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java b/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java deleted file mode 100644 index fd5f4fde4b..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import java.util.HashSet; -import java.util.Set; - -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.demo.sampler.ExampleUtil; -import com.vaadin.event.Action; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Table.CellStyleGenerator; - -@SuppressWarnings("serial") -public class TableMainFeaturesExample extends VerticalLayout { - - Table table = new Table("ISO-3166 Country Codes and flags"); - - HashSet<Object> markedRows = new HashSet<Object>(); - - static final Action ACTION_MARK = new Action("Mark"); - static final Action ACTION_UNMARK = new Action("Unmark"); - static final Action ACTION_LOG = new Action("Save"); - static final Action[] ACTIONS_UNMARKED = new Action[] { ACTION_MARK, - ACTION_LOG }; - static final Action[] ACTIONS_MARKED = new Action[] { ACTION_UNMARK, - ACTION_LOG }; - - public TableMainFeaturesExample() { - addComponent(table); - - // Label to indicate current selection - final Label selected = new Label("No selection"); - addComponent(selected); - - // set a style name, so we can style rows and cells - table.setStyleName("iso3166"); - - // size - table.setWidth("100%"); - table.setPageLength(7); - - // selectable - table.setSelectable(true); - table.setMultiSelect(true); - table.setImmediate(true); // react at once when something is selected - - // connect data source - table.setContainerDataSource(ExampleUtil.getISO3166Container()); - - // turn on column reordering and collapsing - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - - // set column headers - table.setColumnHeaders(new String[] { "Country", "Code", "Icon file" }); - - // Icons for column headers - table.setColumnIcon(ExampleUtil.iso3166_PROPERTY_FLAG, - new ThemeResource("../sampler/icons/action_save.gif")); - table.setColumnIcon(ExampleUtil.iso3166_PROPERTY_NAME, - new ThemeResource("../sampler/icons/icon_get_world.gif")); - table.setColumnIcon(ExampleUtil.iso3166_PROPERTY_SHORT, - new ThemeResource("../sampler/icons/page_code.gif")); - - // Column alignment - table.setColumnAlignment(ExampleUtil.iso3166_PROPERTY_SHORT, - Table.ALIGN_CENTER); - - // Column width - table.setColumnExpandRatio(ExampleUtil.iso3166_PROPERTY_NAME, 1); - table.setColumnWidth(ExampleUtil.iso3166_PROPERTY_SHORT, 70); - - // Collapse one column - the user can make it visible again - try { - table.setColumnCollapsed(ExampleUtil.iso3166_PROPERTY_FLAG, true); - } catch (IllegalAccessException e) { - // Not critical, but strange - System.err.println(e); - } - - // show row header w/ icon - table.setRowHeaderMode(Table.ROW_HEADER_MODE_ICON_ONLY); - table.setItemIconPropertyId(ExampleUtil.iso3166_PROPERTY_FLAG); - - // Actions (a.k.a context menu) - table.addActionHandler(new Action.Handler() { - public Action[] getActions(Object target, Object sender) { - if (markedRows.contains(target)) { - return ACTIONS_MARKED; - } else { - return ACTIONS_UNMARKED; - } - } - - public void handleAction(Action action, Object sender, Object target) { - if (ACTION_MARK.equals(action)) { - markedRows.add(target); - table.requestRepaint(); - } else if (ACTION_UNMARK.equals(action)) { - markedRows.remove(target); - table.requestRepaint(); - } else if (ACTION_LOG.equals(action)) { - Item item = table.getItem(target); - addComponent(new Label("Saved: " - + target - + ", " - + item.getItemProperty( - ExampleUtil.iso3166_PROPERTY_NAME) - .getValue())); - } - - } - - }); - - // style generator - table.setCellStyleGenerator(new CellStyleGenerator() { - public String getStyle(Object itemId, Object propertyId) { - if (propertyId == null) { - // no propertyId, styling row - return (markedRows.contains(itemId) ? "marked" : null); - } else if (ExampleUtil.iso3166_PROPERTY_NAME.equals(propertyId)) { - return "bold"; - } else { - // no style - return null; - } - - } - - }); - - // listen for valueChange, a.k.a 'select' and update the label - table.addListener(new Table.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - // in multiselect mode, a Set of itemIds is returned, - // in singleselect mode the itemId is returned directly - Set<?> value = (Set<?>) event.getProperty().getValue(); - if (null == value || value.size() == 0) { - selected.setValue("No selection"); - } else { - selected.setValue("Selected: " + table.getValue()); - } - } - }); - - } -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableMouseEvents.java b/src/com/vaadin/demo/sampler/features/table/TableMouseEvents.java deleted file mode 100644 index 810363cab2..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableMouseEvents.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableMouseEvents extends Feature { - - @Override - public String getName() { - return "Table, mouse events"; - } - - @Override - public Component getExample() { - return new TableStylingExample(); - } - - @Override - public String getDescription() { - return "An ItemClickListener can be used to react to mouse click" - + " events. Different buttons, double click, and modifier keys" - + " can be detected.<br/>Double-click a first or last name to" - + " toggle it's marked state."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableRowHeaders.java b/src/com/vaadin/demo/sampler/features/table/TableRowHeaders.java deleted file mode 100644 index de4e484240..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableRowHeaders.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableRowHeaders extends Feature { - - @Override - public String getName() { - return "Table, row headers"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "A Table can have row headers, which support different modes" - + " with automatic or explicitly set caption and/or icon."; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableRowStyling.java b/src/com/vaadin/demo/sampler/features/table/TableRowStyling.java deleted file mode 100644 index 99133821f5..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableRowStyling.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableRowStyling extends Feature { - - @Override - public String getName() { - return "Table, row styling"; - } - - @Override - public Component getExample() { - return new TableStylingExample(); - } - - @Override - public String getDescription() { - return "Rows can be styled in a Table by using a CellStyleGenerator." - + " Regular CSS is used to create the actual style.<br/>Use the" - + " context menu (right-/ctrl-click) to apply a row style in" - + " the example."; - - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableSorting.java b/src/com/vaadin/demo/sampler/features/table/TableSorting.java deleted file mode 100644 index f6f8e686d7..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableSorting.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.FeatureSet; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class TableSorting extends Feature { - - @Override - public String getName() { - return "Table, sorting"; - } - - @Override - public Component getExample() { - return new TableMainFeaturesExample(); - } - - @Override - public String getDescription() { - return "The Table columns can (optionally) be sorted by clicking the" - + " column header - a sort direction indicator will appear." - + " Clicking again will change the sorting direction."; - - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Table.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { FeatureSet.Tables.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/table/TableStylingExample.java b/src/com/vaadin/demo/sampler/features/table/TableStylingExample.java deleted file mode 100644 index bdcdae5515..0000000000 --- a/src/com/vaadin/demo/sampler/features/table/TableStylingExample.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.vaadin.demo.sampler.features.table; - -import java.util.HashMap; -import java.util.HashSet; - -import com.vaadin.data.Item; -import com.vaadin.demo.sampler.ExampleUtil; -import com.vaadin.event.Action; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Link; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Table.CellStyleGenerator; - -@SuppressWarnings("serial") -public class TableStylingExample extends VerticalLayout { - - Table table = new Table(); - - HashMap<Object, String> markedRows = new HashMap<Object, String>(); - HashMap<Object, HashSet<Object>> markedCells = new HashMap<Object, HashSet<Object>>(); - - static final Action ACTION_RED = new Action("red"); - static final Action ACTION_BLUE = new Action("blue"); - static final Action ACTION_GREEN = new Action("green"); - static final Action ACTION_NONE = new Action("none"); - static final Action[] ACTIONS = new Action[] { ACTION_RED, ACTION_GREEN, - ACTION_BLUE, ACTION_NONE }; - - public TableStylingExample() { - setSpacing(true); - - addComponent(table); - - // set a style name, so we can style rows and cells - table.setStyleName("contacts"); - - // size - table.setWidth("100%"); - table.setPageLength(7); - - // connect data source - table.setContainerDataSource(ExampleUtil.getPersonContainer()); - - // Generate the email-link from firstname & lastname - table.addGeneratedColumn("Email", new Table.ColumnGenerator() { - public Component generateCell(Table source, Object itemId, - Object columnId) { - Item item = table.getItem(itemId); - String fn = (String) item.getItemProperty( - ExampleUtil.PERSON_PROPERTY_FIRSTNAME).getValue(); - String ln = (String) item.getItemProperty( - ExampleUtil.PERSON_PROPERTY_LASTNAME).getValue(); - String email = fn.toLowerCase() + "." + ln.toLowerCase() - + "@example.com"; - // the Link -component: - Link emailLink = new Link(email, new ExternalResource("mailto:" - + email)); - return emailLink; - } - - }); - - // turn on column reordering and collapsing - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - - // Actions (a.k.a context menu) - - table.addActionHandler(new Action.Handler() { - public Action[] getActions(Object target, Object sender) { - return ACTIONS; - } - - public void handleAction(Action action, Object sender, Object target) { - markedRows.remove(target); - if (!ACTION_NONE.equals(action)) { - // we're using the cations caption as stylename as well: - markedRows.put(target, action.getCaption()); - } - // this causes the CellStyleGenerator to return new styles, - // but table can't automatically know, we must tell it: - table.requestRepaint(); - } - - }); - - // style generator - table.setCellStyleGenerator(new CellStyleGenerator() { - public String getStyle(Object itemId, Object propertyId) { - if (propertyId == null) { - // no propertyId, styling row - return (markedRows.get(itemId)); - } else if (propertyId.equals("Email")) { - // style the generated email column - return "email"; - } else { - HashSet<Object> cells = markedCells.get(itemId); - if (cells != null && cells.contains(propertyId)) { - // marked cell - return "marked"; - } else { - // no style - return null; - } - } - - } - - }); - - // toggle cell 'marked' styling when double-clicked - table.addListener(new ItemClickListener() { - public void itemClick(ItemClickEvent event) { - if (event.getButton() == ItemClickEvent.BUTTON_RIGHT) { - // you can handle left/right/middle -mouseclick - } - - if (event.isDoubleClick()) { - Object itemId = event.getItemId(); - Object propertyId = event.getPropertyId(); - HashSet<Object> cells = markedCells.get(itemId); - if (cells == null) { - cells = new HashSet<Object>(); - markedCells.put(itemId, cells); - } - if (cells.contains(propertyId)) { - // toggle marking off - cells.remove(propertyId); - } else { - // toggle marking on - cells.add(propertyId); - } - // this causes the CellStyleGenerator to return new styles, - // but table can't automatically know, we must tell it: - table.requestRepaint(); - } - } - }); - - // Editing - // we don't want to update container before pressing 'save': - table.setWriteThrough(false); - // edit button - final Button editButton = new Button("Edit"); - addComponent(editButton); - editButton.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - table.setEditable(!table.isEditable()); - editButton.setCaption((table.isEditable() ? "Save" : "Edit")); - } - }); - setComponentAlignment(editButton, "right"); - } -} diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetDisabled.png b/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetDisabled.png Binary files differdeleted file mode 100644 index ce99368151..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetDisabled.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetIcons.png b/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetIcons.png Binary files differdeleted file mode 100644 index d7420ddc35..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetIcons.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetScrolling.png b/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetScrolling.png Binary files differdeleted file mode 100644 index b62e084a9c..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/75-TabSheetScrolling.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabled.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabled.java deleted file mode 100644 index 459701a853..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabled.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.demo.sampler.features.tabsheets;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.TabSheet;
-
-@SuppressWarnings("serial")
-public class TabSheetDisabled extends Feature {
- @Override
- public String getName() {
- return "Tabsheet, disabled tabs";
- }
-
- @Override
- public String getDescription() {
- return "Individual tabs can be enabled, disabled, hidden or visible.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TabSheet.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TabSheetIcons.class, TabSheetScrolling.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java deleted file mode 100644 index c240846d86..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.vaadin.demo.sampler.features.tabsheets;
-
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-import com.vaadin.ui.TabSheet.Tab;
-
-@SuppressWarnings("serial")
-public class TabSheetDisabledExample extends VerticalLayout implements
- TabSheet.SelectedTabChangeListener, Button.ClickListener {
- private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");
- private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");
- private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");
-
- private TabSheet t;
- private Button toggleEnabled;
- private Button toggleVisible;
- private VerticalLayout l1;
- private VerticalLayout l2;
- private VerticalLayout l3;
- @SuppressWarnings("unused")
- private Tab t1, t2, t3;
-
- public TabSheetDisabledExample() {
- setSpacing(true);
-
- // Tab 1 content
- l1 = new VerticalLayout();
- l1.setMargin(true);
- l1.addComponent(new Label("There are no previously saved actions."));
- // Tab 2 content
- l2 = new VerticalLayout();
- l2.setMargin(true);
- l2.addComponent(new Label("There are no saved notes."));
- // Tab 3 content
- l3 = new VerticalLayout();
- l3.setMargin(true);
- l3.addComponent(new Label("There are currently no issues."));
-
- t = new TabSheet();
- t.setHeight("200px");
- t.setWidth("400px");
- t1 = t.addTab(l1, "Saved actions", icon1);
- t2 = t.addTab(l2, "Notes", icon2);
- t3 = t.addTab(l3, "Issues", icon3);
- t.addListener(this);
-
- toggleEnabled = new Button("Disable 'Notes' tab");
- toggleEnabled.addListener(this);
-
- toggleVisible = new Button("Hide 'Issues' tab");
- toggleVisible.addListener(this);
-
- HorizontalLayout hl = new HorizontalLayout();
- hl.setSpacing(true);
- hl.addComponent(toggleEnabled);
- hl.addComponent(toggleVisible);
-
- addComponent(t);
- addComponent(hl);
- }
-
- public void selectedTabChange(SelectedTabChangeEvent event) {
- String c = t.getTab(event.getTabSheet().getSelectedTab()).getCaption();
- getWindow().showNotification("Selected tab: " + c);
- }
-
- public void buttonClick(ClickEvent event) {
- if (toggleEnabled.equals(event.getButton())) {
- // toggleEnabled clicked
- t2.setEnabled(!t2.isEnabled());
- toggleEnabled.setCaption((t2.isEnabled() ? "Disable" : "Enable")
- + " 'Notes' tab");
-
- } else {
- // toggleVisible clicked
- t3.setVisible(!t3.isVisible());
- toggleVisible.setCaption((t3.isVisible() ? "Hide" : "Show")
- + " 'Issues' tab");
-
- }
- t.requestRepaint();
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIcons.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIcons.java deleted file mode 100644 index 5325a0913f..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIcons.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.demo.sampler.features.tabsheets;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.TabSheet;
-
-@SuppressWarnings("serial")
-public class TabSheetIcons extends Feature {
- @Override
- public String getName() {
- return "Tabsheet with icons";
- }
-
- @Override
- public String getDescription() {
- return "Each tab can have an Icon in addition to the caption.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TabSheet.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TabSheetScrolling.class, TabSheetDisabled.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java deleted file mode 100644 index 97903e8e70..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.demo.sampler.features.tabsheets;
-
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-import com.vaadin.ui.TabSheet.Tab;
-
-@SuppressWarnings("serial")
-public class TabSheetIconsExample extends VerticalLayout implements
- TabSheet.SelectedTabChangeListener {
-
- // Icons for the table
- private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");
- private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");
- private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");
-
- private TabSheet t;
-
- public TabSheetIconsExample() {
- // Tab 1 content
- VerticalLayout l1 = new VerticalLayout();
- l1.setMargin(true);
- l1.addComponent(new Label("There are no previously saved actions."));
- // Tab 2 content
- VerticalLayout l2 = new VerticalLayout();
- l2.setMargin(true);
- l2.addComponent(new Label("There are no saved notes."));
- // Tab 3 content
- VerticalLayout l3 = new VerticalLayout();
- l3.setMargin(true);
- l3.addComponent(new Label("There are currently no issues."));
-
- t = new TabSheet();
- t.setHeight("200px");
- t.setWidth("400px");
-
- t.addTab(l1, "Saved actions", icon1);
- t.addTab(l2, "Notes", icon2);
- t.addTab(l3, "Issues", icon3);
- t.addListener(this);
-
- addComponent(t);
- }
-
- public void selectedTabChange(SelectedTabChangeEvent event) {
- TabSheet tabsheet = event.getTabSheet();
- Tab tab = tabsheet.getTab(tabsheet.getSelectedTab());
- if (tab != null) {
- getWindow().showNotification("Selected tab: " + tab.getCaption());
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrolling.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrolling.java deleted file mode 100644 index 056adaf722..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrolling.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.demo.sampler.features.tabsheets;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.TabSheet;
-
-@SuppressWarnings("serial")
-public class TabSheetScrolling extends Feature {
- @Override
- public String getName() {
- return "Tabsheet, scrolling tabs";
- }
-
- @Override
- public String getDescription() {
- return "If the tabs are to many to be shown at once, a scrolling control will appear automatically.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TabSheet.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TabSheetIcons.class, TabSheetDisabled.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java b/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java deleted file mode 100644 index 19d8c2475e..0000000000 --- a/src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.demo.sampler.features.tabsheets;
-
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
-import com.vaadin.ui.TabSheet.Tab;
-
-@SuppressWarnings("serial")
-public class TabSheetScrollingExample extends VerticalLayout implements
- TabSheet.SelectedTabChangeListener {
-
- private static final ThemeResource icon1 = new ThemeResource("../sampler/icons/action_save.gif");
- private static final ThemeResource icon2 = new ThemeResource("../sampler/icons/comment_yellow.gif");
- private static final ThemeResource icon3 = new ThemeResource("../sampler/icons/icon_info.gif");
-
- private TabSheet t;
-
- public TabSheetScrollingExample() {
- // Tab 1 content
- VerticalLayout l1 = new VerticalLayout();
- l1.setMargin(true);
- l1.addComponent(new Label("There are no previously saved actions."));
- // Tab 2 content
- VerticalLayout l2 = new VerticalLayout();
- l2.setMargin(true);
- l2.addComponent(new Label("There are no saved notes."));
- // Tab 3 content
- VerticalLayout l3 = new VerticalLayout();
- l3.setMargin(true);
- l3.addComponent(new Label("There are currently no issues."));
- // Tab 4 content
- VerticalLayout l4 = new VerticalLayout();
- l4.setMargin(true);
- l4.addComponent(new Label("There are no comments."));
- // Tab 5 content
- VerticalLayout l5 = new VerticalLayout();
- l5.setMargin(true);
- l5.addComponent(new Label("There is no new feedback."));
-
- t = new TabSheet();
- t.setHeight("200px");
- t.setWidth("400px");
- t.addTab(l1, "Saved actions", icon1);
- t.addTab(l2, "Notes", icon2);
- t.addTab(l3, "Issues", icon3);
- t.addTab(l4, "Comments", icon2);
- t.addTab(l5, "Feedback", icon2);
- t.addListener(this);
-
- addComponent(t);
- }
-
- public void selectedTabChange(SelectedTabChangeEvent event) {
- TabSheet tabsheet = event.getTabSheet();
- Tab tab = tabsheet.getTab(tabsheet.getSelectedTab());
- if (tab != null) {
- getWindow().showNotification("Selected tab: " + tab.getCaption());
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/75-LabelPlain.png b/src/com/vaadin/demo/sampler/features/text/75-LabelPlain.png Binary files differdeleted file mode 100644 index 73393d2f3c..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-LabelPlain.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-LabelPreformatted.png b/src/com/vaadin/demo/sampler/features/text/75-LabelPreformatted.png Binary files differdeleted file mode 100644 index 70dd443db9..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-LabelPreformatted.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-LabelRich.png b/src/com/vaadin/demo/sampler/features/text/75-LabelRich.png Binary files differdeleted file mode 100644 index 8b8689dc02..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-LabelRich.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-RichTextEditor.png b/src/com/vaadin/demo/sampler/features/text/75-RichTextEditor.png Binary files differdeleted file mode 100644 index 022724b571..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-RichTextEditor.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-TextArea.png b/src/com/vaadin/demo/sampler/features/text/75-TextArea.png Binary files differdeleted file mode 100644 index 72497f104c..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-TextArea.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-TextFieldInputPrompt.png b/src/com/vaadin/demo/sampler/features/text/75-TextFieldInputPrompt.png Binary files differdeleted file mode 100644 index dc7fbb38f9..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-TextFieldInputPrompt.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-TextFieldSecret.png b/src/com/vaadin/demo/sampler/features/text/75-TextFieldSecret.png Binary files differdeleted file mode 100644 index 929c79e05a..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-TextFieldSecret.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/75-TextFieldSingle.png b/src/com/vaadin/demo/sampler/features/text/75-TextFieldSingle.png Binary files differdeleted file mode 100644 index 5df731e6d3..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/75-TextFieldSingle.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/text/LabelPlain.java b/src/com/vaadin/demo/sampler/features/text/LabelPlain.java deleted file mode 100644 index fbc174bf62..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/LabelPlain.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Label;
-
-@SuppressWarnings("serial")
-public class LabelPlain extends Feature {
- @Override
- public String getName() {
- return "Label, plain text";
- }
-
- @Override
- public String getDescription() {
- return "In this example the content mode is set to"
- + " CONTENT_TEXT, meaning that the label will contain"
- + " only plain text.";
-
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Label.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { LabelPreformatted.class, LabelRich.class,
- TextFieldSingle.class, TextArea.class, RichTextEditor.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/LabelPlainExample.java b/src/com/vaadin/demo/sampler/features/text/LabelPlainExample.java deleted file mode 100644 index b1ed134aa1..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/LabelPlainExample.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class LabelPlainExample extends VerticalLayout {
-
- public LabelPlainExample() {
- setSpacing(true);
-
- Label plainText = new Label("This is an example of a Label"
- + " component. The content mode of this label is set"
- + " to CONTENT_TEXT. This means that it will display"
- + " the content text as is. HTML and XML special characters"
- + " (<,>,&) are escaped properly to allow displaying them.");
- plainText.setContentMode(Label.CONTENT_TEXT);
-
- addComponent(plainText);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/LabelPreformatted.java b/src/com/vaadin/demo/sampler/features/text/LabelPreformatted.java deleted file mode 100644 index 0bd4d6d365..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/LabelPreformatted.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Label;
-
-@SuppressWarnings("serial")
-public class LabelPreformatted extends Feature {
- @Override
- public String getName() {
- return "Label, preformatted";
- }
-
- @Override
- public String getDescription() {
- return "In this example the content mode is set to"
- + " CONTENT_PREFORMATTED. The text for this content type"
- + " is by default rendered with fixed-width font. Line breaks"
- + " can be inserted with \\n and tabulator characters with \\t.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Label.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { LabelPlain.class, LabelRich.class,
- TextFieldSingle.class, TextArea.class, RichTextEditor.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/LabelPreformattedExample.java b/src/com/vaadin/demo/sampler/features/text/LabelPreformattedExample.java deleted file mode 100644 index cf4da1d178..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/LabelPreformattedExample.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class LabelPreformattedExample extends VerticalLayout {
-
- public LabelPreformattedExample() {
- setSpacing(true);
-
- Label preformattedText = new Label(
- "This is an example of a Label component.\n"
- + "\nThe content mode of this label is set"
- + "\nto CONTENT_PREFORMATTED. This means"
- + "\nthat it will display the content text"
- + "\nusing a fixed-width font. You also have"
- + "\nto insert the line breaks yourself.\n"
- + "\n\tHTML and XML special characters"
- + "\n\t(<,>,&) are escaped properly to"
- + "\n\tallow displaying them.");
- preformattedText.setContentMode(Label.CONTENT_PREFORMATTED);
-
- addComponent(preformattedText);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/LabelRich.java b/src/com/vaadin/demo/sampler/features/text/LabelRich.java deleted file mode 100644 index 9f8cfb78ca..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/LabelRich.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Label;
-
-@SuppressWarnings("serial")
-public class LabelRich extends Feature {
- @Override
- public String getName() {
- return "Label, rich text";
- }
-
- @Override
- public String getDescription() {
- return "In this example the content mode is set to"
- + " CONTENT_XHTML. This content mode assumes that the"
- + " content set to the label will be valid XHTML.<br/>"
- + "Click the <i>Edit</i> button to edit the label content.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Label.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { LabelPlain.class, LabelPreformatted.class,
- RichTextEditor.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/LabelRichExample.java b/src/com/vaadin/demo/sampler/features/text/LabelRichExample.java deleted file mode 100644 index 9251a85828..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/LabelRichExample.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.RichTextArea;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-@SuppressWarnings("serial")
-public class LabelRichExample extends VerticalLayout implements ClickListener {
-
- private Button b;
- private Label richText;
-
- private final RichTextArea editor = new RichTextArea();
-
- public LabelRichExample() {
- setSpacing(true);
- setSizeUndefined(); // let layout grow with content
-
- richText = new Label(
- "<h1>Rich text example</h1>"
- + "<p>The <b>quick</b> brown fox jumps <sup>over</sup> the <b>lazy</b> dog.</p>"
- + "<p>This text can be edited with the <i>Edit</i> -button</p>");
- richText.setContentMode(Label.CONTENT_XHTML);
- richText.setSizeUndefined();
-
- addComponent(richText);
-
- b = new Button("Edit");
- b.addListener(this);
- addComponent(b);
- setComponentAlignment(b, "right");
- }
-
- public void buttonClick(ClickEvent event) {
- if (getComponentIterator().next() == richText) {
- editor.setValue(richText.getValue());
- replaceComponent(richText, editor);
- b.setCaption("Apply");
- } else {
- richText.setValue(editor.getValue());
- replaceComponent(editor, richText);
- b.setCaption("Edit");
- }
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/RichTextEditor.java b/src/com/vaadin/demo/sampler/features/text/RichTextEditor.java deleted file mode 100644 index bc0ca6cddd..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/RichTextEditor.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.RichTextArea;
-
-@SuppressWarnings("serial")
-public class RichTextEditor extends Feature {
- @Override
- public String getName() {
- return "Rich text area";
- }
-
- @Override
- public String getDescription() {
- return "The RichTextArea allows 'rich' formatting of the input.<br/>"
- + "Click the <i>Edit</i> button to edit the label content"
- + " with the RichTextArea.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(RichTextArea.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TextArea.class, LabelRich.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Component getExample() {
- return new LabelRichExample();
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextArea.java b/src/com/vaadin/demo/sampler/features/text/TextArea.java deleted file mode 100644 index cddf48c915..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextArea.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.TextField;
-
-@SuppressWarnings("serial")
-public class TextArea extends Feature {
- @Override
- public String getName() {
- return "Text area";
- }
-
- @Override
- public String getDescription() {
- return "A text field can be configured to allow multiple lines of input."
- + "<br>The amount of columns and lines can be set, and both are set here to"
- + " 20 characters. Note that this only affects the width and height of the"
- + " component, not the allowed length of input.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TextField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { RichTextEditor.class, TextFieldSingle.class,
- FeatureSet.Texts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java b/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java deleted file mode 100644 index 27ea8e91da..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TextField;
-
-@SuppressWarnings("serial")
-public class TextAreaExample extends HorizontalLayout implements
- Property.ValueChangeListener {
-
- private static final String initialText = "The quick brown fox jumps over the lazy dog.";
-
- private Label plainText;
- private final TextField editor;
-
- public TextAreaExample() {
- setSpacing(true);
- setWidth("100%");
-
- editor = new TextField("", initialText);
- editor.setRows(20); // this will make it an 'area', i.e multiline
- editor.setColumns(20);
- editor.addListener(this);
- editor.setImmediate(true);
- addComponent(editor);
-
- // the TextArea is immediate, and it's valueCahnge updates the Label,
- // so this button actually does nothing
- addComponent(new Button(">"));
-
- plainText = new Label(initialText);
- plainText.setContentMode(Label.CONTENT_XHTML);
- addComponent(plainText);
- setExpandRatio(plainText, 1);
- }
-
- /*
- * Catch the valuechange event of the textfield and update the value of the
- * label component
- */
- public void valueChange(ValueChangeEvent event) {
- String text = (String) editor.getValue();
- if (text != null) {
- // replace newline with BR, because we're using Label.CONTENT_XHTML
- text = text.replaceAll("\n", "<br/>");
- }
- plainText.setValue(text);
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldInputPrompt.java b/src/com/vaadin/demo/sampler/features/text/TextFieldInputPrompt.java deleted file mode 100644 index 149c3b9743..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldInputPrompt.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.demo.sampler.features.selects.ComboBoxInputPrompt;
-import com.vaadin.demo.sampler.features.selects.ComboBoxNewItems;
-import com.vaadin.ui.TextField;
-
-@SuppressWarnings("serial")
-public class TextFieldInputPrompt extends Feature {
- @Override
- public String getName() {
- return "Text field with input prompt";
- }
-
- @Override
- public String getDescription() {
- return " The TextField can have an <i>input prompt</i> - a textual hint that is shown within"
- + " the field when the field is otherwise empty.<br/>"
- + " You can use an input prompt instead of a caption to save"
- + " space, but only do so if the function of the TextField is"
- + " still clear when a value has been entered and the prompt is no"
- + " longer visible.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TextField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- // TODO update CB -ref to 'suggest' pattern, when available
- return new Class[] { TextFieldSingle.class, TextFieldSecret.class,
- ComboBoxInputPrompt.class, ComboBoxNewItems.class,
- FeatureSet.Texts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] { new NamedExternalResource(
- "UI Patterns, Input Prompt",
- "http://ui-patterns.com/pattern/InputPrompt") };
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java b/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java deleted file mode 100644 index 0889b07fa1..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldInputPromptExample.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class TextFieldInputPromptExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- public TextFieldInputPromptExample() {
- // add som 'air' to the layout
- setSpacing(true);
- setMargin(true, false, false, false);
-
- // Username field + input prompt
- TextField username = new TextField();
- username.setInputPrompt("Username");
- // configure & add to layout
- username.setImmediate(true);
- username.addListener(this);
- addComponent(username);
-
- // Password field + input prompt
- TextField password = new TextField();
- password.setInputPrompt("Password");
- // configure & add to layout
- password.setSecret(true);
- password.setImmediate(true);
- password.addListener(this);
- addComponent(password);
-
- // Comment field + input prompt
- TextField comment = new TextField();
- comment.setInputPrompt("Comment");
- // configure & add to layout
- comment.setRows(3);
- comment.setImmediate(true);
- comment.addListener(this);
- addComponent(comment);
-
- }
-
- public void valueChange(ValueChangeEvent event) {
- getWindow().showNotification("Received " + event.getProperty());
-
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldSecret.java b/src/com/vaadin/demo/sampler/features/text/TextFieldSecret.java deleted file mode 100644 index 2a18395a85..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldSecret.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.demo.sampler.features.selects.ComboBoxNewItems;
-import com.vaadin.ui.TextField;
-
-@SuppressWarnings("serial")
-public class TextFieldSecret extends Feature {
- @Override
- public String getName() {
- return "Text field, secret (password)";
- }
-
- @Override
- public String getDescription() {
- return "For sensitive data input, such as passwords, the text field can"
- + " also be set into secret mode where the input will not be"
- + " echoed to display.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TextField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- // TODO update CB -ref to 'suggest' pattern, when available
- return new Class[] { TextFieldSingle.class, ComboBoxNewItems.class,
- FeatureSet.Texts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldSecretExample.java b/src/com/vaadin/demo/sampler/features/text/TextFieldSecretExample.java deleted file mode 100644 index 127a6bacbe..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldSecretExample.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class TextFieldSecretExample extends VerticalLayout {
-
- private final TextField username;
- private final TextField password;
-
- public TextFieldSecretExample() {
- setSizeUndefined(); // let content 'push' size
- setSpacing(true);
-
- // Username
- username = new TextField("Username");
- addComponent(username);
-
- // Password
- password = new TextField("Password");
- password.setSecret(true);
- addComponent(password);
-
- // Login button
- Button loginButton = new Button("Login", new Button.ClickListener() {
- // inline click listener
- public void buttonClick(ClickEvent event) {
- getWindow().showNotification(
- "User: " + username.getValue() + " Password: "
- + password.getValue());
-
- }
- });
- addComponent(loginButton);
- setComponentAlignment(loginButton, "right");
-
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldSingle.java b/src/com/vaadin/demo/sampler/features/text/TextFieldSingle.java deleted file mode 100644 index 7a5e390144..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldSingle.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.demo.sampler.features.selects.ComboBoxNewItems;
-import com.vaadin.ui.TextField;
-
-@SuppressWarnings("serial")
-public class TextFieldSingle extends Feature {
- @Override
- public String getName() {
- return "Text field";
- }
-
- @Override
- public String getDescription() {
- return "A single-line TextField is a fundamental UI building blocks"
- + " with numerous uses.<br/>"
- + "If the input would benefit from remembering previous values,"
- + " you might want to consider using a ComboBox it it's "
- + " 'suggesting mode' instead.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(TextField.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- // TODO update CB -ref to 'suggest' pattern, when available
- return new Class[] { TextFieldSecret.class, ComboBoxNewItems.class,
- FeatureSet.Texts.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/text/TextFieldSingleExample.java b/src/com/vaadin/demo/sampler/features/text/TextFieldSingleExample.java deleted file mode 100644 index 209cdc3429..0000000000 --- a/src/com/vaadin/demo/sampler/features/text/TextFieldSingleExample.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class TextFieldSingleExample extends VerticalLayout implements
- Property.ValueChangeListener {
-
- private final TextField editor = new TextField("Echo this:");
-
- public TextFieldSingleExample() {
- setSpacing(true);
-
- editor.addListener(this);
- editor.setImmediate(true);
- // editor.setColumns(5); // guarantees that at least 5 chars fit
-
- addComponent(editor);
- }
-
- /*
- * Catch the valuechange event of the textfield and update the value of the
- * label component
- */
- public void valueChange(ValueChangeEvent event) {
- // Show the new value we received
- getWindow().showNotification((String) editor.getValue());
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/75-TreeActions.png b/src/com/vaadin/demo/sampler/features/trees/75-TreeActions.png Binary files differdeleted file mode 100644 index 7b68dee674..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/75-TreeActions.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/trees/75-TreeMouseEvents.png b/src/com/vaadin/demo/sampler/features/trees/75-TreeMouseEvents.png Binary files differdeleted file mode 100644 index 3f22f288d1..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/75-TreeMouseEvents.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/trees/75-TreeMultiSelect.png b/src/com/vaadin/demo/sampler/features/trees/75-TreeMultiSelect.png Binary files differdeleted file mode 100644 index 3b0b250c90..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/75-TreeMultiSelect.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/trees/75-TreeSingleSelect.png b/src/com/vaadin/demo/sampler/features/trees/75-TreeSingleSelect.png Binary files differdeleted file mode 100644 index 03ef1eae76..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/75-TreeSingleSelect.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeActions.java b/src/com/vaadin/demo/sampler/features/trees/TreeActions.java deleted file mode 100644 index 557eed7c44..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeActions.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.Tree;
-
-@SuppressWarnings("serial")
-public class TreeActions extends Feature {
- @Override
- public String getName() {
- return "Tree, context menu";
- }
-
- @Override
- public String getDescription() {
- return "In this example, actions have been attached to"
- + " the tree component. Try clicking the secondary mouse"
- + " button on an item in the tree.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Tree.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TreeSingleSelect.class, TreeMultiSelect.class,
- TreeMouseEvents.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Component getExample() {
- return new TreeSingleSelectExample();
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeMouseEvents.java b/src/com/vaadin/demo/sampler/features/trees/TreeMouseEvents.java deleted file mode 100644 index 4fd4c69cfb..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeMouseEvents.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Tree;
-
-@SuppressWarnings("serial")
-public class TreeMouseEvents extends Feature {
- @Override
- public String getName() {
- return "Tree, mouse events";
- }
-
- @Override
- public String getDescription() {
- return "In this example, selecting items from the tree"
- + " is disabled. Instead, another method of selection"
- + " is used. Using the ItemClickEvent, we can update the"
- + " label showing the selection."
- + "<br>Try to click your left, right and middle mouse"
- + " buttons on the tree items. Any modifier keys will"
- + " also be detected.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Tree.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TreeSingleSelect.class, TreeMultiSelect.class,
- TreeActions.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeMouseEventsExample.java b/src/com/vaadin/demo/sampler/features/trees/TreeMouseEventsExample.java deleted file mode 100644 index 7b84ce16ee..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeMouseEventsExample.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import com.vaadin.data.Item;
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.event.ItemClickEvent;
-import com.vaadin.event.ItemClickEvent.ItemClickListener;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("serial")
-public class TreeMouseEventsExample extends VerticalLayout implements
- ItemClickListener {
-
- private Tree t;
- private int itemId;
-
- public TreeMouseEventsExample() {
- setSpacing(true);
-
- // Create new Tree object using a hierarchical container from
- // ExampleUtil class
- t = new Tree("Hardware Inventory", ExampleUtil.getHardwareContainer());
-
- // Add ItemClickListener to the tree
- t.addListener(this);
-
- t.setImmediate(true);
-
- // Set tree to show the 'name' property as caption for items
- t.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);
- t.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-
- // Starting itemId # for new items
- itemId = t.getContainerDataSource().size();
-
- // Expand whole tree
- for (int i = 0; i < itemId; i++) {
- t.expandItemsRecursively(i);
- }
-
- // Disallow selecting items from the tree
- t.setSelectable(false);
-
- addComponent(t);
- }
-
- public void itemClick(ItemClickEvent event) {
- // Indicate which modifier keys are pressed
- String modifiers = "";
- if (event.isAltKey()) {
- modifiers += "Alt ";
- }
- if (event.isCtrlKey()) {
- modifiers += "Ctrl ";
- }
- if (event.isMetaKey()) {
- modifiers += "Meta ";
- }
- if (event.isShiftKey()) {
- modifiers += "Shift ";
- }
- if (modifiers.length() > 0) {
- modifiers = "Modifiers: " + modifiers;
- } else {
- modifiers = "Modifiers: none";
- }
- switch (event.getButton()) {
- case ItemClickEvent.BUTTON_LEFT:
- // Left button click updates the 'selected' Label
- getWindow().showNotification("Selected item: " + event.getItem(),
- modifiers);
- break;
- case ItemClickEvent.BUTTON_MIDDLE:
- // Middle button click removes the item
- Object parent = t.getParent(event.getItemId());
- getWindow().showNotification("Removed item: " + event.getItem(),
- modifiers);
- t.removeItem(event.getItemId());
- if (parent != null && t.getChildren(parent).size() == 0) {
- t.setChildrenAllowed(parent, false);
- }
- break;
- case ItemClickEvent.BUTTON_RIGHT:
- // Right button click creates a new child item
- getWindow().showNotification("Added item: New Item # " + itemId,
- modifiers);
- t.setChildrenAllowed(event.getItemId(), true);
- Item i = t.addItem(itemId);
- t.setChildrenAllowed(itemId, false);
- String newItemName = "New Item # " + itemId;
- i.getItemProperty(ExampleUtil.hw_PROPERTY_NAME).setValue(
- newItemName);
- t.setParent(itemId, event.getItemId());
- t.expandItem(event.getItemId());
- itemId++;
- break;
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeMultiSelect.java b/src/com/vaadin/demo/sampler/features/trees/TreeMultiSelect.java deleted file mode 100644 index a1e2a2fdc5..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeMultiSelect.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Tree;
-
-@SuppressWarnings("serial")
-public class TreeMultiSelect extends Feature {
- @Override
- public String getName() {
- return "Tree, multiple selections";
- }
-
- @Override
- public String getDescription() {
- return "In this example, you can select multiple tree nodes"
- + " and delete the selected items. Click a selected item again to de-select it.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Tree.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TreeSingleSelect.class, TreeActions.class,
- TreeMouseEvents.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeMultiSelectExample.java b/src/com/vaadin/demo/sampler/features/trees/TreeMultiSelectExample.java deleted file mode 100644 index e7e89886b0..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeMultiSelectExample.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.event.Action;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class TreeMultiSelectExample extends VerticalLayout implements
- Action.Handler {
-
- private static final Action ACTION_ADD = new Action("Add child item");
- private static final Action ACTION_DELETE = new Action("Delete");
- private static final Action[] ACTIONS = new Action[] { ACTION_ADD,
- ACTION_DELETE };
-
- private Tree tree;
- private Button deleteButton;
-
- public TreeMultiSelectExample() {
- setSpacing(true);
-
- // Create new Tree object using a hierarchical container from
- // ExampleUtil class
- tree = new Tree("Hardware Inventory", ExampleUtil
- .getHardwareContainer());
- // Set multiselect mode
- tree.setMultiSelect(true);
- tree.setImmediate(true);
- tree.addListener(new ValueChangeListener() {
- public void valueChange(ValueChangeEvent event) {
- Tree t = (Tree) event.getProperty();
- // enable if something is selected, returns a set
- deleteButton.setEnabled(t.getValue() != null
- && ((Set<?>) t.getValue()).size() > 0);
- }
- });
-
- // Add Actionhandler
- tree.addActionHandler(this);
-
- // Set tree to show the 'name' property as caption for items
- tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);
- tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-
- // Expand whole tree
- for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {
- tree.expandItemsRecursively(it.next());
- }
-
- // Create the 'delete button', inline click-listener
- deleteButton = new Button("Delete", new Button.ClickListener() {
- @SuppressWarnings("unchecked")
- public void buttonClick(ClickEvent event) {
- // Delete all the selected objects
- Object[] toDelete = ((Set<Object>) tree.getValue()).toArray();
- for (int i = 0; i < toDelete.length; i++) {
- handleAction(ACTION_DELETE, tree, toDelete[i]);
- }
- }
- });
- deleteButton.setEnabled(false);
-
- addComponent(deleteButton);
- addComponent(tree);
-
- }
-
- /*
- * Returns the set of available actions
- */
- public Action[] getActions(Object target, Object sender) {
- return ACTIONS;
- }
-
- /*
- * Handle actions
- */
- public void handleAction(Action action, Object sender, Object target) {
- if (action == ACTION_ADD) {
- // Allow children for the target item
- tree.setChildrenAllowed(target, true);
-
- // Create new item, disallow children, add name, set parent
- Object itemId = tree.addItem();
- tree.setChildrenAllowed(itemId, false);
- String newItemName = "New Item # " + itemId;
- Item item = tree.getItem(itemId);
- item.getItemProperty(ExampleUtil.hw_PROPERTY_NAME).setValue(
- newItemName);
- tree.setParent(itemId, target);
- tree.expandItem(target);
- } else if (action == ACTION_DELETE) {
- Object parent = tree.getParent(target);
- tree.removeItem(target);
- // If the deleted object's parent has no more children, set it's
- // childrenallowed property to false
- if (parent != null && tree.getChildren(parent).size() == 0) {
- tree.setChildrenAllowed(parent, false);
- }
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeSingleSelect.java b/src/com/vaadin/demo/sampler/features/trees/TreeSingleSelect.java deleted file mode 100644 index 6b6362fd5b..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeSingleSelect.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Tree;
-
-@SuppressWarnings("serial")
-public class TreeSingleSelect extends Feature {
- @Override
- public String getName() {
- return "Tree, single selection";
- }
-
- @Override
- public String getDescription() {
- return "In this example, you can select any single tree node"
- + " and modify its 'name' property. Click again to de-select.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Tree.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { TreeMultiSelect.class, TreeActions.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/trees/TreeSingleSelectExample.java b/src/com/vaadin/demo/sampler/features/trees/TreeSingleSelectExample.java deleted file mode 100644 index 7b238b74c2..0000000000 --- a/src/com/vaadin/demo/sampler/features/trees/TreeSingleSelectExample.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.vaadin.demo.sampler.features.trees;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.demo.sampler.ExampleUtil;
-import com.vaadin.event.Action;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class TreeSingleSelectExample extends HorizontalLayout implements
- Property.ValueChangeListener, Button.ClickListener, Action.Handler {
-
- // Actions for the context menu
- private static final Action ACTION_ADD = new Action("Add child item");
- private static final Action ACTION_DELETE = new Action("Delete");
- private static final Action[] ACTIONS = new Action[] { ACTION_ADD,
- ACTION_DELETE };
-
- private Tree tree;
-
- HorizontalLayout editBar;
- private TextField editor;
- private Button change;
-
- public TreeSingleSelectExample() {
- setSpacing(true);
-
- // Create the Tree,a dd to layout
- tree = new Tree("Hardware Inventory");
- addComponent(tree);
-
- // Contents from a (prefilled example) hierarchical container:
- tree.setContainerDataSource(ExampleUtil.getHardwareContainer());
-
- // Add Valuechangelistener and Actionhandler
- tree.addListener(this);
-
- // Add actions (context menu)
- tree.addActionHandler(this);
-
- // Cause valueChange immediately when the user selects
- tree.setImmediate(true);
-
- // Set tree to show the 'name' property as caption for items
- tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);
- tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-
- // Expand whole tree
- for (Object id : tree.rootItemIds()) {
- tree.expandItemsRecursively(id);
- }
-
- // Create the 'editor bar' (textfield and button in a horizontallayout)
- editBar = new HorizontalLayout();
- editBar.setMargin(false, false, false, true);
- editBar.setEnabled(false);
- addComponent(editBar);
- // textfield
- editor = new TextField("Item name");
- editor.setImmediate(true);
- editBar.addComponent(editor);
- // apply-button
- change = new Button("Apply", this, "buttonClick");
- editBar.addComponent(change);
- editBar.setComponentAlignment(change, "bottom");
- }
-
- public void valueChange(ValueChangeEvent event) {
- if (event.getProperty().getValue() != null) {
- // If something is selected from the tree, get it's 'name' and
- // insert it into the textfield
- editor.setValue(tree.getItem(event.getProperty().getValue())
- .getItemProperty(ExampleUtil.hw_PROPERTY_NAME));
- editor.requestRepaint();
- editBar.setEnabled(true);
- } else {
- editor.setValue("");
- editBar.setEnabled(false);
- }
- }
-
- public void buttonClick(ClickEvent event) {
- // If the edited value contains something, set it to be the item's new
- // 'name' property
- if (!editor.getValue().equals("")) {
- Item item = tree.getItem(tree.getValue());
- Property name = item.getItemProperty(ExampleUtil.hw_PROPERTY_NAME);
- name.setValue(editor.getValue());
- }
- }
-
- /*
- * Returns the set of available actions
- */
- public Action[] getActions(Object target, Object sender) {
- return ACTIONS;
- }
-
- /*
- * Handle actions
- */
- public void handleAction(Action action, Object sender, Object target) {
- if (action == ACTION_ADD) {
- // Allow children for the target item, and expand it
- tree.setChildrenAllowed(target, true);
- tree.expandItem(target);
-
- // Create new item, set parent, disallow children (= leaf node)
- Object itemId = tree.addItem();
- tree.setParent(itemId, target);
- tree.setChildrenAllowed(itemId, false);
-
- // Set the name for this item (we use it as item caption)
- Item item = tree.getItem(itemId);
- Property name = item.getItemProperty(ExampleUtil.hw_PROPERTY_NAME);
- name.setValue("New Item");
-
- } else if (action == ACTION_DELETE) {
- Object parent = tree.getParent(target);
- tree.removeItem(target);
- // If the deleted object's parent has no more children, set it's
- // childrenallowed property to false (= leaf node)
- if (parent != null && tree.getChildren(parent).size() == 0) {
- tree.setChildrenAllowed(parent, false);
- }
- }
- }
-}
diff --git a/src/com/vaadin/demo/sampler/features/upload/75-UploadBasic.png b/src/com/vaadin/demo/sampler/features/upload/75-UploadBasic.png Binary files differdeleted file mode 100644 index d0e28771ce..0000000000 --- a/src/com/vaadin/demo/sampler/features/upload/75-UploadBasic.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/upload/75-UploadWithProgressMonitoring.png b/src/com/vaadin/demo/sampler/features/upload/75-UploadWithProgressMonitoring.png Binary files differdeleted file mode 100644 index a1c4444d42..0000000000 --- a/src/com/vaadin/demo/sampler/features/upload/75-UploadWithProgressMonitoring.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/upload/UploadBasic.java b/src/com/vaadin/demo/sampler/features/upload/UploadBasic.java deleted file mode 100644 index 4b98557370..0000000000 --- a/src/com/vaadin/demo/sampler/features/upload/UploadBasic.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.demo.sampler.features.upload; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.Upload; - -@SuppressWarnings("serial") -public class UploadBasic extends Feature { - - @Override - public String getDescription() { - return "Upload component provides a method to handle " - + "files uploaded from clients. " - + "In this example we simply be " - + "count line breaks of the uploaded file." - + "The data could just as well be saved on " - + "the server as file or inserted into a database."; - } - - @Override - public String getName() { - return "Basic upload"; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Upload.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { UploadWithProgressMonitoring.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/upload/UploadBasicExample.java b/src/com/vaadin/demo/sampler/features/upload/UploadBasicExample.java deleted file mode 100644 index 07a85627e4..0000000000 --- a/src/com/vaadin/demo/sampler/features/upload/UploadBasicExample.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.vaadin.demo.sampler.features.upload; - -import java.io.IOException; -import java.io.OutputStream; - -import com.vaadin.ui.Label; -import com.vaadin.ui.Upload; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Upload.FinishedEvent; -import com.vaadin.ui.Upload.Receiver; - -@SuppressWarnings("serial") -public class UploadBasicExample extends VerticalLayout { - - private Label result = new Label(); - - private LineBreakCounter counter = new LineBreakCounter(); - - private Upload upload = new Upload("Upload a file", counter); - - public UploadBasicExample() { - addComponent(upload); - addComponent(result); - upload.addListener(new Upload.FinishedListener() { - public void uploadFinished(FinishedEvent event) { - result.setValue("Uploaded file contained " - + counter.getLineBreakCount() + " linebreaks"); - } - }); - - } - - public static class LineBreakCounter implements Receiver { - - private String fileName; - private String mtype; - private int counter; - - /** - * return an OutputStream that simply counts lineends - */ - public OutputStream receiveUpload(String filename, String MIMEType) { - counter = 0; - fileName = filename; - mtype = MIMEType; - return new OutputStream() { - private static final int searchedByte = '\n'; - - @Override - public void write(int b) throws IOException { - if (b == searchedByte) { - counter++; - } - } - }; - } - - public String getFileName() { - return fileName; - } - - public String getMimeType() { - return mtype; - } - - public int getLineBreakCount() { - return counter; - } - - } - -} diff --git a/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoring.java b/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoring.java deleted file mode 100644 index 8c9f04f7c6..0000000000 --- a/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoring.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.upload; - -import com.vaadin.demo.sampler.APIResource; -import com.vaadin.demo.sampler.Feature; -import com.vaadin.demo.sampler.NamedExternalResource; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Upload; - -@SuppressWarnings("serial") -public class UploadWithProgressMonitoring extends Feature { - - @Override - public String getDescription() { - return "Upload does not block the entire UI. While uploading a large" - + "file users can navigate to other views in the application." - + " Other advanced upload features used in this demo:<ul>" - + "<li> start upload once file is selected aka \"one-click-upload\"</li>" - + "<li> process the file during the upload</li>" - + "<li> trac events that occure during the update</li>" - + "<li> visualize upload progress with ProgressIndicator</li>" - + "<li> ability to cancel the upload</li>" + "</ul>"; - } - - @Override - public String getName() { - return "Upload with advanced features"; - } - - @Override - public APIResource[] getRelatedAPI() { - return new APIResource[] { new APIResource(Upload.class), - new APIResource(ProgressIndicator.class) }; - } - - @SuppressWarnings("unchecked") - @Override - public Class<? extends Feature>[] getRelatedFeatures() { - return new Class[] { UploadBasic.class }; - } - - @Override - public NamedExternalResource[] getRelatedResources() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java b/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java deleted file mode 100644 index 2c74b7fec7..0000000000 --- a/src/com/vaadin/demo/sampler/features/upload/UploadWithProgressMonitoringExample.java +++ /dev/null @@ -1,200 +0,0 @@ -package com.vaadin.demo.sampler.features.upload; - -import java.io.IOException; -import java.io.OutputStream; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Upload; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Upload.FailedEvent; -import com.vaadin.ui.Upload.FinishedEvent; -import com.vaadin.ui.Upload.Receiver; -import com.vaadin.ui.Upload.StartedEvent; -import com.vaadin.ui.Upload.SucceededEvent; - -@SuppressWarnings("serial") -public class UploadWithProgressMonitoringExample extends VerticalLayout { - - private Label state = new Label(); - private Label result = new Label(); - private Label fileName = new Label(); - private Label textualProgress = new Label(); - - private ProgressIndicator pi = new ProgressIndicator(); - - private LineBreakCounter counter = new LineBreakCounter(); - - private Upload upload = new Upload("", counter); - - public UploadWithProgressMonitoringExample() { - setMargin(true, false, false, false); - setSpacing(true); - - addComponent(new Label( - "Upload a file and we'll count the number of line break charaters found in it.")); - - // make analyzing start immediatedly when file is selected - upload.setImmediate(true); - upload.setButtonCaption("Upload File"); - addComponent(upload); - - CheckBox handBrake = new CheckBox("Simulate slow server"); - handBrake.setValue(true); - counter.setSlow(true); - handBrake - .setDescription("Sleep for 100ms after each kilobyte to simulate slower processing/bandwidth. This is to show progress indicator even with rather small files."); - handBrake.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - counter.setSlow(event.getButton().booleanValue()); - } - }); - - final Button cancelProcessing = new Button("Cancel processing"); - cancelProcessing.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - upload.interruptUpload(); - } - }); - cancelProcessing.setEnabled(false); - cancelProcessing.setStyleName("small"); - addComponent(cancelProcessing); - - handBrake.setImmediate(true); - - addComponent(handBrake); - - Panel p = new Panel("Status"); - p.setSizeUndefined(); - FormLayout l = new FormLayout(); - l.setMargin(true); - p.setContent(l); - state.setCaption("Current state"); - state.setValue("Idle"); - l.addComponent(state); - fileName.setCaption("File name"); - l.addComponent(fileName); - result.setCaption("Line breaks counted"); - l.addComponent(result); - pi.setCaption("Progress"); - pi.setVisible(false); - l.addComponent(pi); - textualProgress.setVisible(false); - l.addComponent(textualProgress); - - addComponent(p); - - upload.addListener(new Upload.StartedListener() { - public void uploadStarted(StartedEvent event) { - // this method gets called immediatedly after upload is - // started - pi.setValue(0f); - pi.setVisible(true); - pi.setPollingInterval(500); // hit server frequantly to get - textualProgress.setVisible(true); - // updates to client - state.setValue("Uploading"); - fileName.setValue(event.getFilename()); - - cancelProcessing.setEnabled(true); - } - }); - - upload.addListener(new Upload.ProgressListener() { - public void updateProgress(long readBytes, long contentLength) { - // this method gets called several times during the update - pi.setValue(new Float(readBytes / (float) contentLength)); - textualProgress.setValue("Processed " + readBytes - + " bytes of " + contentLength); - result.setValue(counter.getLineBreakCount() + " (counting...)"); - } - - }); - - upload.addListener(new Upload.SucceededListener() { - public void uploadSucceeded(SucceededEvent event) { - result.setValue(counter.getLineBreakCount() + " (total)"); - } - }); - - upload.addListener(new Upload.FailedListener() { - public void uploadFailed(FailedEvent event) { - result.setValue(counter.getLineBreakCount() - + " (counting interrupted at " - + Math.round(100 * (Float) pi.getValue()) + "%)"); - } - }); - - upload.addListener(new Upload.FinishedListener() { - public void uploadFinished(FinishedEvent event) { - state.setValue("Idle"); - pi.setVisible(false); - textualProgress.setVisible(false); - cancelProcessing.setEnabled(false); - } - }); - - } - - public static class LineBreakCounter implements Receiver { - - private String fileName; - private String mtype; - - private int counter; - private int total; - private boolean sleep; - - /** - * return an OutputStream that simply counts lineends - */ - public OutputStream receiveUpload(String filename, String MIMEType) { - counter = 0; - total = 0; - fileName = filename; - mtype = MIMEType; - return new OutputStream() { - private static final int searchedByte = '\n'; - - @Override - public void write(int b) throws IOException { - total++; - if (b == searchedByte) { - counter++; - } - if (sleep && total % 1000 == 0) { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - }; - } - - public String getFileName() { - return fileName; - } - - public String getMimeType() { - return mtype; - } - - public int getLineBreakCount() { - return counter; - } - - public void setSlow(boolean value) { - sleep = value; - } - - } - -} diff --git a/src/com/vaadin/demo/sampler/features/windows/75-NativeWindow.png b/src/com/vaadin/demo/sampler/features/windows/75-NativeWindow.png Binary files differdeleted file mode 100644 index 14981b1836..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-NativeWindow.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/75-Subwindow.png b/src/com/vaadin/demo/sampler/features/windows/75-Subwindow.png Binary files differdeleted file mode 100644 index bd92cc04e8..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-Subwindow.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowAutoSized.png b/src/com/vaadin/demo/sampler/features/windows/75-SubwindowAutoSized.png Binary files differdeleted file mode 100644 index 2752d2f581..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowAutoSized.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowClose.png b/src/com/vaadin/demo/sampler/features/windows/75-SubwindowClose.png Binary files differdeleted file mode 100644 index a76e9ba0b2..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowClose.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowModal.png b/src/com/vaadin/demo/sampler/features/windows/75-SubwindowModal.png Binary files differdeleted file mode 100644 index 0eb9cfe0fd..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowModal.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowPositioned.png b/src/com/vaadin/demo/sampler/features/windows/75-SubwindowPositioned.png Binary files differdeleted file mode 100644 index c3e0d5f0a3..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowPositioned.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowSized.png b/src/com/vaadin/demo/sampler/features/windows/75-SubwindowSized.png Binary files differdeleted file mode 100644 index c918d84063..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/75-SubwindowSized.png +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/features/windows/NativeWindow.java b/src/com/vaadin/demo/sampler/features/windows/NativeWindow.java deleted file mode 100644 index 0bb2bb2331..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/NativeWindow.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.demo.sampler.FeatureSet.Links;
-import com.vaadin.demo.sampler.FeatureSet.Windows;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class NativeWindow extends Feature {
-
- @Override
- public String getName() {
- return "Native window";
- }
-
- @Override
- public String getDescription() {
- return "A <i>NativeWindow</i> is a separate browser window, which"
- + " looks and works just like the main window.<br/>"
- + " There are multiple ways to make native windows; you can"
- + " override Application.getWindow() (recommended in any case)"
- + " but you can also use Application.addWindow() - the added"
- + " window will be available from a separate URL (which is"
- + " based on the window name.)<br/> When you view Sampler in"
- + " a new window, the getWindow() method is used, this example"
- + " also uses addWindow().";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { Subwindow.class, Links.class, Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/NativeWindowExample.java b/src/com/vaadin/demo/sampler/features/windows/NativeWindowExample.java deleted file mode 100644 index adff1292b6..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/NativeWindowExample.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import java.util.Date;
-
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class NativeWindowExample extends VerticalLayout {
-
- public NativeWindowExample() {
- setSpacing(true);
-
- // Add a button for opening the window
- Button open = new Button("Open native window",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- Window window = new NativeWindow();
- // Add the window to the application
- getApplication().addWindow(window);
-
- // Get the URL for the window, and open that in a new
- // browser window, in this case in a small window.
- getWindow().open(new ExternalResource(window.getURL()), // URL
- "_blank", // window name
- 500, // width
- 200, // weight
- Window.BORDER_NONE // decorations
- );
- }
- });
- addComponent(open);
-
- // Add a link for opening sampler in a new window; this will cause
- // Sampler's getWindow() to create a new Window.
- Link openSampler = new Link("Open Sampler in a new window",
- new ExternalResource("#"), // URL
- "_blank", // window name
- 700, // width
- 500, // height
- Link.TARGET_BORDER_NONE // decorations
- );
- addComponent(openSampler);
-
- }
-
- /*
- * We'll be instantiating the same window multiple times, so we'll make an
- * inner class for separation. You could of course just create a new
- * Window() and addCompoent to that instead.
- */
- class NativeWindow extends Window {
- NativeWindow() {
- // Configure the layout
- VerticalLayout layout = (VerticalLayout) getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a native window, created at "
- + new Date());
- addComponent(message);
-
- // It's a good idea to remove the window when it's closed (also
- // when the browser window 'x' is used), unless you explicitly
- // want the window to persist (if it's not removed from the
- // application, it can still be retrieved from it's URL.
- addListener(new CloseListener() {
- public void windowClose(CloseEvent e) {
- // remove from application
- getApplication().removeWindow(NativeWindow.this);
- }
- });
-
- }
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/windows/Subwindow.java b/src/com/vaadin/demo/sampler/features/windows/Subwindow.java deleted file mode 100644 index 0aaafd9e52..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/Subwindow.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class Subwindow extends Feature {
-
- @Override
- public String getName() {
- return "Subwindow";
- }
-
- @Override
- public String getDescription() {
- return "A <i>Subwindow</i> is a popup-window within the browser window."
- + " There can be multiple subwindows in one (native) browser"
- + " window.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { NativeWindow.class, FeatureSet.Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSized.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSized.java deleted file mode 100644 index 642b986ee3..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSized.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class SubwindowAutoSized extends Feature {
-
- @Override
- public String getName() {
- return "Window, automatic size";
- }
-
- @Override
- public String getDescription() {
- return "The window will be automatically sized to fit the contents,"
- + " if the size of the window (and it's layout) is undefined.<br/>"
- + " Note that by default Window contains a VerticalLayout that"
- + " is 100% wide.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { SubwindowSized.class, FeatureSet.Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSizedExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSizedExample.java deleted file mode 100644 index 11016fd6f6..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSizedExample.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowAutoSizedExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowAutoSizedExample() {
-
- // Create the window
- subwindow = new Window("Automatically sized subwindow");
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
- // make it undefined for auto-sizing window
- layout.setSizeUndefined();
-
- // Add some content;
- for (int i = 0; i < 7; i++) {
- TextField tf = new TextField();
- tf.setWidth("400px");
- subwindow.addComponent(tf);
- }
-
- Button close = new Button("Close", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- // close the window by removing it from the main window
- getApplication().getMainWindow().removeWindow(subwindow);
- }
- });
- // The components added to the window are actually added to the window's
- // layout; you can use either. Alignments are set using the layout
- layout.addComponent(close);
- layout.setComponentAlignment(close, "right bottom");
-
- // Add a button for opening the subwindow
- Button open = new Button("Open sized window",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() != null) {
- // window is already showing
- getWindow().showNotification(
- "Window is already open");
- } else {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
- }
- });
- addComponent(open);
-
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowClose.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowClose.java deleted file mode 100644 index 529bd58b5b..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowClose.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class SubwindowClose extends Feature {
-
- @Override
- public String getName() {
- return "Window closing";
- }
-
- @Override
- public String getDescription() {
- return "Using a <i>CloseListener</i> one can detect when a window is closed.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { FeatureSet.Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowCloseExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowCloseExample.java deleted file mode 100644 index 34f886c0a9..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowCloseExample.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window.CloseEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowCloseExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowCloseExample() {
-
- // Create the window
- subwindow = new Window("A subwindow w/ close-listener");
- subwindow.addListener(new Window.CloseListener() {
- // inline close-listener
- public void windowClose(CloseEvent e) {
- getApplication().getMainWindow().showNotification(
- "Window closed");
- }
- });
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a subwindow with a close-listener.");
- subwindow.addComponent(message);
-
- // Add a button for opening the subwindow
- Button open = new Button("Open window", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() != null) {
- // window is already showing
- getWindow().showNotification("Window is already open");
- } else {
- // Open the subwindow by adding it to the main window
- getApplication().getMainWindow().addWindow(subwindow);
- }
- }
- });
- addComponent(open);
-
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowExample.java deleted file mode 100644 index 49c7809e62..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowExample.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowExample() {
-
- // Create the window
- subwindow = new Window("A subwindow");
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a subwindow");
- subwindow.addComponent(message);
-
- Button close = new Button("Close", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- // close the window by removing it from the main window
- getApplication().getMainWindow().removeWindow(subwindow);
- }
- });
- // The components added to the window are actually added to the window's
- // layout; you can use either. Alignments are set using the layout
- layout.addComponent(close);
- layout.setComponentAlignment(close, "right");
-
- // Add a button for opening the subwindow
- Button open = new Button("Open subwindow", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() != null) {
- // window is already showing
- getWindow().showNotification("Window is already open");
- } else {
- // Open the subwindow by adding it to the main window
- getApplication().getMainWindow().addWindow(subwindow);
- }
- }
- });
- addComponent(open);
-
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowModal.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowModal.java deleted file mode 100644 index da5d14613d..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowModal.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class SubwindowModal extends Feature {
-
- @Override
- public String getName() {
- return "Modal window";
- }
-
- @Override
- public String getDescription() {
- return "A <i>modal window</i> blocks access to the rest of the application"
- + " until the window is closed (or made non-modal).<br/>"
- + " Use modal windows when the user must finish the task in the"
- + " window before continuing.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] {
- //
- Subwindow.class, //
- FeatureSet.Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return new NamedExternalResource[] {
- //
- new NamedExternalResource("Wikipedia: Modal window",
- "http://en.wikipedia.org/wiki/Modal_window"), //
-
- };
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java deleted file mode 100644 index c698828794..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowModalExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowModalExample() {
-
- // Create the window...
- subwindow = new Window("A modal subwindow");
- // ...and make it modal
- subwindow.setModal(true);
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a modal subwindow.");
- subwindow.addComponent(message);
-
- Button close = new Button("Close", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- // close the window by removing it from the main window
- getApplication().getMainWindow().removeWindow(subwindow);
- }
- });
- // The components added to the window are actually added to the window's
- // layout; you can use either. Alignments are set using the layout
- layout.addComponent(close);
- layout.setComponentAlignment(close, "right");
-
- // Add a button for opening the subwindow
- Button open = new Button("Open modal window",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() != null) {
- // window is already showing
- getWindow().showNotification(
- "Window is already open");
- } else {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
- }
- });
- addComponent(open);
-
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowPositioned.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowPositioned.java deleted file mode 100644 index 11b46508ec..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowPositioned.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class SubwindowPositioned extends Feature {
-
- @Override
- public String getName() {
- return "Window position";
- }
-
- @Override
- public String getDescription() {
- return "The position of a window can be specified, or it can be centered.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { FeatureSet.Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowPositionedExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowPositionedExample.java deleted file mode 100644 index c1712499b8..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowPositionedExample.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowPositionedExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowPositionedExample() {
- setSpacing(true);
-
- // Create the window
- subwindow = new Window("A positioned subwindow");
- // let's give it a size (optional)
- subwindow.setWidth("300px");
- subwindow.setHeight("200px");
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
- // make it fill the whole window
- layout.setSizeFull();
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a positioned window");
- subwindow.addComponent(message);
-
- Button close = new Button("Close", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- // close the window by removing it from the main window
- getApplication().getMainWindow().removeWindow(subwindow);
- }
- });
- // The components added to the window are actually added to the window's
- // layout; you can use either. Alignments are set using the layout
- layout.addComponent(close);
- layout.setComponentAlignment(close, "right bottom");
-
- // Add buttons for opening the subwindow
- Button fifty = new Button("Open window at position 50x50",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() == null) {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
-
- // Set window position
- subwindow.setPositionX(50);
- subwindow.setPositionY(50);
- }
- });
- addComponent(fifty);
- Button onefifty = new Button("Open window at position 150x200",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() == null) {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
-
- // Set window position
- subwindow.setPositionX(150);
- subwindow.setPositionY(200);
- }
- });
- addComponent(onefifty);
- Button center = new Button("Open centered window",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() == null) {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
-
- // Center the window
- subwindow.center();
- }
- });
- addComponent(center);
-
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowSized.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowSized.java deleted file mode 100644 index a0b4a30fc2..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowSized.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.demo.sampler.APIResource;
-import com.vaadin.demo.sampler.Feature;
-import com.vaadin.demo.sampler.FeatureSet;
-import com.vaadin.demo.sampler.NamedExternalResource;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class SubwindowSized extends Feature {
-
- @Override
- public String getName() {
- return "Window, explicit size";
- }
-
- @Override
- public String getDescription() {
- return "The size of a window can be specified - here the width is set"
- + " in pixels, and the height in percent.";
- }
-
- @Override
- public APIResource[] getRelatedAPI() {
- return new APIResource[] { new APIResource(Window.class) };
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<? extends Feature>[] getRelatedFeatures() {
- return new Class[] { SubwindowAutoSized.class, FeatureSet.Windows.class };
- }
-
- @Override
- public NamedExternalResource[] getRelatedResources() {
- return null;
- }
-
-}
diff --git a/src/com/vaadin/demo/sampler/features/windows/SubwindowSizedExample.java b/src/com/vaadin/demo/sampler/features/windows/SubwindowSizedExample.java deleted file mode 100644 index 9cdebb9e83..0000000000 --- a/src/com/vaadin/demo/sampler/features/windows/SubwindowSizedExample.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.vaadin.demo.sampler.features.windows;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-@SuppressWarnings("serial")
-public class SubwindowSizedExample extends VerticalLayout {
-
- Window subwindow;
-
- public SubwindowSizedExample() {
-
- // Create the window
- subwindow = new Window("A sized subwindow");
- subwindow.setWidth("500px");
- subwindow.setHeight("80%");
-
- // Configure the windws layout; by default a VerticalLayout
- VerticalLayout layout = (VerticalLayout) subwindow.getContent();
- layout.setMargin(true);
- layout.setSpacing(true);
- // make it fill the whole window
- layout.setSizeFull();
-
- // Add some content; a label and a close-button
- Label message = new Label("This is a sized window");
- subwindow.addComponent(message);
-
- Button close = new Button("Close", new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- // close the window by removing it from the main window
- getApplication().getMainWindow().removeWindow(subwindow);
- }
- });
- // The components added to the window are actually added to the window's
- // layout; you can use either. Alignments are set using the layout
- layout.addComponent(close);
- layout.setComponentAlignment(close, "right bottom");
-
- // Add a button for opening the subwindow
- Button open = new Button("Open sized window",
- new Button.ClickListener() {
- // inline click-listener
- public void buttonClick(ClickEvent event) {
- if (subwindow.getParent() != null) {
- // window is already showing
- getWindow().showNotification(
- "Window is already open");
- } else {
- // Open the subwindow by adding it to the main
- // window
- getApplication().getMainWindow().addWindow(
- subwindow);
- }
- }
- });
- addComponent(open);
-
- }
-
-}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/folder.gif b/src/com/vaadin/demo/sampler/folder.gif Binary files differdeleted file mode 100644 index 8dc04c4956..0000000000 --- a/src/com/vaadin/demo/sampler/folder.gif +++ /dev/null diff --git a/src/com/vaadin/demo/sampler/gwt/SamplerWidgetSet.gwt.xml b/src/com/vaadin/demo/sampler/gwt/SamplerWidgetSet.gwt.xml deleted file mode 100644 index f40e421fbb..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/SamplerWidgetSet.gwt.xml +++ /dev/null @@ -1,12 +0,0 @@ -<module> - <!-- Inherit the DefaultWidgetSet --> - <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" /> - - <!-- Tracker --> - <script src="http://www.google-analytics.com/ga.js" /> - - <!-- Prettify --> - <stylesheet src="prettify/prettify.css"/> - <script src="prettify/prettify.js" /> - -</module> diff --git a/src/com/vaadin/demo/sampler/gwt/client/ui/VActiveLink.java b/src/com/vaadin/demo/sampler/gwt/client/ui/VActiveLink.java deleted file mode 100644 index 3ba416bad9..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/client/ui/VActiveLink.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.vaadin.demo.sampler.gwt.client.ui; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.MouseListener; -import com.google.gwt.user.client.ui.Widget; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.UIDL; -import com.vaadin.terminal.gwt.client.ui.VLink; - -@SuppressWarnings("deprecation") -public class VActiveLink extends VLink { - - String id; - ApplicationConnection client; - boolean listening = false; - - public VActiveLink() { - addMouseListener(new MouseListener() { - public void onMouseDown(Widget sender, int x, int y) { - } - - public void onMouseEnter(Widget sender) { - } - - public void onMouseLeave(Widget sender) { - } - - public void onMouseMove(Widget sender, int x, int y) { - } - - public void onMouseUp(Widget sender, int x, int y) { - Event e = DOM.eventGetCurrentEvent(); - if (e.getButton() == Event.BUTTON_MIDDLE) { - sendVariables(); - } - } - }); - } - - /** - * Sends variables, returns true if default handler should be called (i.e if - * server is listening and the link was claimed to be opened by the client) - * - * @return - */ - private boolean sendVariables() { - Event e = DOM.eventGetCurrentEvent(); - boolean opened = (e.getCtrlKey() || e.getAltKey() || e.getShiftKey() - || e.getMetaKey() || e.getButton() == Event.BUTTON_MIDDLE); - - // Works as VLink if no-one is listening - if (listening) { - if (opened) { - // VLink will open, notify server - client.updateVariable(id, "opened", true, false); - } else { - e.preventDefault(); - } - client.updateVariable(id, "activated", true, true); - } - return !listening || opened; - } - - @Override - public void onClick(ClickEvent event) { - - if (sendVariables()) { - // run default if not listening, or we claimed link was opened - super.onClick(event); - } - } - - @Override - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - // Ensure correct implementation, - // but don't let container manage caption etc. - if (client.updateComponent(this, uidl, false)) { - return; - } - - // Save details - this.client = client; - id = uidl.getId(); - listening = uidl.hasVariable("activated"); - - super.updateFromUIDL(uidl, client); - } - -} diff --git a/src/com/vaadin/demo/sampler/gwt/client/ui/VCodeLabel.java b/src/com/vaadin/demo/sampler/gwt/client/ui/VCodeLabel.java deleted file mode 100644 index e4ba51dd4c..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/client/ui/VCodeLabel.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.demo.sampler.gwt.client.ui; - -import com.google.gwt.dom.client.Element; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.UIDL; -import com.vaadin.terminal.gwt.client.ui.VLabel; - -public class VCodeLabel extends VLabel { - - public VCodeLabel() { - super(); - } - - @Override - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - super.updateFromUIDL(uidl, client); - Element pre = getElement().getFirstChildElement(); - if (null != pre) { - pre.setClassName("prettyprint"); - prettyPrint(); - } - } - - private native void prettyPrint() - /*-{ - $wnd.prettyPrint(); - }-*/; - -} diff --git a/src/com/vaadin/demo/sampler/gwt/client/ui/VGoogleAnalytics.java b/src/com/vaadin/demo/sampler/gwt/client/ui/VGoogleAnalytics.java deleted file mode 100644 index 263a8af838..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/client/ui/VGoogleAnalytics.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.vaadin.demo.sampler.gwt.client.ui; - -import com.google.gwt.dom.client.Document; -import com.google.gwt.user.client.ui.Widget; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.BrowserInfo; -import com.vaadin.terminal.gwt.client.Paintable; -import com.vaadin.terminal.gwt.client.UIDL; - -public class VGoogleAnalytics extends Widget implements Paintable { - - public VGoogleAnalytics() { - setElement(Document.get().createDivElement()); - if (BrowserInfo.get().isIE6()) { - getElement().getStyle().setProperty("overflow", "hidden"); - getElement().getStyle().setProperty("height", "0"); - getElement().getStyle().setProperty("width", "0"); - } - } - - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - if (isLocalHostUrl()) { - // Do not track localhost page views - return; - } - String trackerId = uidl.getStringAttribute("trackerid"); - String pageId = uidl.getStringAttribute("pageid"); - String domainName = uidl.getStringAttribute("domain"); - - String res = trackPageview(trackerId, pageId, domainName); - if (null != res) { - ApplicationConnection.getConsole().log( - "WebAnalytics.trackPageview(" + trackerId + "," + pageId - + "," + domainName + ") FAILED: " + res); - } else { - ApplicationConnection.getConsole().log( - "WebAnalytics.trackPageview(" + trackerId + "," + pageId - + "," + domainName + ") SUCCESS."); - } - } - - private native boolean isLocalHostUrl() - /*-{ - var location = $wnd.location; - var re = /^http:\/\/(localhost|127.0.0.1)/; - return re.test(location); - }-*/; - - private native String trackPageview(String trackerId, String pageId, - String domainName) - /*-{ - if (!$wnd._gat) { - return "Tracker not found (running offline?)"; - } - try { - var pageTracker = $wnd._gat._getTracker(trackerId); - if (domainName) { - pageTracker._setDomainName(domainName); - } - if (pageId) { - pageTracker._trackPageview(pageId); - } else { - pageTracker._trackPageview(); - } - return null; - } catch(err) { - return ""+err; - } - }-*/; -} diff --git a/src/com/vaadin/demo/sampler/gwt/public/prettify/README.txt b/src/com/vaadin/demo/sampler/gwt/public/prettify/README.txt deleted file mode 100644 index e39bfb78fc..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/public/prettify/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -google-code-prettify -http://code.google.com/p/google-code-prettify/ -Apache License 2.0 diff --git a/src/com/vaadin/demo/sampler/gwt/public/prettify/prettify.css b/src/com/vaadin/demo/sampler/gwt/public/prettify/prettify.css deleted file mode 100644 index 647fc61472..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/public/prettify/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec{color:#606}@media print{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun{color:#440}.pln{color:#000}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}
\ No newline at end of file diff --git a/src/com/vaadin/demo/sampler/gwt/public/prettify/prettify.js b/src/com/vaadin/demo/sampler/gwt/public/prettify/prettify.js deleted file mode 100644 index f8f4f7f461..0000000000 --- a/src/com/vaadin/demo/sampler/gwt/public/prettify/prettify.js +++ /dev/null @@ -1,25 +0,0 @@ -function _pr_isIE6(){var F=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);_pr_isIE6=function(){return F};return F}var aa="break continue do else for if return while ",ba="auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile ",ca="catch class delete false import new operator private protected public this throw true try ",da="alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ", -ea="boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",fa="as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",ga="debugger eval export function get null set undefined var with Infinity NaN ",ha="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ", -ia="and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",ja="alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",ka="case done elif esac eval fi function in local set then until ",la="a",ma="z",na="A",oa="Z",pa="!",qa="!=",ra="!==",s="#",sa="%",Ha="%=",v="&",Ia="&&",Ja="&&=",Ka="&=",La= -"(",Ma="*",Na="*=",Oa="+=",Pa=",",Qa="-=",Ra="->",w="/",Sa="/=",Ta=":",Ua="::",y=";",z="<",Va="<<",Wa="<<=",Xa="<=",Ya="=",Za="==",$a="===",A=">",ab=">=",bb=">>",cb=">>=",db=">>>",eb=">>>=",fb="?",C="@",gb="[",hb="^",ib="^=",jb="^^",kb="^^=",lb="{",mb="|",nb="|=",ob="||",pb="||=",qb="~",rb="break",sb="case",tb="continue",ub="delete",vb="do",wb="else",xb="finally",yb="instanceof",zb="return",Ab="throw",Bb="try",Cb="typeof",Db="(?:(?:(?:^|[^0-9.])\\.{1,3})|(?:(?:^|[^\\+])\\+)|(?:(?:^|[^\\-])-)",Eb= -"|\\b",Fb="\\$1",Gb="|^)\\s*$",Hb="&",Ib="<",Jb=">",Kb=""",Lb="&#",Mb="x",Nb="'",G='"',Ob=" ",Pb="XMP",Qb="</",Rb='="',H="PRE",Sb='<!DOCTYPE foo PUBLIC "foo bar">\n<foo />',I="",Tb="\t",Ub="\n",Vb="nocode",Wb=' $1="$2$3$4"',J="pln",O="com",Xb="dec",P="src",Q="tag",R="atv",S="pun",Yb="<>/=",X="atn",Zb=" \t\r\n",Y="str",$b="'\"",ac="'\"`",bc="\"'",cc=" \r\n",Z="lit",dc="123456789",ec=".",fc="kwd",gc="typ",$="</span>",hc='<span class="',ic='">',jc="$1 ",kc="<br />",lc="console",mc= -"cannot override language handler %s",nc="default-code",oc="default-markup",pc="html",qc="htm",rc="xhtml",sc="xml",tc="xsl",uc="c",vc="cc",wc="cpp",xc="cs",yc="cxx",zc="cyc",Ac="java",Bc="bsh",Cc="csh",Dc="sh",Ec="cv",Fc="py",Gc="perl",Hc="pl",Ic="pm",Jc="rb",Kc="js",Lc="pre",Mc="code",Nc="xmp",Oc="prettyprint",Pc="class",Qc="br",Rc="\r\n";(function(){function F(b){b=b.split(/ /g);var a={};for(var c=b.length;--c>=0;){var d=b[c];if(d)a[d]=null}return a}var K=aa,Sc=K+ba,T=Sc+ca,ta=T+da,ua=T+ea,Tc=ua+ -fa,va=T+ga,wa=ha,xa=K+ia,ya=K+ja,za=K+ka,Uc=ta+Tc+va+wa+xa+ya+za;function Vc(b){return b>=la&&b<=ma||b>=na&&b<=oa}function D(b,a,c,d){b.unshift(c,d||0);try{a.splice.apply(a,b)}finally{b.splice(0,2)}}var Wc=(function(){var b=[pa,qa,ra,s,sa,Ha,v,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,w,Sa,Ta,Ua,y,z,Va,Wa,Xa,Ya,Za,$a,A,ab,bb,cb,db,eb,fb,C,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb],a=Db;for(var c=0;c<b.length;++c){var d=b[c];a+=Vc(d.charAt(0))?Eb+d:mb+d.replace(/([^=<>:&])/g,Fb)}a+= -Gb;return new RegExp(a)})(),Aa=/&/g,Ba=/</g,Ca=/>/g,Xc=/\"/g;function Yc(b){return b.replace(Aa,Hb).replace(Ba,Ib).replace(Ca,Jb).replace(Xc,Kb)}function U(b){return b.replace(Aa,Hb).replace(Ba,Ib).replace(Ca,Jb)}var Zc=/</g,$c=/>/g,ad=/'/g,bd=/"/g,cd=/&/g,dd=/ /g;function ed(b){var a=b.indexOf(v);if(a<0)return b;for(--a;(a=b.indexOf(Lb,a+1))>=0;){var c=b.indexOf(y,a);if(c>=0){var d=b.substring(a+3,c),g=10;if(d&&d.charAt(0)===Mb){d=d.substring(1);g=16}var e=parseInt(d,g); -if(!isNaN(e))b=b.substring(0,a)+String.fromCharCode(e)+b.substring(c+1)}}return b.replace(Zc,z).replace($c,A).replace(ad,Nb).replace(bd,G).replace(cd,v).replace(dd,Ob)}function Da(b){return Pb===b.tagName}function L(b,a){switch(b.nodeType){case 1:var c=b.tagName.toLowerCase();a.push(z,c);for(var d=0;d<b.attributes.length;++d){var g=b.attributes[d];if(!g.specified)continue;a.push(Ob);L(g,a)}a.push(A);for(var e=b.firstChild;e;e=e.nextSibling)L(e,a);if(b.firstChild||!/^(?:br|link|img)$/.test(c))a.push(Qb, -c,A);break;case 2:a.push(b.name.toLowerCase(),Rb,Yc(b.value),G);break;case 3:case 4:a.push(U(b.nodeValue));break}}var V=null;function fd(b){if(null===V){var a=document.createElement(H);a.appendChild(document.createTextNode(Sb));V=!/</.test(a.innerHTML)}if(V){var c=b.innerHTML;if(Da(b))c=U(c);return c}var d=[];for(var g=b.firstChild;g;g=g.nextSibling)L(g,d);return d.join(I)}function gd(b){var a=0;return function(c){var d=null,g=0;for(var e=0,h=c.length;e<h;++e){var f=c.charAt(e);switch(f){case Tb:if(!d)d= -[];d.push(c.substring(g,e));var i=b-a%b;a+=i;for(;i>=0;i-=" ".length)d.push(" ".substring(0,i));g=e+1;break;case Ub:a=0;break;default:++a}}if(!d)return c;d.push(c.substring(g));return d.join(I)}}var hd=/(?:[^<]+|<!--[\s\S]*?--\>|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g,id=/^<!--/,jd=/^<\[CDATA\[/,kd=/^<br\b/i,Ea=/^<(\/?)([a-zA-Z]+)/;function ld(b){var a=b.match(hd),c=[],d=0,g=[];if(a)for(var e=0,h=a.length;e<h;++e){var f=a[e];if(f.length>1&&f.charAt(0)===z){if(id.test(f))continue; -if(jd.test(f)){c.push(f.substring(9,f.length-3));d+=f.length-12}else if(kd.test(f)){c.push(Ub);++d}else if(f.indexOf(Vb)>=0&&!!f.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,Wb).match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)){var i=f.match(Ea)[2],j=1;end_tag_loop:for(var m=e+1;m<h;++m){var o=a[m].match(Ea);if(o&&o[2]===i)if(o[1]===w){if(--j===0)break end_tag_loop}else++j}if(m<h){g.push(d,a.slice(e,m+1).join(I));e=m}else g.push(d,f)}else g.push(d,f)}else{var k=ed(f);c.push(k);d+=k.length}}return{source:c.join(I), -tags:g}}function E(b,a){var c={};(function(){var e=b.concat(a);for(var h=e.length;--h>=0;){var f=e[h],i=f[3];if(i)for(var j=i.length;--j>=0;)c[i.charAt(j)]=f}})();var d=a.length,g=/\S/;return function(e,h){h=h||0;var f=[h,J],i=I,j=0,m=e;while(m.length){var o,k=null,p,l=c[m.charAt(0)];if(l){p=m.match(l[1]);k=p[0];o=l[0]}else{for(var n=0;n<d;++n){l=a[n];var q=l[2];if(q&&!q.test(i))continue;p=m.match(l[1]);if(p){k=p[0];o=l[0];break}}if(!k){o=J;k=m.substring(0,1)}}f.push(h+j,o);j+=k.length;m=m.substring(k.length); -if(o!==O&&g.test(k))i=k}return f}}var md=E([],[[J,/^[^<]+/,null],[Xb,/^<!\w[^>]*(?:>|$)/,null],[O,/^<!--[\s\S]*?(?:--\>|$)/,null],[P,/^<\?[\s\S]*?(?:\?>|$)/,null],[P,/^<%[\s\S]*?(?:%>|$)/,null],[P,/^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i,null],[Q,/^<\/?\w[^<>]*>/,null]]);function nd(b){var a=md(b);for(var c=0;c<a.length;c+=2)if(a[c+1]===P){var d,g;d=a[c];g=c+2<a.length?a[c+2]:b.length;var e=b.substring(d,g),h=e.match(/^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/);if(h)a.splice(c,2,d,Q,d+h[1].length, -P,d+h[1].length+(h[2]||I).length,Q)}return a}var od=E([[R,/^\'[^\']*(?:\'|$)/,null,Nb],[R,/^\"[^\"]*(?:\"|$)/,null,G],[S,/^[<>\/=]+/,null,Yb]],[[Q,/^[\w:\-]+/,/^</],[R,/^[\w\-]+/,/^=/],[X,/^[\w:\-]+/,null],[J,/^\s+/,null,Zb]]);function pd(b,a){for(var c=0;c<a.length;c+=2){var d=a[c+1];if(d===Q){var g,e;g=a[c];e=c+2<a.length?a[c+2]:b.length;var h=b.substring(g,e),f=od(h,g);D(f,a,c,2);c+=f.length-2}}return a}function u(b){var a=[],c=[];if(b.tripleQuotedStrings)a.push([Y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, -null,$b]);else if(b.multiLineStrings)a.push([Y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,ac]);else a.push([Y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,bc]);c.push([J,/^(?:[^\'\"\`\/\#]+)/,null,cc]);if(b.hashComments)a.push([O,/^#[^\r\n]*/,null,s]);if(b.cStyleComments){c.push([O,/^\/\/[^\r\n]*/,null]);c.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(b.regexLiterals)c.push([Y,/^\/(?=[^\/*])(?:[^\/\x5B\x5C]|\x5C[\s\S]|\x5B(?:[^\x5C\x5D]|\x5C[\s\S])*(?:\x5D|$))+(?:\/|$)/, -Wc]);var d=F(b.keywords);b=null;var g=E(a,c),e=E([],[[J,/^\s+/,null,cc],[J,/^[a-z_$@][a-z_$@0-9]*/i,null],[Z,/^0x[a-f0-9]+[a-z]/i,null],[Z,/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i,null,dc],[S,/^[^\s\w\.$@]+/,null]]);function h(f,i){for(var j=0;j<i.length;j+=2){var m=i[j+1];if(m===J){var o,k,p,l;o=i[j];k=j+2<i.length?i[j+2]:f.length;p=f.substring(o,k);l=e(p,o);for(var n=0,q=l.length;n<q;n+=2){var r=l[n+1];if(r===J){var B=l[n],M=n+2<q?l[n+2]:p.length,x=f.substring(B,M);if(x===ec)l[n+ -1]=S;else if(x in d)l[n+1]=fc;else if(/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(x))l[n+1]=x.charAt(0)===C?Z:gc}}D(l,i,j,2);j+=l.length-2}}return i}return function(f){var i=g(f);i=h(f,i);return i}}var W=u({keywords:Uc,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function qd(b,a){for(var c=0;c<a.length;c+=2){var d=a[c+1];if(d===P){var g,e;g=a[c];e=c+2<a.length?a[c+2]:b.length;var h=W(b.substring(g,e));for(var f=0,i=h.length;f<i;f+=2)h[f]+=g;D(h,a,c,2);c+=h.length-2}}return a} -function rd(b,a){var c=false;for(var d=0;d<a.length;d+=2){var g=a[d+1],e,h;if(g===X){e=a[d];h=d+2<a.length?a[d+2]:b.length;c=/^on|^style$/i.test(b.substring(e,h))}else if(g===R){if(c){e=a[d];h=d+2<a.length?a[d+2]:b.length;var f=b.substring(e,h),i=f.length,j=i>=2&&/^[\"\']/.test(f)&&f.charAt(0)===f.charAt(i-1),m,o,k;if(j){o=e+1;k=h-1;m=f}else{o=e+1;k=h-1;m=f.substring(1,f.length-1)}var p=W(m);for(var l=0,n=p.length;l<n;l+=2)p[l]+=o;if(j){p.push(k,R);D(p,a,d+2,0)}else D(p,a,d,2)}c=false}}return a}function sd(b){var a= -nd(b);a=pd(b,a);a=qd(b,a);a=rd(b,a);return a}function td(b,a,c){var d=[],g=0,e=null,h=null,f=0,i=0,j=gd(8),m=/([\r\n ]) /g,o=/(^| ) /gm,k=/\r\n?|\n/g,p=/[ \r\n]$/,l=true;function n(r){if(r>g){if(e&&e!==h){d.push($);e=null}if(!e&&h){e=h;d.push(hc,e,ic)}var B=U(j(b.substring(g,r))).replace(l?o:m,jc);l=p.test(B);d.push(B.replace(k,kc));g=r}}while(true){var q;q=f<a.length?(i<c.length?a[f]<=c[i]:true):false;if(q){n(a[f]);if(e){d.push($);e=null}d.push(a[f+1]);f+=2}else if(i<c.length){n(c[i]);h=c[i+1];i+= -2}else break}n(b.length);if(e)d.push($);return d.join(I)}var N={};function t(b,a){for(var c=a.length;--c>=0;){var d=a[c];if(!N.hasOwnProperty(d))N[d]=b;else if(lc in window)console.log(mc,d)}}t(W,[nc]);t(sd,[oc,pc,qc,rc,sc,tc]);t(u({keywords:ta,hashComments:true,cStyleComments:true}),[uc,vc,wc,xc,yc,zc]);t(u({keywords:ua,cStyleComments:true}),[Ac]);t(u({keywords:za,hashComments:true,multiLineStrings:true}),[Bc,Cc,Dc]);t(u({keywords:xa,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}), -[Ec,Fc]);t(u({keywords:wa,hashComments:true,multiLineStrings:true,regexLiterals:true}),[Gc,Hc,Ic]);t(u({keywords:ya,hashComments:true,multiLineStrings:true,regexLiterals:true}),[Jc]);t(u({keywords:va,cStyleComments:true,regexLiterals:true}),[Kc]);function Fa(b,a){try{var c=ld(b),d=c.source,g=c.tags;if(!N.hasOwnProperty(a))a=/^\s*</.test(d)?oc:nc;var e=N[a].call({},d);return td(d,g,e)}catch(h){if(lc in window){console.log(h);console.trace()}return b}}function ud(b){var a=_pr_isIE6(),c=[document.getElementsByTagName(Lc), -document.getElementsByTagName(Mc),document.getElementsByTagName(Nc)],d=[];for(var g=0;g<c.length;++g)for(var e=0;e<c[g].length;++e)d.push(c[g][e]);c=null;var h=0;function f(){var i=(new Date).getTime()+250;for(;h<d.length&&(new Date).getTime()<i;h++){var j=d[h];if(j.className&&j.className.indexOf(Oc)>=0){var m=j.className.match(/\blang-(\w+)\b/);if(m)m=m[1];var o=false;for(var k=j.parentNode;k;k=k.parentNode)if((k.tagName===Lc||k.tagName===Mc||k.tagName===Nc)&&k.className&&k.className.indexOf(Oc)>= -0){o=true;break}if(!o){var p=fd(j);p=p.replace(/(?:\r\n?|\n)$/,I);var l=Fa(p,m);if(!Da(j))j.innerHTML=l;else{var n=document.createElement(H);for(var q=0;q<j.attributes.length;++q){var r=j.attributes[q];if(r.specified){var B=r.name.toLowerCase();if(B===Pc)n.className=r.value;else n.setAttribute(r.name,r.value)}}n.innerHTML=l;j.parentNode.replaceChild(n,j);j=n}if(a&&j.tagName===H){var M=j.getElementsByTagName(Qc);for(var x=M.length;--x>=0;){var Ga=M[x];Ga.parentNode.replaceChild(document.createTextNode(Rc), -Ga)}}}}}if(h<d.length)setTimeout(f,250);else if(b)b()}f()}window.PR_normalizedHtml=L;window.prettyPrintOne=Fa;window.prettyPrint=ud;window.PR={createSimpleLexer:E,registerLangHandler:t,sourceDecorator:u,PR_ATTRIB_NAME:X,PR_ATTRIB_VALUE:R,PR_COMMENT:O,PR_DECLARATION:Xb,PR_KEYWORD:fc,PR_LITERAL:Z,PR_NOCODE:Vb,PR_PLAIN:J,PR_PUNCTUATION:S,PR_SOURCE:P,PR_STRING:Y,PR_TAG:Q,PR_TYPE:gc}})(); diff --git a/src/com/vaadin/demo/themes/ReindeerThemeStyles.java b/src/com/vaadin/demo/themes/ReindeerThemeStyles.java deleted file mode 100644 index 58d1eea762..0000000000 --- a/src/com/vaadin/demo/themes/ReindeerThemeStyles.java +++ /dev/null @@ -1,419 +0,0 @@ -package com.vaadin.demo.themes; - -import java.util.Date; - -import com.vaadin.Application; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.DateField; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.InlineDateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.TwinColSelect; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * This Vaadin application demonstrates all the available styles that the - * Reindeer theme includes. - * - * @author Jouni Koivuviita, IT Mill Ltd. - * - */ -@SuppressWarnings("serial") -public class ReindeerThemeStyles extends Application { - - private Window main; - private VerticalLayout mainLayout; - - @Override - public void init() { - setTheme("reindeer"); - - main = new Window("Vaadin Reindeer Theme - Included Style Names"); - setMainWindow(main); - - mainLayout = (VerticalLayout) main.getContent(); - mainLayout.setSpacing(true); - - mainLayout.addComponent(new H1("Reindeer theme style reference")); - mainLayout.addComponent(buildBackgroundToggles()); - mainLayout.addComponent(buildLabels()); - mainLayout.addComponent(buildButtons()); - mainLayout.addComponent(buildTextFields()); - mainLayout.addComponent(buildSelects()); - mainLayout.addComponent(buildDateFields()); - mainLayout.addComponent(buildTabSheets()); - mainLayout.addComponent(buildPanels()); - mainLayout.addComponent(buildTables()); - mainLayout.addComponent(buildWindows()); - mainLayout.addComponent(buildSplitPanels()); - - } - - private VerticalLayout buildBackgroundToggles() { - VerticalLayout l = new VerticalLayout(); - l.setSpacing(true); - l.setMargin(true, false, true, false); - l.setWidth(null); - - l.addComponent(new Ruler()); - - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - l.addComponent(hl); - - Button toggle = new Button("Toggle blue style for main layout", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (!mainLayout.getStyleName().contains("blue")) { - mainLayout.setStyleName("blue"); - } else { - mainLayout.setStyleName(""); - } - } - }); - hl.addComponent(toggle); - - toggle = new Button("Toggle black style for main layout", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (!mainLayout.getStyleName().contains("black")) { - mainLayout.setStyleName("black"); - } else { - mainLayout.setStyleName(""); - } - } - }); - hl.addComponent(toggle); - - Label info = new Label( - "These buttons only change the style name of the main layout in the application. No other changes are needed in order to make the contained components to change style accordingly."); - info.setStyleName("light"); - l.addComponent(info); - - info = new Label( - "Note, though, that some components don't different style on a black background, and some styles aren't designed to be used on a black background. Some components aren't even supported to be used on black background currently (i.e. normal Panel)."); - info.setStyleName("light"); - l.addComponent(info); - - l.addComponent(new Ruler()); - - return l; - } - - private VerticalLayout buildLabels() { - VerticalLayout l = new VerticalLayout(); - l.setSpacing(true); - l.setMargin(false, false, true, false); - l.setWidth("400px"); - - Label h1 = new H1("Header Label (style \"h1\")"); - - Label text = new Label( - "This is a normal Label. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam lectus. Sed lectus purus, volutpat sit amet, volutpat sed, venenatis ut, libero. Phasellus auctor."); - - Label h2 = new H2("Second Level Header (style \"h2\")"); - - Label light = new Label( - "This is a light (stylename \"light\") Label, that can be used to display secondary information to the user. Lorem ipsum dolor sit amet, consectetur adipiscing elit."); - light.setStyleName("light"); - - l.addComponent(h1); - l.addComponent(text); - l.addComponent(h2); - l.addComponent(light); - - return l; - } - - private VerticalLayout buildButtons() { - Base l = new Base("Buttons"); - - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - - Button b = new Button("Primary style"); - b.setStyleName("primary"); - hl.addComponent(b); - - b = new Button("Normal"); - hl.addComponent(b); - - b = new Button("Disabled"); - b.setEnabled(false); - hl.addComponent(b); - - b = new Button("Small style"); - b.setStyleName("small"); - hl.addComponent(b); - - b = new Button("Link style"); - b.setStyleName("link"); - hl.addComponent(b); - - l.addComponent(hl); - - return l; - } - - private VerticalLayout buildTextFields() { - Base l = new Base("Text Fields"); - - l.addComponent(new TextField("Normal Text field")); - TextField tf = new TextField(); - tf.setStyleName("small"); - tf.setInputPrompt("Small style textfield"); - l.addComponent(tf); - - return l; - } - - private VerticalLayout buildSelects() { - Base l = new Base("Selects"); - - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - l.addComponent(hl); - - AbstractSelect cb = new ComboBox("Combo box"); - AbstractSelect nat = new NativeSelect("Native Select"); - AbstractSelect list = new ListSelect("List Select"); - AbstractSelect twincol = new TwinColSelect("Twin Column Select"); - - for (int i = 0; i < 25; i++) { - cb.addItem("Item " + i); - nat.addItem("Item " + i); - list.addItem("Item " + i); - twincol.addItem("Item " + i); - } - - hl.addComponent(cb); - hl.addComponent(nat); - hl.addComponent(list); - hl.addComponent(twincol); - - return l; - } - - private VerticalLayout buildDateFields() { - Base l = new Base("Date Fields"); - - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - l.addComponent(hl); - - DateField df = new DateField("Normal DateField"); - df.setValue(new Date()); - df.setResolution(DateField.RESOLUTION_MIN); - hl.addComponent(df); - - df = new InlineDateField("Inline DateField"); - df.setValue(new Date()); - df.setResolution(DateField.RESOLUTION_DAY); - hl.addComponent(df); - - df = new InlineDateField("Inline DateField, year resolution"); - df.setValue(new Date()); - df.setResolution(DateField.RESOLUTION_YEAR); - hl.addComponent(df); - - return l; - } - - private VerticalLayout buildTabSheets() { - Base l = new Base("Tabsheets"); - - TabSheet ts = new TabSheet(); - ts.setHeight("100px"); - TabSheet ts2 = new TabSheet(); - ts2.setCaption("Bar style"); - ts2.setStyleName("bar"); - TabSheet ts3 = new TabSheet(); - ts3.setStyleName("minimal"); - ts3.setCaption("Minimal style"); - - for (int i = 0; i < 10; i++) { - ts.addTab(new Label(), "Tab Caption" + i, null); - ts2.addTab(new Label(), "Tab Caption" + i, null); - ts3.addTab(new Label(), "Tab Caption" + i, null); - } - - l.addComponent(ts); - l.addComponent(ts2); - l.addComponent(ts3); - - return l; - } - - private VerticalLayout buildPanels() { - Base l = new Base("Panels"); - - Panel p = new Panel("Normal panel"); - p.setHeight("100px"); - p.addComponent(new Label("Panel content")); - - Panel p2 = new Panel("Light style panel"); - p2.setStyleName("light"); - p2.addComponent(new Label("Panel content")); - - l.addComponent(p); - l.addComponent(p2); - - return l; - } - - private VerticalLayout buildTables() { - Base l = new Base("Tables (Grids)"); - - for (int i = 0; i < 3; i++) { - - Table t = new Table(); - t.setWidth("100%"); - t.setPageLength(4); - t.setSelectable(true); - t.setColumnCollapsingAllowed(true); - t.setColumnReorderingAllowed(true); - - if (i == 1) { - t.setStyleName("strong"); - t.setCaption("Strong style"); - } else if (i == 2) { - t.setStyleName("borderless"); - t.setCaption("Borderless style"); - } - - t.addContainerProperty("First", String.class, null); - t.addContainerProperty("Second", String.class, null); - t.addContainerProperty("Third", String.class, null); - - for (int j = 0; j < 100; j++) { - t.addItem(new Object[] { "Foo " + j, "Bar value " + j, - "Last column value " + j }, j); - } - - l.addComponent(t); - } - return l; - } - - private VerticalLayout buildWindows() { - Base l = new Base("Sub windows"); - - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - - Button b = new Button("Open normal window", new ClickListener() { - public void buttonClick(ClickEvent event) { - Window w = new Window("Normal window"); - w.setWidth("200px"); - w.setHeight("180px"); - w.setPositionX(20); - w.setPositionY(200); - main.addWindow(w); - } - }); - hl.addComponent(b); - - b = new Button("Open normal window (no resize)", new ClickListener() { - public void buttonClick(ClickEvent event) { - Window w = new Window("Window, no resize"); - w.setResizable(false); - w.setWidth("200px"); - w.setHeight("180px"); - w.setPositionX(240); - w.setPositionY(200); - main.addWindow(w); - } - }); - hl.addComponent(b); - - b = new Button("Open light style window", new ClickListener() { - public void buttonClick(ClickEvent event) { - Window w = new Window("Light window"); - w.setWidth("200px"); - w.setHeight("180px"); - w.setStyleName("light"); - w.setPositionX(460); - w.setPositionY(200); - main.addWindow(w); - } - }); - hl.addComponent(b); - - b = new Button("Open black style window", new ClickListener() { - public void buttonClick(ClickEvent event) { - Window w = new Window("Black window"); - w.setWidth("200px"); - w.setHeight("180px"); - w.setStyleName("black"); - w.setPositionX(680); - w.setPositionY(200); - main.addWindow(w); - } - }); - hl.addComponent(b); - - l.addComponent(hl); - - return l; - } - - private VerticalLayout buildSplitPanels() { - Base l = new Base("Split panels"); - l.setHeight("260px"); - - SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - sp.setFirstComponent(new Label("Normal SplitPanel")); - sp.setHeight("200px"); - - SplitPanel sp2 = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - sp2.setStyleName("small"); - sp.setSecondComponent(sp2); - sp2.setSecondComponent(new Label("small style SplitPanel")); - - l.addComponent(sp); - l.setExpandRatio(sp, 1); - - return l; - } - - private class H1 extends Label { - public H1(String caption) { - super(caption); - setStyleName("h1"); - } - } - - private class H2 extends Label { - public H2(String caption) { - super(caption); - setStyleName("h2"); - } - } - - private class Ruler extends Label { - public Ruler() { - super("<hr />", Label.CONTENT_XHTML); - } - } - - private class Base extends VerticalLayout { - public Base(String header) { - setSpacing(true); - setMargin(false, false, true, false); - addComponent(new H2(header)); - } - } - -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/AddressBookApplication.java b/src/com/vaadin/demo/tutorial/addressbook/AddressBookApplication.java deleted file mode 100644 index 3860ea08bf..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/AddressBookApplication.java +++ /dev/null @@ -1,241 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.demo.tutorial.addressbook.data.PersonContainer; -import com.vaadin.demo.tutorial.addressbook.data.SearchFilter; -import com.vaadin.demo.tutorial.addressbook.ui.HelpWindow; -import com.vaadin.demo.tutorial.addressbook.ui.ListView; -import com.vaadin.demo.tutorial.addressbook.ui.NavigationTree; -import com.vaadin.demo.tutorial.addressbook.ui.PersonForm; -import com.vaadin.demo.tutorial.addressbook.ui.PersonList; -import com.vaadin.demo.tutorial.addressbook.ui.SearchView; -import com.vaadin.demo.tutorial.addressbook.ui.SharingOptions; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Window.Notification; - -@SuppressWarnings("serial") -public class AddressBookApplication extends Application implements - ClickListener, ValueChangeListener, ItemClickListener { - - private NavigationTree tree = new NavigationTree(this); - - 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 SplitPanel horizontalSplit = new SplitPanel( - SplitPanel.ORIENTATION_HORIZONTAL); - - // Lazyly created ui references - private ListView listView = null; - private SearchView searchView = null; - private PersonList personList = null; - private PersonForm personForm = null; - private HelpWindow helpWindow = null; - private SharingOptions sharingOptions = null; - - private PersonContainer dataSource = PersonContainer.createWithTestData(); - - @Override - public void init() { - buildMainLayout(); - setMainComponent(getListView()); - } - - private void buildMainLayout() { - setMainWindow(new Window("Address Book Demo application")); - - setTheme("contacts"); - - VerticalLayout layout = new VerticalLayout(); - layout.setSizeFull(); - - layout.addComponent(createToolbar()); - layout.addComponent(horizontalSplit); - layout.setExpandRatio(horizontalSplit, 1); - - horizontalSplit.setSplitPosition(200, SplitPanel.UNITS_PIXELS); - horizontalSplit.setFirstComponent(tree); - - getMainWindow().setContent(layout); - } - - private HorizontalLayout createToolbar() { - HorizontalLayout lo = new HorizontalLayout(); - lo.addComponent(newContact); - lo.addComponent(search); - lo.addComponent(share); - lo.addComponent(help); - - search.addListener((ClickListener) this); - share.addListener((ClickListener) this); - help.addListener((ClickListener) this); - newContact.addListener((ClickListener) this); - - search.setIcon(new ThemeResource("icons/32/folder-add.png")); - share.setIcon(new ThemeResource("icons/32/users.png")); - help.setIcon(new ThemeResource("icons/32/help.png")); - newContact.setIcon(new ThemeResource("icons/32/document-add.png")); - - lo.setMargin(true); - lo.setSpacing(true); - - lo.setStyleName("toolbar"); - - lo.setWidth("100%"); - - Embedded em = new Embedded("", new ThemeResource("images/logo.png")); - lo.addComponent(em); - lo.setComponentAlignment(em, Alignment.MIDDLE_RIGHT); - lo.setExpandRatio(em, 1); - - return lo; - } - - private void setMainComponent(Component c) { - horizontalSplit.setSecondComponent(c); - } - - /* - * View getters exist so we can lazily generate the views, resulting in - * faster application startup time. - */ - private ListView getListView() { - if (listView == null) { - personList = new PersonList(this); - personForm = new PersonForm(this); - listView = new ListView(personList, personForm); - } - return listView; - } - - private SearchView getSearchView() { - if (searchView == null) { - searchView = new SearchView(this); - } - return searchView; - } - - private HelpWindow getHelpWindow() { - if (helpWindow == null) { - helpWindow = new HelpWindow(); - } - return helpWindow; - } - - private SharingOptions getSharingOptions() { - if (sharingOptions == null) { - sharingOptions = new SharingOptions(); - } - return sharingOptions; - } - - public PersonContainer getDataSource() { - return dataSource; - } - - public void buttonClick(ClickEvent event) { - final Button source = event.getButton(); - - if (source == search) { - showSearchView(); - } else if (source == help) { - showHelpWindow(); - } else if (source == share) { - showShareWindow(); - } else if (source == newContact) { - addNewContanct(); - } - } - - private void showHelpWindow() { - getMainWindow().addWindow(getHelpWindow()); - } - - private void showShareWindow() { - getMainWindow().addWindow(getSharingOptions()); - } - - private void showListView() { - setMainComponent(getListView()); - } - - private void showSearchView() { - setMainComponent(getSearchView()); - } - - public void valueChange(ValueChangeEvent event) { - Property property = event.getProperty(); - if (property == personList) { - Item item = personList.getItem(personList.getValue()); - if (item != personForm.getItemDataSource()) { - personForm.setItemDataSource(item); - } - } - } - - public void itemClick(ItemClickEvent event) { - if (event.getSource() == tree) { - Object itemId = event.getItemId(); - if (itemId != null) { - if (itemId == NavigationTree.SHOW_ALL) { - // clear previous filters - getDataSource().removeAllContainerFilters(); - showListView(); - } else if (itemId == NavigationTree.SEARCH) { - showSearchView(); - } else if (itemId instanceof SearchFilter) { - search((SearchFilter) itemId); - } - } - } - } - - private void addNewContanct() { - showListView(); - personForm.addContact(); - } - - public void search(SearchFilter searchFilter) { - // clear previous filters - getDataSource().removeAllContainerFilters(); - // filter contacts with given filter - getDataSource().addContainerFilter(searchFilter.getPropertyId(), - searchFilter.getTerm(), true, false); - showListView(); - - getMainWindow().showNotification( - "Searched for " + searchFilter.getPropertyId() + "=*" - + searchFilter.getTerm() + "*, found " - + getDataSource().size() + " item(s).", - Notification.TYPE_TRAY_NOTIFICATION); - } - - public void saveSearch(SearchFilter searchFilter) { - tree.addItem(searchFilter); - tree.setParent(searchFilter, NavigationTree.SEARCH); - // mark the saved search as a leaf (cannot have children) - tree.setChildrenAllowed(searchFilter, false); - // make sure "Search" is expanded - tree.expandItem(NavigationTree.SEARCH); - // select the saved search - tree.setValue(searchFilter); - } - -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/data/Person.java b/src/com/vaadin/demo/tutorial/addressbook/data/Person.java deleted file mode 100644 index 70fae91db7..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/data/Person.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.data; - -import java.io.Serializable; - -@SuppressWarnings("serial") -public class Person implements Serializable { - private String firstName = ""; - private String lastName = ""; - private String email = ""; - private String phoneNumber = ""; - private String streetAddress = ""; - private Integer postalCode = null; - private String city = ""; - - /** - * @return the firstName - */ - public String getFirstName() { - return firstName; - } - - /** - * @param firstName - * the firstName to set - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * @return the lastName - */ - public String getLastName() { - return lastName; - } - - /** - * @param lastName - * the lastName to set - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * @return the email - */ - public String getEmail() { - return email; - } - - /** - * @param email - * the email to set - */ - public void setEmail(String email) { - this.email = email; - } - - /** - * @return the phoneNumber - */ - public String getPhoneNumber() { - return phoneNumber; - } - - /** - * @param phoneNumber - * the phoneNumber to set - */ - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - - /** - * @return the streetAddress - */ - public String getStreetAddress() { - return streetAddress; - } - - /** - * @param streetAddress - * the streetAddress to set - */ - public void setStreetAddress(String streetAddress) { - this.streetAddress = streetAddress; - } - - /** - * @return the postalCode - */ - public Integer getPostalCode() { - return postalCode; - } - - /** - * @param postalCode - * the postalCode to set - */ - public void setPostalCode(Integer postalCode) { - this.postalCode = postalCode; - } - - /** - * @return the city - */ - public String getCity() { - return city; - } - - /** - * @param city - * the city to set - */ - public void setCity(String city) { - this.city = city; - } - -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/tutorial/addressbook/data/PersonContainer.java b/src/com/vaadin/demo/tutorial/addressbook/data/PersonContainer.java deleted file mode 100644 index 0a6bd6cf14..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/data/PersonContainer.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.data; - -import java.io.Serializable; -import java.util.Random; - -import com.vaadin.data.util.BeanItemContainer; - -@SuppressWarnings("serial") -public class PersonContainer extends BeanItemContainer<Person> implements - Serializable { - - /** - * Natural property order for Person bean. Used in tables and forms. - */ - public static final Object[] NATURAL_COL_ORDER = new Object[] { - "firstName", "lastName", "email", "phoneNumber", "streetAddress", - "postalCode", "city" }; - - /** - * "Human readable" captions for properties in same order as in - * NATURAL_COL_ORDER. - */ - public static final String[] COL_HEADERS_ENGLISH = new String[] { - "First name", "Last name", "Email", "Phone number", - "Street Address", "Postal Code", "City" }; - - public PersonContainer() throws InstantiationException, - IllegalAccessException { - super(Person.class); - } - - public static PersonContainer createWithTestData() { - final String[] fnames = { "Peter", "Alice", "Joshua", "Mike", "Olivia", - "Nina", "Alex", "Rita", "Dan", "Umberto", "Henrik", "Rene", - "Lisa", "Marge" }; - final String[] lnames = { "Smith", "Gordon", "Simpson", "Brown", - "Clavel", "Simons", "Verne", "Scott", "Allison", "Gates", - "Rowling", "Barks", "Ross", "Schneider", "Tate" }; - final String cities[] = { "Amsterdam", "Berlin", "Helsinki", - "Hong Kong", "London", "Luxemburg", "New York", "Oslo", - "Paris", "Rome", "Stockholm", "Tokyo", "Turku" }; - final String streets[] = { "4215 Blandit Av.", "452-8121 Sem Ave", - "279-4475 Tellus Road", "4062 Libero. Av.", "7081 Pede. Ave", - "6800 Aliquet St.", "P.O. Box 298, 9401 Mauris St.", - "161-7279 Augue Ave", "P.O. Box 496, 1390 Sagittis. Rd.", - "448-8295 Mi Avenue", "6419 Non Av.", - "659-2538 Elementum Street", "2205 Quis St.", - "252-5213 Tincidunt St.", "P.O. Box 175, 4049 Adipiscing Rd.", - "3217 Nam Ave", "P.O. Box 859, 7661 Auctor St.", - "2873 Nonummy Av.", "7342 Mi, Avenue", - "539-3914 Dignissim. Rd.", "539-3675 Magna Avenue", - "Ap #357-5640 Pharetra Avenue", "416-2983 Posuere Rd.", - "141-1287 Adipiscing Avenue", "Ap #781-3145 Gravida St.", - "6897 Suscipit Rd.", "8336 Purus Avenue", "2603 Bibendum. Av.", - "2870 Vestibulum St.", "Ap #722 Aenean Avenue", - "446-968 Augue Ave", "1141 Ultricies Street", - "Ap #992-5769 Nunc Street", "6690 Porttitor Avenue", - "Ap #105-1700 Risus Street", - "P.O. Box 532, 3225 Lacus. Avenue", "736 Metus Street", - "414-1417 Fringilla Street", "Ap #183-928 Scelerisque Road", - "561-9262 Iaculis Avenue" }; - PersonContainer c = null; - Random r = new Random(0); - try { - c = new PersonContainer(); - for (int i = 0; i < 100; i++) { - Person p = new Person(); - p.setFirstName(fnames[r.nextInt(fnames.length)]); - p.setLastName(lnames[r.nextInt(lnames.length)]); - p.setCity(cities[r.nextInt(cities.length)]); - p.setEmail(p.getFirstName().toLowerCase() + "." - + p.getLastName().toLowerCase() + "@vaadin.com"); - p.setPhoneNumber("+358 02 555 " + r.nextInt(10) + r.nextInt(10) - + r.nextInt(10) + r.nextInt(10)); - int n = r.nextInt(100000); - if (n < 10000) { - n += 10000; - } - p.setPostalCode(n); - p.setStreetAddress(streets[r.nextInt(streets.length)]); - c.addItem(p); - } - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return c; - } - -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/data/SearchFilter.java b/src/com/vaadin/demo/tutorial/addressbook/data/SearchFilter.java deleted file mode 100644 index 96d2460545..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/data/SearchFilter.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.data; - -import java.io.Serializable; - -@SuppressWarnings("serial") -public class SearchFilter implements Serializable { - - private final String term; - private final Object propertyId; - private String searchName; - - public SearchFilter(Object propertyId, String searchTerm, String name) { - this.propertyId = propertyId; - term = searchTerm; - searchName = name; - } - - /** - * @return the term - */ - public String getTerm() { - return term; - } - - /** - * @return the propertyId - */ - public Object getPropertyId() { - return propertyId; - } - - /** - * @return the name of the search - */ - public String getSearchName() { - return searchName; - } - - @Override - public String toString() { - return getSearchName(); - } - -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/HelpWindow.java b/src/com/vaadin/demo/tutorial/addressbook/ui/HelpWindow.java deleted file mode 100644 index d9e08d7679..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/HelpWindow.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -@SuppressWarnings("serial") -public class HelpWindow extends Window { - private static final String HELP_HTML_SNIPPET = "This is " - + "an application built during <strong><a href=\"" - + "http://dev.vaadin.com/\">Vaadin</a></strong> " - + "tutorial. Hopefully it don't need any real help."; - - public HelpWindow() { - setCaption("Address Book help"); - addComponent(new Label(HELP_HTML_SNIPPET, Label.CONTENT_XHTML)); - } - -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/ListView.java b/src/com/vaadin/demo/tutorial/addressbook/ui/ListView.java deleted file mode 100644 index 0bb35c9e9c..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/ListView.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import com.vaadin.ui.SplitPanel; - -@SuppressWarnings("serial") -public class ListView extends SplitPanel { - public ListView(PersonList personList, PersonForm personForm) { - addStyleName("view"); - setFirstComponent(personList); - setSecondComponent(personForm); - setSplitPosition(40); - } -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/NavigationTree.java b/src/com/vaadin/demo/tutorial/addressbook/ui/NavigationTree.java deleted file mode 100644 index f289f636b9..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/NavigationTree.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import com.vaadin.demo.tutorial.addressbook.AddressBookApplication; -import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.ui.Tree; - -@SuppressWarnings("serial") -public class NavigationTree extends Tree { - public static final Object SHOW_ALL = "Show all"; - public static final Object SEARCH = "Search"; - - public NavigationTree(AddressBookApplication app) { - addItem(SHOW_ALL); - addItem(SEARCH); - - setChildrenAllowed(SHOW_ALL, false); - - /* - * We want items to be selectable but do not want the user to be able to - * de-select an item. - */ - setSelectable(true); - setNullSelectionAllowed(false); - - // Make application handle item click events - addListener((ItemClickListener) app); - - } -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/PersonForm.java b/src/com/vaadin/demo/tutorial/addressbook/ui/PersonForm.java deleted file mode 100644 index 31de64daf3..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/PersonForm.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import com.vaadin.data.Item; -import com.vaadin.data.util.BeanItem; -import com.vaadin.data.validator.EmailValidator; -import com.vaadin.data.validator.RegexpValidator; -import com.vaadin.demo.tutorial.addressbook.AddressBookApplication; -import com.vaadin.demo.tutorial.addressbook.data.Person; -import com.vaadin.demo.tutorial.addressbook.data.PersonContainer; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -@SuppressWarnings("serial") -public class PersonForm extends Form implements ClickListener { - - private Button save = new Button("Save", (ClickListener) this); - private Button cancel = new Button("Cancel", (ClickListener) this); - private Button edit = new Button("Edit", (ClickListener) this); - private final ComboBox cities = new ComboBox("City"); - - private AddressBookApplication app; - private boolean newContactMode = false; - private Person newPerson = null; - - public PersonForm(AddressBookApplication app) { - this.app = app; - - /* - * Enable buffering so that commit() must be called for the form before - * input is written to the data. (Form input is not written immediately - * through to the underlying object.) - */ - setWriteThrough(false); - - HorizontalLayout footer = new HorizontalLayout(); - footer.setSpacing(true); - footer.addComponent(save); - footer.addComponent(cancel); - footer.addComponent(edit); - footer.setVisible(false); - - setFooter(footer); - - /* Allow the user to enter new cities */ - cities.setNewItemsAllowed(true); - /* We do not want to use null values */ - cities.setNullSelectionAllowed(false); - /* Add an empty city used for selecting no city */ - cities.addItem(""); - - /* Populate cities select using the cities in the data container */ - PersonContainer ds = app.getDataSource(); - for (Iterator<Person> it = ds.getItemIds().iterator(); it.hasNext();) { - String city = (it.next()).getCity(); - cities.addItem(city); - } - - /* - * Field factory for overriding how the component for city selection is - * created - */ - setFormFieldFactory(new DefaultFieldFactory() { - @Override - public Field createField(Item item, Object propertyId, - Component uiContext) { - if (propertyId.equals("city")) { - cities.setWidth("200px"); - return cities; - } - - Field field = super.createField(item, propertyId, uiContext); - if (propertyId.equals("postalCode")) { - TextField tf = (TextField) field; - /* - * We do not want to display "null" to the user when the - * field is empty - */ - tf.setNullRepresentation(""); - - /* Add a validator for postalCode and make it required */ - tf - .addValidator(new RegexpValidator("[1-9][0-9]{4}", - "Postal code must be a five digit number and cannot start with a zero.")); - tf.setRequired(true); - } else if (propertyId.equals("email")) { - /* Add a validator for email and make it required */ - field.addValidator(new EmailValidator( - "Email must contain '@' and have full domain.")); - field.setRequired(true); - - } - - field.setWidth("200px"); - return field; - } - }); - } - - public void buttonClick(ClickEvent event) { - Button source = event.getButton(); - - if (source == save) { - /* If the given input is not valid there is no point in continuing */ - if (!isValid()) { - return; - } - - commit(); - if (newContactMode) { - /* We need to add the new person to the container */ - Item addedItem = app.getDataSource().addItem(newPerson); - /* - * We must update the form to use the Item from our datasource - * as we are now in edit mode (no longer in add mode) - */ - setItemDataSource(addedItem); - - newContactMode = false; - } - setReadOnly(true); - } else if (source == cancel) { - if (newContactMode) { - newContactMode = false; - /* Clear the form and make it invisible */ - setItemDataSource(null); - } else { - discard(); - } - setReadOnly(true); - } else if (source == edit) { - setReadOnly(false); - } - } - - @Override - public void setItemDataSource(Item newDataSource) { - newContactMode = false; - - if (newDataSource != null) { - List<Object> orderedProperties = Arrays - .asList(PersonContainer.NATURAL_COL_ORDER); - super.setItemDataSource(newDataSource, orderedProperties); - - setReadOnly(true); - getFooter().setVisible(true); - } else { - super.setItemDataSource(null); - getFooter().setVisible(false); - } - } - - @Override - public void setReadOnly(boolean readOnly) { - super.setReadOnly(readOnly); - save.setVisible(!readOnly); - cancel.setVisible(!readOnly); - edit.setVisible(readOnly); - } - - public void addContact() { - // Create a temporary item for the form - newPerson = new Person(); - setItemDataSource(new BeanItem(newPerson)); - newContactMode = true; - setReadOnly(false); - } - -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/PersonList.java b/src/com/vaadin/demo/tutorial/addressbook/ui/PersonList.java deleted file mode 100644 index 30a48dbb9e..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/PersonList.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import com.vaadin.demo.tutorial.addressbook.AddressBookApplication; -import com.vaadin.demo.tutorial.addressbook.data.Person; -import com.vaadin.demo.tutorial.addressbook.data.PersonContainer; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Link; -import com.vaadin.ui.Table; - -@SuppressWarnings("serial") -public class PersonList extends Table { - public PersonList(AddressBookApplication app) { - setSizeFull(); - setContainerDataSource(app.getDataSource()); - - setVisibleColumns(PersonContainer.NATURAL_COL_ORDER); - setColumnHeaders(PersonContainer.COL_HEADERS_ENGLISH); - - setColumnCollapsingAllowed(true); - setColumnReorderingAllowed(true); - - /* - * Make table selectable, react immediatedly to user events, and pass - * events to the controller (our main application) - */ - setSelectable(true); - setImmediate(true); - addListener((ValueChangeListener) app); - /* We don't want to allow users to de-select a row */ - setNullSelectionAllowed(false); - - // customize email column to have mailto: links using column generator - addGeneratedColumn("email", new ColumnGenerator() { - public Component generateCell(Table source, Object itemId, - Object columnId) { - Person p = (Person) itemId; - Link l = new Link(); - l.setResource(new ExternalResource("mailto:" + p.getEmail())); - l.setCaption(p.getEmail()); - return l; - } - }); - } - -}
\ No newline at end of file diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/SearchView.java b/src/com/vaadin/demo/tutorial/addressbook/ui/SearchView.java deleted file mode 100644 index de2313b2a7..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/SearchView.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import com.vaadin.demo.tutorial.addressbook.AddressBookApplication; -import com.vaadin.demo.tutorial.addressbook.data.PersonContainer; -import com.vaadin.demo.tutorial.addressbook.data.SearchFilter; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Window.Notification; - -@SuppressWarnings("serial") -public class SearchView extends Panel { - - private TextField tf; - private NativeSelect fieldToSearch; - private CheckBox saveSearch; - private TextField searchName; - private AddressBookApplication app; - - public SearchView(final AddressBookApplication app) { - this.app = app; - addStyleName("view"); - - setCaption("Search contacts"); - setSizeFull(); - - /* Use a FormLayout as main layout for this Panel */ - FormLayout formLayout = new FormLayout(); - setContent(formLayout); - - /* Create UI components */ - tf = new TextField("Search term"); - fieldToSearch = new NativeSelect("Field to search"); - saveSearch = new CheckBox("Save search"); - searchName = new TextField("Search name"); - Button search = new Button("Search"); - - /* Initialize fieldToSearch */ - for (int i = 0; i < PersonContainer.NATURAL_COL_ORDER.length; i++) { - fieldToSearch.addItem(PersonContainer.NATURAL_COL_ORDER[i]); - fieldToSearch.setItemCaption(PersonContainer.NATURAL_COL_ORDER[i], - PersonContainer.COL_HEADERS_ENGLISH[i]); - } - - fieldToSearch.setValue("lastName"); - fieldToSearch.setNullSelectionAllowed(false); - - /* Initialize save checkbox */ - saveSearch.setValue(true); - saveSearch.setImmediate(true); - saveSearch.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - searchName.setVisible(event.getButton().booleanValue()); - } - }); - - search.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - performSearch(); - } - - }); - - /* Add all the created components to the form */ - addComponent(tf); - addComponent(fieldToSearch); - addComponent(saveSearch); - addComponent(searchName); - addComponent(search); - } - - private void performSearch() { - String searchTerm = (String) tf.getValue(); - if (searchTerm == null || searchTerm.equals("")) { - getWindow().showNotification("Search term cannot be empty!", - Notification.TYPE_WARNING_MESSAGE); - return; - } - - SearchFilter searchFilter = new SearchFilter(fieldToSearch.getValue(), - searchTerm, (String) searchName.getValue()); - if (saveSearch.booleanValue()) { - if (searchName.getValue() == null - || searchName.getValue().equals("")) { - getWindow().showNotification( - "Please enter a name for your search!", - Notification.TYPE_WARNING_MESSAGE); - return; - } - app.saveSearch(searchFilter); - } - app.search(searchFilter); - } - -} diff --git a/src/com/vaadin/demo/tutorial/addressbook/ui/SharingOptions.java b/src/com/vaadin/demo/tutorial/addressbook/ui/SharingOptions.java deleted file mode 100644 index f6c3a591f2..0000000000 --- a/src/com/vaadin/demo/tutorial/addressbook/ui/SharingOptions.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.demo.tutorial.addressbook.ui; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -@SuppressWarnings("serial") -public class SharingOptions extends Window { - public SharingOptions() { - /* - * Make the window modal, which will disable all other components while - * it is visible - */ - setModal(true); - - /* Make the sub window 50% the size of the browser window */ - setWidth("50%"); - /* - * Center the window both horizontally and vertically in the browser - * window - */ - center(); - - setCaption("Sharing options"); - addComponent(new Label( - "With these setting you can modify contact sharing " - + "options. (non-functional, example of modal dialog)")); - addComponent(new CheckBox("Gmail")); - addComponent(new CheckBox(".Mac")); - Button close = new Button("OK"); - close.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - SharingOptions.this.close(); - } - }); - addComponent(close); - } -} diff --git a/src/com/vaadin/demo/util/SampleCalendarDatabase.java b/src/com/vaadin/demo/util/SampleCalendarDatabase.java deleted file mode 100644 index f5bd59dc11..0000000000 --- a/src/com/vaadin/demo/util/SampleCalendarDatabase.java +++ /dev/null @@ -1,169 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.util; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; - -/** - * Creates temporary database named toolkit with sample table named employee and - * populates it with data. By default we use HSQLDB. Ensure that you have - * hsqldb.jar under WEB-INF/lib directory. Database is will be created into - * memory. - * - * @author IT Mill Ltd. - * - */ -public class SampleCalendarDatabase { - - public static final int ENTRYCOUNT = 100; - - public static final String DB_TABLE_NAME = "calendar"; - public static final String PROPERTY_ID_START = "EVENTSTART"; - public static final String PROPERTY_ID_END = "EVENTEND"; - public static final String PROPERTY_ID_TITLE = "TITLE"; - public static final String PROPERTY_ID_NOTIME = "NOTIME"; - - private Connection connection = null; - - private static final String[] titles = new String[] { "Meeting", "Dentist", - "Haircut", "Bank", "Birthday", "Library", "Rent", "Acme test", - "Party" }; - - /** - * Create temporary database. - * - */ - public SampleCalendarDatabase() { - // connect to SQL database - connect(); - - // initialize SQL database - createTables(); - - // test by executing sample JDBC query - testDatabase(); - } - - /** - * Creates sample table named employee and populates it with data.Use the - * specified database connection. - * - * @param connection - */ - public SampleCalendarDatabase(Connection connection) { - // initialize SQL database - createTables(); - - // test by executing sample JDBC query - testDatabase(); - } - - /** - * Connect to SQL database. In this sample we use HSQLDB and an toolkit - * named database in implicitly created into system memory. - * - */ - private void connect() { - // use memory-Only Database - final String url = "jdbc:hsqldb:mem:toolkit"; - try { - Class.forName("org.hsqldb.jdbcDriver").newInstance(); - connection = DriverManager.getConnection(url, "sa", ""); - } catch (final Exception e) { - throw new RuntimeException(e); - } - } - - /** - * use for SQL commands CREATE, DROP, INSERT and UPDATE - * - * @param expression - * @throws SQLException - */ - public void update(String expression) throws SQLException { - Statement st = null; - st = connection.createStatement(); - final int i = st.executeUpdate(expression); - if (i == -1) { - System.out.println("SampleDatabase error : " + expression); - } - st.close(); - } - - /** - * Create test table and few rows. Issue note: using capitalized column - * names as HSQLDB returns column names in capitalized form with this demo. - * - */ - @SuppressWarnings("deprecation") - private void createTables() { - try { - String stmt = null; - stmt = "CREATE TABLE " - + DB_TABLE_NAME - + " ( ID INTEGER IDENTITY, TITLE VARCHAR(100), " - + "EVENTSTART DATETIME, EVENTEND DATETIME, NOTIME BOOLEAN )"; - update(stmt); - for (int j = 0; j < ENTRYCOUNT; j++) { - final Timestamp start = new Timestamp(new java.util.Date() - .getTime()); - start.setDate((int) ((Math.random() - 0.4) * 200)); - start.setMinutes(0); - start.setHours(8 + (int) Math.random() * 12); - final Timestamp end = new Timestamp(start.getTime()); - if (Math.random() < 0.7) { - long t = end.getTime(); - final long hour = 60 * 60 * 1000; - t = t + hour + (Math.round(Math.random() * 3 * hour)); - end.setTime(t); - } - - stmt = "INSERT INTO " - + DB_TABLE_NAME - + "(TITLE, EVENTSTART, EVENTEND, NOTIME) VALUES (" - + "'" - + titles[(int) (Math.round(Math.random() - * (titles.length - 1)))] + "','" + start - + "','" + end + "'," + (Math.random() > 0.7) + ")"; - update(stmt); - } - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - } - - /** - * Test database connection with simple SELECT command. - * - */ - private String testDatabase() { - String result = null; - try { - final Statement stmt = connection.createStatement( - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_UPDATABLE); - final ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM " - + DB_TABLE_NAME); - rs.next(); - result = "rowcount for table test is " + rs.getObject(1).toString(); - stmt.close(); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - return result; - } - - public Connection getConnection() { - return connection; - } - -} diff --git a/src/com/vaadin/demo/util/SampleDatabase.java b/src/com/vaadin/demo/util/SampleDatabase.java deleted file mode 100644 index e9238d95da..0000000000 --- a/src/com/vaadin/demo/util/SampleDatabase.java +++ /dev/null @@ -1,173 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.util; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -/** - * Creates temporary database named toolkit with sample table named employee and - * populates it with data. By default we use HSQLDB. Ensure that you have - * hsqldb.jar under WEB-INF/lib directory. Database is will be created into - * memory. - * - * @author IT Mill Ltd. - * - */ -public class SampleDatabase { - - public static final int ROWCOUNT = 1000; - - private Connection connection = null; - - private static final String[] firstnames = new String[] { "Amanda", - "Andrew", "Bill", "Frank", "Matt", "Xavier", "John", "Mary", "Joe", - "Gloria", "Marcus", "Belinda", "David", "Anthony", "Julian", - "Paul", "Carrie", "Susan", "Gregg", "Michael", "William", "Ethan", - "Thomas", "Oscar", "Norman", "Roy", "Sarah", "Jeff", "Jane", - "Peter", "Marc", "Josie", "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Jones", "Beck", "Burton", "Bell", "Davis", "Burke", - "Bernard", "Hood", "Scott", "Smith", "Carter", "Roller", "Conrad", - "Martin", "Fisher", "Martell", "Freeman", "Hackman", "Jones", - "Harper", "Russek", "Johnson", "Sheridan", "Hill", "Parker", - "Foster", "Moss", "Fielding" }; - - private static final String[] titles = new String[] { "Project Manager", - "Marketing Manager", "Sales Manager", "Sales", "Trainer", - "Technical Support", "Account Manager", "Customer Support", - "Testing Engineer", "Software Designer", "Programmer", "Consultant" }; - - private static final String[] units = new String[] { "Tokyo", - "Mexico City", "Seoul", "New York", "Sao Paulo", "Bombay", "Delhi", - "Shanghai", "Los Angeles", "London", "Shanghai", "Sydney", - "Bangalore", "Hong Kong", "Madrid", "Milano", "Beijing", "Paris", - "Moscow", "Berlin", "Helsinki" }; - - /** - * Create temporary database. - * - */ - public SampleDatabase() { - // connect to SQL database - connect(); - - // initialize SQL database - createTables(); - - // test by executing sample JDBC query - testDatabase(); - } - - /** - * Creates sample table named employee and populates it with data.Use the - * specified database connection. - * - * @param connection - */ - public SampleDatabase(Connection connection) { - // initialize SQL database - createTables(); - - // test by executing sample JDBC query - testDatabase(); - } - - /** - * Connect to SQL database. In this sample we use HSQLDB and an toolkit - * named database in implicitly created into system memory. - * - */ - private void connect() { - // use memory-Only Database - final String url = "jdbc:hsqldb:mem:toolkit"; - try { - Class.forName("org.hsqldb.jdbcDriver").newInstance(); - connection = DriverManager.getConnection(url, "sa", ""); - } catch (final Exception e) { - throw new RuntimeException(e); - } - } - - /** - * use for SQL commands CREATE, DROP, INSERT and UPDATE - * - * @param expression - * @throws SQLException - */ - public void update(String expression) throws SQLException { - Statement st = null; - st = connection.createStatement(); - final int i = st.executeUpdate(expression); - if (i == -1) { - throw new SQLException("Database error : " + expression); - } - st.close(); - } - - /** - * Create test table and few rows. Issue note: using capitalized column - * names as HSQLDB returns column names in capitalized form with this demo. - * - */ - private void createTables() { - try { - String stmt = null; - stmt = "CREATE TABLE employee ( ID INTEGER IDENTITY, FIRSTNAME VARCHAR(100), " - + "LASTNAME VARCHAR(100), TITLE VARCHAR(100), UNIT VARCHAR(100) )"; - update(stmt); - for (int j = 0; j < ROWCOUNT; j++) { - stmt = "INSERT INTO employee(FIRSTNAME, LASTNAME, TITLE, UNIT) VALUES (" - + "'" - + firstnames[(int) (Math.random() * (firstnames.length - 1))] - + "'," - + "'" - + lastnames[(int) (Math.random() * (lastnames.length - 1))] - + "'," - + "'" - + titles[(int) (Math.random() * (titles.length - 1))] - + "'," - + "'" - + units[(int) (Math.random() * (units.length - 1))] - + "'" + ")"; - update(stmt); - } - } catch (final SQLException e) { - if (e.toString().indexOf("Table already exists") == -1) { - throw new RuntimeException(e); - } - } - } - - /** - * Test database connection with simple SELECT command. - * - */ - private String testDatabase() { - String result = null; - try { - final Statement stmt = connection.createStatement( - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_UPDATABLE); - final ResultSet rs = stmt - .executeQuery("SELECT COUNT(*) FROM employee"); - rs.next(); - result = "rowcount for table test is " + rs.getObject(1).toString(); - stmt.close(); - } catch (final SQLException e) { - throw new RuntimeException(e); - } - return result; - } - - public Connection getConnection() { - return connection; - } - -} diff --git a/src/com/vaadin/demo/util/SampleDirectory.java b/src/com/vaadin/demo/util/SampleDirectory.java deleted file mode 100644 index a82b9bedc8..0000000000 --- a/src/com/vaadin/demo/util/SampleDirectory.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.util; - -import java.io.File; - -import com.vaadin.Application; -import com.vaadin.terminal.SystemError; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; - -/** - * Provides sample directory based on application directory. If this fails then - * sampleDirectory property is read. If no sample directory is resolved, then a - * panel displaying error message is added to main window. - * - * @author IT Mill Ltd. - * - */ -public class SampleDirectory { - - /** - * Get sample directory. - * - * @param application - * @return file pointing to sample directory - */ - public static File getDirectory(Application application) { - String errorMessage = "Access to application " - + "context base directory failed, " - + "possible security constraint with Application " - + "Server or Servlet Container.<br />"; - File file = application.getContext().getBaseDirectory(); - if ((file == null) || (!file.canRead()) - || (file.getAbsolutePath() == null)) { - // cannot access example directory, possible security issue with - // Application Server or Servlet Container - // Try to read sample directory from web.xml parameter - if (application.getProperty("sampleDirectory") != null) { - file = new File(application.getProperty("sampleDirectory")); - if ((file != null) && (file.canRead()) - && (file.getAbsolutePath() != null)) { - // Success using property - return file; - } - // Failure using property - errorMessage += "Failed also to access sample directory <b>[" - + application.getProperty("sampleDirectory") - + "]</b> defined in <b>sampleDirectory property</b>."; - } else { - // Failure using application context base dir, no property set - errorMessage += "<b>Note: </b>You can set this manually in " - + "web.xml by defining " + "sampleDirectory property."; - } - } else { - // Success using application context base dir - return file; - } - // Add failure notification as an Panel to main window - final Panel errorPanel = new Panel("Demo application error"); - errorPanel.setStyleName("strong"); - errorPanel.setComponentError(new SystemError( - "Cannot provide sample directory")); - errorPanel.addComponent(new Label(errorMessage, Label.CONTENT_XHTML)); - // Remove all components from applications main window - application.getMainWindow().getContent().removeAllComponents(); - // Add error panel - application.getMainWindow().getContent().addComponent(errorPanel); - return null; - } -} diff --git a/src/com/vaadin/automatedtests/ComponentsInTable.java b/tests/src/com/vaadin/automatedtests/ComponentsInTable.java index ccbe29d2d5..ccbe29d2d5 100644 --- a/src/com/vaadin/automatedtests/ComponentsInTable.java +++ b/tests/src/com/vaadin/automatedtests/ComponentsInTable.java diff --git a/src/com/vaadin/automatedtests/SimplestApplication.java b/tests/src/com/vaadin/automatedtests/SimplestApplication.java index 7de7e0928e..7de7e0928e 100644 --- a/src/com/vaadin/automatedtests/SimplestApplication.java +++ b/tests/src/com/vaadin/automatedtests/SimplestApplication.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java index 05894392ef..05894392ef 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java index aabfe41b20..aabfe41b20 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java index 2012329df1..2012329df1 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java index 753c746fdb..753c746fdb 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java index 2ecf60ecdb..2ecf60ecdb 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java b/tests/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java index b6f2e0e163..b6f2e0e163 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/FormExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/FormExample.java index 927f2ba978..927f2ba978 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/FormExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/FormExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java index 260716a31d..260716a31d 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java index 21e49ce320..21e49ce320 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java index 37b946824d..37b946824d 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java index d5a0773fe2..d5a0773fe2 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java index f3d46a7d00..f3d46a7d00 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java index 84c16e3a26..84c16e3a26 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java index ab6711efce..ab6711efce 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/TableExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/TableExample.java index b1b4fccf6f..b1b4fccf6f 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/TableExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/TableExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java index cf5a6a7f33..cf5a6a7f33 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java index 14415d3794..14415d3794 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java diff --git a/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java index 488d33702f..488d33702f 100644 --- a/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java +++ b/tests/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java diff --git a/src/com/vaadin/automatedtests/robustness/Robustness.java b/tests/src/com/vaadin/automatedtests/robustness/Robustness.java index 13add217cd..13add217cd 100644 --- a/src/com/vaadin/automatedtests/robustness/Robustness.java +++ b/tests/src/com/vaadin/automatedtests/robustness/Robustness.java diff --git a/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java b/tests/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java index 9e72af8b86..9e72af8b86 100644 --- a/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java +++ b/tests/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java diff --git a/src/com/vaadin/automatedtests/util/DebugId.java b/tests/src/com/vaadin/automatedtests/util/DebugId.java index 8f2390933b..8f2390933b 100644 --- a/src/com/vaadin/automatedtests/util/DebugId.java +++ b/tests/src/com/vaadin/automatedtests/util/DebugId.java diff --git a/src/com/vaadin/automatedtests/util/Log.java b/tests/src/com/vaadin/automatedtests/util/Log.java index f9948af60e..f9948af60e 100644 --- a/src/com/vaadin/automatedtests/util/Log.java +++ b/tests/src/com/vaadin/automatedtests/util/Log.java diff --git a/src/com/vaadin/automatedtests/util/MultiListener.java b/tests/src/com/vaadin/automatedtests/util/MultiListener.java index 5f7df2ab99..5f7df2ab99 100644 --- a/src/com/vaadin/automatedtests/util/MultiListener.java +++ b/tests/src/com/vaadin/automatedtests/util/MultiListener.java diff --git a/src/com/vaadin/automatedtests/util/RandomComponents.java b/tests/src/com/vaadin/automatedtests/util/RandomComponents.java index 46446d8f3b..46446d8f3b 100644 --- a/src/com/vaadin/automatedtests/util/RandomComponents.java +++ b/tests/src/com/vaadin/automatedtests/util/RandomComponents.java diff --git a/src/com/vaadin/automatedtests/util/StatusServlet.java b/tests/src/com/vaadin/automatedtests/util/StatusServlet.java index c0b3c7c118..c0b3c7c118 100644 --- a/src/com/vaadin/automatedtests/util/StatusServlet.java +++ b/tests/src/com/vaadin/automatedtests/util/StatusServlet.java diff --git a/src/com/vaadin/tests/BasicRandomTest.java b/tests/src/com/vaadin/tests/BasicRandomTest.java index f78b0ca673..f78b0ca673 100644 --- a/src/com/vaadin/tests/BasicRandomTest.java +++ b/tests/src/com/vaadin/tests/BasicRandomTest.java diff --git a/src/com/vaadin/tests/CustomLayoutDemo.java b/tests/src/com/vaadin/tests/CustomLayoutDemo.java index ac0507332b..ac0507332b 100644 --- a/src/com/vaadin/tests/CustomLayoutDemo.java +++ b/tests/src/com/vaadin/tests/CustomLayoutDemo.java diff --git a/src/com/vaadin/tests/FocusingComponents.java b/tests/src/com/vaadin/tests/FocusingComponents.java index 0f1fb6ccb0..0f1fb6ccb0 100644 --- a/src/com/vaadin/tests/FocusingComponents.java +++ b/tests/src/com/vaadin/tests/FocusingComponents.java diff --git a/src/com/vaadin/tests/LayoutDemo.java b/tests/src/com/vaadin/tests/LayoutDemo.java index cdeeebfa37..cdeeebfa37 100644 --- a/src/com/vaadin/tests/LayoutDemo.java +++ b/tests/src/com/vaadin/tests/LayoutDemo.java diff --git a/src/com/vaadin/tests/ListenerOrder.java b/tests/src/com/vaadin/tests/ListenerOrder.java index 6f62f6a83e..6f62f6a83e 100644 --- a/src/com/vaadin/tests/ListenerOrder.java +++ b/tests/src/com/vaadin/tests/ListenerOrder.java diff --git a/src/com/vaadin/tests/ModalWindow.java b/tests/src/com/vaadin/tests/ModalWindow.java index 90d239abfd..90d239abfd 100644 --- a/src/com/vaadin/tests/ModalWindow.java +++ b/tests/src/com/vaadin/tests/ModalWindow.java diff --git a/src/com/vaadin/tests/NativeWindowing.java b/tests/src/com/vaadin/tests/NativeWindowing.java index 13c3139036..13c3139036 100644 --- a/src/com/vaadin/tests/NativeWindowing.java +++ b/tests/src/com/vaadin/tests/NativeWindowing.java diff --git a/src/com/vaadin/tests/OrderedLayoutSwapComponents.java b/tests/src/com/vaadin/tests/OrderedLayoutSwapComponents.java index 89382053d4..89382053d4 100644 --- a/src/com/vaadin/tests/OrderedLayoutSwapComponents.java +++ b/tests/src/com/vaadin/tests/OrderedLayoutSwapComponents.java diff --git a/src/com/vaadin/tests/Parameters.java b/tests/src/com/vaadin/tests/Parameters.java index 6d887b03ad..6d887b03ad 100644 --- a/src/com/vaadin/tests/Parameters.java +++ b/tests/src/com/vaadin/tests/Parameters.java diff --git a/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/tests/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java index be0e64dd79..be0e64dd79 100644 --- a/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java +++ b/tests/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java diff --git a/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/tests/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java index 6b5f271dbe..6b5f271dbe 100644 --- a/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java +++ b/tests/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java diff --git a/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/tests/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java index cf03074e56..cf03074e56 100644 --- a/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java +++ b/tests/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java diff --git a/src/com/vaadin/tests/QueryContainerDemo.java b/tests/src/com/vaadin/tests/QueryContainerDemo.java index abd98016cd..abd98016cd 100644 --- a/src/com/vaadin/tests/QueryContainerDemo.java +++ b/tests/src/com/vaadin/tests/QueryContainerDemo.java diff --git a/src/com/vaadin/tests/RandomLayoutStress.java b/tests/src/com/vaadin/tests/RandomLayoutStress.java index a6277a8262..a6277a8262 100644 --- a/src/com/vaadin/tests/RandomLayoutStress.java +++ b/tests/src/com/vaadin/tests/RandomLayoutStress.java diff --git a/src/com/vaadin/tests/ScrollbarStressTest.java b/tests/src/com/vaadin/tests/ScrollbarStressTest.java index b6cef8353a..b6cef8353a 100644 --- a/src/com/vaadin/tests/ScrollbarStressTest.java +++ b/tests/src/com/vaadin/tests/ScrollbarStressTest.java diff --git a/src/com/vaadin/tests/StressComponentsInTable.java b/tests/src/com/vaadin/tests/StressComponentsInTable.java index 6f04f5b731..6f04f5b731 100644 --- a/src/com/vaadin/tests/StressComponentsInTable.java +++ b/tests/src/com/vaadin/tests/StressComponentsInTable.java diff --git a/src/com/vaadin/tests/TableChangingDatasource.java b/tests/src/com/vaadin/tests/TableChangingDatasource.java index 9de6c9aa1b..9de6c9aa1b 100644 --- a/src/com/vaadin/tests/TableChangingDatasource.java +++ b/tests/src/com/vaadin/tests/TableChangingDatasource.java diff --git a/src/com/vaadin/tests/TableSelectTest.java b/tests/src/com/vaadin/tests/TableSelectTest.java index 69363bd0bc..69363bd0bc 100644 --- a/src/com/vaadin/tests/TableSelectTest.java +++ b/tests/src/com/vaadin/tests/TableSelectTest.java diff --git a/src/com/vaadin/tests/TestBench.java b/tests/src/com/vaadin/tests/TestBench.java index a77e60fa65..a77e60fa65 100644 --- a/src/com/vaadin/tests/TestBench.java +++ b/tests/src/com/vaadin/tests/TestBench.java diff --git a/src/com/vaadin/tests/TestCaptionWrapper.java b/tests/src/com/vaadin/tests/TestCaptionWrapper.java index c15270458e..c15270458e 100644 --- a/src/com/vaadin/tests/TestCaptionWrapper.java +++ b/tests/src/com/vaadin/tests/TestCaptionWrapper.java diff --git a/src/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/src/com/vaadin/tests/TestComponentAddAndRecursion.java index 469d620b53..469d620b53 100644 --- a/src/com/vaadin/tests/TestComponentAddAndRecursion.java +++ b/tests/src/com/vaadin/tests/TestComponentAddAndRecursion.java diff --git a/src/com/vaadin/tests/TestComponentsAndLayouts.java b/tests/src/com/vaadin/tests/TestComponentsAndLayouts.java index 5187f8f8e6..5187f8f8e6 100644 --- a/src/com/vaadin/tests/TestComponentsAndLayouts.java +++ b/tests/src/com/vaadin/tests/TestComponentsAndLayouts.java diff --git a/src/com/vaadin/tests/TestContainerChanges.java b/tests/src/com/vaadin/tests/TestContainerChanges.java index af27484834..af27484834 100644 --- a/src/com/vaadin/tests/TestContainerChanges.java +++ b/tests/src/com/vaadin/tests/TestContainerChanges.java diff --git a/src/com/vaadin/tests/TestDateField.java b/tests/src/com/vaadin/tests/TestDateField.java index 39621b0b8e..39621b0b8e 100644 --- a/src/com/vaadin/tests/TestDateField.java +++ b/tests/src/com/vaadin/tests/TestDateField.java diff --git a/src/com/vaadin/tests/TestForAlignments.java b/tests/src/com/vaadin/tests/TestForAlignments.java index d8c7c0d59c..d8c7c0d59c 100644 --- a/src/com/vaadin/tests/TestForAlignments.java +++ b/tests/src/com/vaadin/tests/TestForAlignments.java diff --git a/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/tests/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java index 6de6d3c046..6de6d3c046 100644 --- a/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java +++ b/tests/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java diff --git a/src/com/vaadin/tests/TestForBasicApplicationLayout.java b/tests/src/com/vaadin/tests/TestForBasicApplicationLayout.java index b6cd1d28a9..b6cd1d28a9 100644 --- a/src/com/vaadin/tests/TestForBasicApplicationLayout.java +++ b/tests/src/com/vaadin/tests/TestForBasicApplicationLayout.java diff --git a/src/com/vaadin/tests/TestForChildComponentRendering.java b/tests/src/com/vaadin/tests/TestForChildComponentRendering.java index 9b5d02e945..9b5d02e945 100644 --- a/src/com/vaadin/tests/TestForChildComponentRendering.java +++ b/tests/src/com/vaadin/tests/TestForChildComponentRendering.java diff --git a/src/com/vaadin/tests/TestForContainerFilterable.java b/tests/src/com/vaadin/tests/TestForContainerFilterable.java index 7c261f1017..7c261f1017 100644 --- a/src/com/vaadin/tests/TestForContainerFilterable.java +++ b/tests/src/com/vaadin/tests/TestForContainerFilterable.java diff --git a/src/com/vaadin/tests/TestForExpandLayout.java b/tests/src/com/vaadin/tests/TestForExpandLayout.java index e58ec24161..e58ec24161 100644 --- a/src/com/vaadin/tests/TestForExpandLayout.java +++ b/tests/src/com/vaadin/tests/TestForExpandLayout.java diff --git a/src/com/vaadin/tests/TestForExpandLayout2.java b/tests/src/com/vaadin/tests/TestForExpandLayout2.java index 5c6ff7955b..5c6ff7955b 100644 --- a/src/com/vaadin/tests/TestForExpandLayout2.java +++ b/tests/src/com/vaadin/tests/TestForExpandLayout2.java diff --git a/src/com/vaadin/tests/TestForExpandLayout3.java b/tests/src/com/vaadin/tests/TestForExpandLayout3.java index ae4adfcfaa..ae4adfcfaa 100644 --- a/src/com/vaadin/tests/TestForExpandLayout3.java +++ b/tests/src/com/vaadin/tests/TestForExpandLayout3.java diff --git a/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/tests/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java index 9ff23e62ca..9ff23e62ca 100644 --- a/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ b/tests/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java diff --git a/src/com/vaadin/tests/TestForMultipleStyleNames.java b/tests/src/com/vaadin/tests/TestForMultipleStyleNames.java index a0facecd56..a0facecd56 100644 --- a/src/com/vaadin/tests/TestForMultipleStyleNames.java +++ b/tests/src/com/vaadin/tests/TestForMultipleStyleNames.java diff --git a/src/com/vaadin/tests/TestForNativeWindowing.java b/tests/src/com/vaadin/tests/TestForNativeWindowing.java index 8311a2e955..8311a2e955 100644 --- a/src/com/vaadin/tests/TestForNativeWindowing.java +++ b/tests/src/com/vaadin/tests/TestForNativeWindowing.java diff --git a/src/com/vaadin/tests/TestForPreconfiguredComponents.java b/tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java index fa153fcda7..fa153fcda7 100644 --- a/src/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java diff --git a/src/com/vaadin/tests/TestForRichTextEditor.java b/tests/src/com/vaadin/tests/TestForRichTextEditor.java index 7ac97ce882..7ac97ce882 100644 --- a/src/com/vaadin/tests/TestForRichTextEditor.java +++ b/tests/src/com/vaadin/tests/TestForRichTextEditor.java diff --git a/src/com/vaadin/tests/TestForStyledUpload.java b/tests/src/com/vaadin/tests/TestForStyledUpload.java index 0e4933d2b9..0e4933d2b9 100644 --- a/src/com/vaadin/tests/TestForStyledUpload.java +++ b/tests/src/com/vaadin/tests/TestForStyledUpload.java diff --git a/src/com/vaadin/tests/TestForTabSheet.java b/tests/src/com/vaadin/tests/TestForTabSheet.java index f53faabfcb..f53faabfcb 100644 --- a/src/com/vaadin/tests/TestForTabSheet.java +++ b/tests/src/com/vaadin/tests/TestForTabSheet.java diff --git a/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/tests/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index adde3f8c0e..adde3f8c0e 100644 --- a/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/tests/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java diff --git a/src/com/vaadin/tests/TestForTrees.java b/tests/src/com/vaadin/tests/TestForTrees.java index f0f326c304..f0f326c304 100644 --- a/src/com/vaadin/tests/TestForTrees.java +++ b/tests/src/com/vaadin/tests/TestForTrees.java diff --git a/src/com/vaadin/tests/TestForUpload.java b/tests/src/com/vaadin/tests/TestForUpload.java index 351a590b26..351a590b26 100644 --- a/src/com/vaadin/tests/TestForUpload.java +++ b/tests/src/com/vaadin/tests/TestForUpload.java diff --git a/src/com/vaadin/tests/TestForWindowOpen.java b/tests/src/com/vaadin/tests/TestForWindowOpen.java index d6cd6fcc95..d6cd6fcc95 100644 --- a/src/com/vaadin/tests/TestForWindowOpen.java +++ b/tests/src/com/vaadin/tests/TestForWindowOpen.java diff --git a/src/com/vaadin/tests/TestForWindowing.java b/tests/src/com/vaadin/tests/TestForWindowing.java index 9fb3ea19ea..9fb3ea19ea 100644 --- a/src/com/vaadin/tests/TestForWindowing.java +++ b/tests/src/com/vaadin/tests/TestForWindowing.java diff --git a/src/com/vaadin/tests/TestIFrames.java b/tests/src/com/vaadin/tests/TestIFrames.java index 6719820c44..6719820c44 100644 --- a/src/com/vaadin/tests/TestIFrames.java +++ b/tests/src/com/vaadin/tests/TestIFrames.java diff --git a/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java b/tests/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java index b85c629295..b85c629295 100644 --- a/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java +++ b/tests/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java diff --git a/src/com/vaadin/tests/TestSerialization.java b/tests/src/com/vaadin/tests/TestSerialization.java index 1ee7f3c1ac..1ee7f3c1ac 100644 --- a/src/com/vaadin/tests/TestSerialization.java +++ b/tests/src/com/vaadin/tests/TestSerialization.java diff --git a/src/com/vaadin/tests/TestSetVisibleAndCaching.java b/tests/src/com/vaadin/tests/TestSetVisibleAndCaching.java index 4e7132b3c8..4e7132b3c8 100644 --- a/src/com/vaadin/tests/TestSetVisibleAndCaching.java +++ b/tests/src/com/vaadin/tests/TestSetVisibleAndCaching.java diff --git a/src/com/vaadin/tests/TestSizeableIncomponents.java b/tests/src/com/vaadin/tests/TestSizeableIncomponents.java index 7c9788e640..7c9788e640 100644 --- a/src/com/vaadin/tests/TestSizeableIncomponents.java +++ b/tests/src/com/vaadin/tests/TestSizeableIncomponents.java diff --git a/src/com/vaadin/tests/TestSplitPanel.java b/tests/src/com/vaadin/tests/TestSplitPanel.java index 628fec96d2..628fec96d2 100644 --- a/src/com/vaadin/tests/TestSplitPanel.java +++ b/tests/src/com/vaadin/tests/TestSplitPanel.java diff --git a/src/com/vaadin/tests/TreeFilesystem.java b/tests/src/com/vaadin/tests/TreeFilesystem.java index 202338cd50..202338cd50 100644 --- a/src/com/vaadin/tests/TreeFilesystem.java +++ b/tests/src/com/vaadin/tests/TreeFilesystem.java diff --git a/src/com/vaadin/tests/TreeFilesystemContainer.java b/tests/src/com/vaadin/tests/TreeFilesystemContainer.java index 52154fbe22..52154fbe22 100644 --- a/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/tests/src/com/vaadin/tests/TreeFilesystemContainer.java diff --git a/src/com/vaadin/tests/UpgradingSample.java b/tests/src/com/vaadin/tests/UpgradingSample.java index 3819b33a3c..3819b33a3c 100644 --- a/src/com/vaadin/tests/UpgradingSample.java +++ b/tests/src/com/vaadin/tests/UpgradingSample.java diff --git a/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java b/tests/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java index b54bd3d184..b54bd3d184 100644 --- a/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java +++ b/tests/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java diff --git a/src/com/vaadin/tests/UsingObjectsInSelect.java b/tests/src/com/vaadin/tests/UsingObjectsInSelect.java index 2fc0fc5eac..2fc0fc5eac 100644 --- a/src/com/vaadin/tests/UsingObjectsInSelect.java +++ b/tests/src/com/vaadin/tests/UsingObjectsInSelect.java diff --git a/src/com/vaadin/tests/appengine/GAESyncTest.java b/tests/src/com/vaadin/tests/appengine/GAESyncTest.java index a28da32c39..a28da32c39 100644 --- a/src/com/vaadin/tests/appengine/GAESyncTest.java +++ b/tests/src/com/vaadin/tests/appengine/GAESyncTest.java diff --git a/src/com/vaadin/tests/appengine/img1.png b/tests/src/com/vaadin/tests/appengine/img1.png Binary files differindex d249324e0c..d249324e0c 100644 --- a/src/com/vaadin/tests/appengine/img1.png +++ b/tests/src/com/vaadin/tests/appengine/img1.png diff --git a/src/com/vaadin/tests/applicationservlet/NoMainWindow.java b/tests/src/com/vaadin/tests/applicationservlet/NoMainWindow.java index 9097274236..9097274236 100644 --- a/src/com/vaadin/tests/applicationservlet/NoMainWindow.java +++ b/tests/src/com/vaadin/tests/applicationservlet/NoMainWindow.java diff --git a/src/com/vaadin/tests/applicationservlet/TestStaticFilesLocation.java b/tests/src/com/vaadin/tests/applicationservlet/TestStaticFilesLocation.java index bf991d01cf..bf991d01cf 100644 --- a/src/com/vaadin/tests/applicationservlet/TestStaticFilesLocation.java +++ b/tests/src/com/vaadin/tests/applicationservlet/TestStaticFilesLocation.java diff --git a/src/com/vaadin/tests/book/BookTestApplication.java b/tests/src/com/vaadin/tests/book/BookTestApplication.java index 6d3b653baf..6d3b653baf 100644 --- a/src/com/vaadin/tests/book/BookTestApplication.java +++ b/tests/src/com/vaadin/tests/book/BookTestApplication.java diff --git a/src/com/vaadin/tests/book/ChatApplication.java b/tests/src/com/vaadin/tests/book/ChatApplication.java index a70d9d450f..a70d9d450f 100644 --- a/src/com/vaadin/tests/book/ChatApplication.java +++ b/tests/src/com/vaadin/tests/book/ChatApplication.java diff --git a/src/com/vaadin/tests/book/DefaultButtonExample.java b/tests/src/com/vaadin/tests/book/DefaultButtonExample.java index c3d96f1d16..c3d96f1d16 100644 --- a/src/com/vaadin/tests/book/DefaultButtonExample.java +++ b/tests/src/com/vaadin/tests/book/DefaultButtonExample.java diff --git a/src/com/vaadin/tests/book/EmbeddedButton.java b/tests/src/com/vaadin/tests/book/EmbeddedButton.java index 2ed67f0305..2ed67f0305 100644 --- a/src/com/vaadin/tests/book/EmbeddedButton.java +++ b/tests/src/com/vaadin/tests/book/EmbeddedButton.java diff --git a/src/com/vaadin/tests/book/FormExample.java b/tests/src/com/vaadin/tests/book/FormExample.java index bd6cfc0e98..bd6cfc0e98 100644 --- a/src/com/vaadin/tests/book/FormExample.java +++ b/tests/src/com/vaadin/tests/book/FormExample.java diff --git a/src/com/vaadin/tests/book/FormExample2.java b/tests/src/com/vaadin/tests/book/FormExample2.java index 2e7e09bdb2..2e7e09bdb2 100644 --- a/src/com/vaadin/tests/book/FormExample2.java +++ b/tests/src/com/vaadin/tests/book/FormExample2.java diff --git a/src/com/vaadin/tests/book/MyDynamicResource.java b/tests/src/com/vaadin/tests/book/MyDynamicResource.java index 9948bfe731..9948bfe731 100644 --- a/src/com/vaadin/tests/book/MyDynamicResource.java +++ b/tests/src/com/vaadin/tests/book/MyDynamicResource.java diff --git a/src/com/vaadin/tests/book/MyUploader.java b/tests/src/com/vaadin/tests/book/MyUploader.java index cc953e79cf..cc953e79cf 100644 --- a/src/com/vaadin/tests/book/MyUploader.java +++ b/tests/src/com/vaadin/tests/book/MyUploader.java diff --git a/src/com/vaadin/tests/book/SSNField.java b/tests/src/com/vaadin/tests/book/SSNField.java index aab6206b4b..aab6206b4b 100644 --- a/src/com/vaadin/tests/book/SSNField.java +++ b/tests/src/com/vaadin/tests/book/SSNField.java diff --git a/src/com/vaadin/tests/book/SelectExample.java b/tests/src/com/vaadin/tests/book/SelectExample.java index f301e85c3f..f301e85c3f 100644 --- a/src/com/vaadin/tests/book/SelectExample.java +++ b/tests/src/com/vaadin/tests/book/SelectExample.java diff --git a/src/com/vaadin/tests/book/TabSheetExample.java b/tests/src/com/vaadin/tests/book/TabSheetExample.java index 9bc3c79823..9bc3c79823 100644 --- a/src/com/vaadin/tests/book/TabSheetExample.java +++ b/tests/src/com/vaadin/tests/book/TabSheetExample.java diff --git a/src/com/vaadin/tests/book/TableCellStyle.java b/tests/src/com/vaadin/tests/book/TableCellStyle.java index 6f66653d79..6f66653d79 100644 --- a/src/com/vaadin/tests/book/TableCellStyle.java +++ b/tests/src/com/vaadin/tests/book/TableCellStyle.java diff --git a/src/com/vaadin/tests/book/TableEditable.java b/tests/src/com/vaadin/tests/book/TableEditable.java index 78a4b808bd..78a4b808bd 100644 --- a/src/com/vaadin/tests/book/TableEditable.java +++ b/tests/src/com/vaadin/tests/book/TableEditable.java diff --git a/src/com/vaadin/tests/book/TableEditableBean.java b/tests/src/com/vaadin/tests/book/TableEditableBean.java index 847ff3e935..847ff3e935 100644 --- a/src/com/vaadin/tests/book/TableEditableBean.java +++ b/tests/src/com/vaadin/tests/book/TableEditableBean.java diff --git a/src/com/vaadin/tests/book/TableExample.java b/tests/src/com/vaadin/tests/book/TableExample.java index a2cbaa45c2..a2cbaa45c2 100644 --- a/src/com/vaadin/tests/book/TableExample.java +++ b/tests/src/com/vaadin/tests/book/TableExample.java diff --git a/src/com/vaadin/tests/book/TableExample1.java b/tests/src/com/vaadin/tests/book/TableExample1.java index 62b189f4ff..62b189f4ff 100644 --- a/src/com/vaadin/tests/book/TableExample1.java +++ b/tests/src/com/vaadin/tests/book/TableExample1.java diff --git a/src/com/vaadin/tests/book/TableExample2.java b/tests/src/com/vaadin/tests/book/TableExample2.java index b2d8b2bc45..b2d8b2bc45 100644 --- a/src/com/vaadin/tests/book/TableExample2.java +++ b/tests/src/com/vaadin/tests/book/TableExample2.java diff --git a/src/com/vaadin/tests/book/TableExample3.java b/tests/src/com/vaadin/tests/book/TableExample3.java index 92ef890c33..92ef890c33 100644 --- a/src/com/vaadin/tests/book/TableExample3.java +++ b/tests/src/com/vaadin/tests/book/TableExample3.java diff --git a/src/com/vaadin/tests/book/TableHuge.java b/tests/src/com/vaadin/tests/book/TableHuge.java index b3828a5a3b..b3828a5a3b 100644 --- a/src/com/vaadin/tests/book/TableHuge.java +++ b/tests/src/com/vaadin/tests/book/TableHuge.java diff --git a/src/com/vaadin/tests/book/TheButton.java b/tests/src/com/vaadin/tests/book/TheButton.java index 716aaa64d7..716aaa64d7 100644 --- a/src/com/vaadin/tests/book/TheButton.java +++ b/tests/src/com/vaadin/tests/book/TheButton.java diff --git a/src/com/vaadin/tests/book/TheButtons.java b/tests/src/com/vaadin/tests/book/TheButtons.java index ed7ef00cc4..ed7ef00cc4 100644 --- a/src/com/vaadin/tests/book/TheButtons.java +++ b/tests/src/com/vaadin/tests/book/TheButtons.java diff --git a/src/com/vaadin/tests/book/TheButtons2.java b/tests/src/com/vaadin/tests/book/TheButtons2.java index c96ed51773..c96ed51773 100644 --- a/src/com/vaadin/tests/book/TheButtons2.java +++ b/tests/src/com/vaadin/tests/book/TheButtons2.java diff --git a/src/com/vaadin/tests/book/TheButtons3.java b/tests/src/com/vaadin/tests/book/TheButtons3.java index 9b77e7855a..9b77e7855a 100644 --- a/src/com/vaadin/tests/book/TheButtons3.java +++ b/tests/src/com/vaadin/tests/book/TheButtons3.java diff --git a/src/com/vaadin/tests/book/WindowOpener.java b/tests/src/com/vaadin/tests/book/WindowOpener.java index f159c48b30..f159c48b30 100644 --- a/src/com/vaadin/tests/book/WindowOpener.java +++ b/tests/src/com/vaadin/tests/book/WindowOpener.java diff --git a/src/com/vaadin/tests/book/WindowTestApplication.java b/tests/src/com/vaadin/tests/book/WindowTestApplication.java index 4e80122b96..4e80122b96 100644 --- a/src/com/vaadin/tests/book/WindowTestApplication.java +++ b/tests/src/com/vaadin/tests/book/WindowTestApplication.java diff --git a/src/com/vaadin/tests/book/images/Earth_small.png b/tests/src/com/vaadin/tests/book/images/Earth_small.png Binary files differindex abe9227914..abe9227914 100644 --- a/src/com/vaadin/tests/book/images/Earth_small.png +++ b/tests/src/com/vaadin/tests/book/images/Earth_small.png diff --git a/src/com/vaadin/tests/book/images/Earth_symbol.png b/tests/src/com/vaadin/tests/book/images/Earth_symbol.png Binary files differindex 6060358883..6060358883 100644 --- a/src/com/vaadin/tests/book/images/Earth_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Earth_symbol.png diff --git a/src/com/vaadin/tests/book/images/Jupiter_symbol.png b/tests/src/com/vaadin/tests/book/images/Jupiter_symbol.png Binary files differindex 7a973bec48..7a973bec48 100644 --- a/src/com/vaadin/tests/book/images/Jupiter_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Jupiter_symbol.png diff --git a/src/com/vaadin/tests/book/images/Mars_symbol.png b/tests/src/com/vaadin/tests/book/images/Mars_symbol.png Binary files differindex 7ab7616c75..7ab7616c75 100644 --- a/src/com/vaadin/tests/book/images/Mars_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Mars_symbol.png diff --git a/src/com/vaadin/tests/book/images/Mercury_small.png b/tests/src/com/vaadin/tests/book/images/Mercury_small.png Binary files differindex ef69931a8f..ef69931a8f 100644 --- a/src/com/vaadin/tests/book/images/Mercury_small.png +++ b/tests/src/com/vaadin/tests/book/images/Mercury_small.png diff --git a/src/com/vaadin/tests/book/images/Mercury_symbol.png b/tests/src/com/vaadin/tests/book/images/Mercury_symbol.png Binary files differindex 97c09d1b29..97c09d1b29 100644 --- a/src/com/vaadin/tests/book/images/Mercury_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Mercury_symbol.png diff --git a/src/com/vaadin/tests/book/images/Neptune_symbol.png b/tests/src/com/vaadin/tests/book/images/Neptune_symbol.png Binary files differindex 2b84811c80..2b84811c80 100644 --- a/src/com/vaadin/tests/book/images/Neptune_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Neptune_symbol.png diff --git a/src/com/vaadin/tests/book/images/Saturn_symbol.png b/tests/src/com/vaadin/tests/book/images/Saturn_symbol.png Binary files differindex f4b7e5c6ca..f4b7e5c6ca 100644 --- a/src/com/vaadin/tests/book/images/Saturn_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Saturn_symbol.png diff --git a/src/com/vaadin/tests/book/images/Uranus_symbol.png b/tests/src/com/vaadin/tests/book/images/Uranus_symbol.png Binary files differindex 74f755fb97..74f755fb97 100644 --- a/src/com/vaadin/tests/book/images/Uranus_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Uranus_symbol.png diff --git a/src/com/vaadin/tests/book/images/Venus_small.png b/tests/src/com/vaadin/tests/book/images/Venus_small.png Binary files differindex 7bcac3fa4f..7bcac3fa4f 100644 --- a/src/com/vaadin/tests/book/images/Venus_small.png +++ b/tests/src/com/vaadin/tests/book/images/Venus_small.png diff --git a/src/com/vaadin/tests/book/images/Venus_symbol.png b/tests/src/com/vaadin/tests/book/images/Venus_symbol.png Binary files differindex 6d08313e5d..6d08313e5d 100644 --- a/src/com/vaadin/tests/book/images/Venus_symbol.png +++ b/tests/src/com/vaadin/tests/book/images/Venus_symbol.png diff --git a/src/com/vaadin/tests/book/smiley.jpg b/tests/src/com/vaadin/tests/book/smiley.jpg Binary files differindex dc1a399c76..dc1a399c76 100644 --- a/src/com/vaadin/tests/book/smiley.jpg +++ b/tests/src/com/vaadin/tests/book/smiley.jpg diff --git a/src/com/vaadin/tests/components/AbstractTestCase.java b/tests/src/com/vaadin/tests/components/AbstractTestCase.java index 6653f0ca7f..6653f0ca7f 100644 --- a/src/com/vaadin/tests/components/AbstractTestCase.java +++ b/tests/src/com/vaadin/tests/components/AbstractTestCase.java diff --git a/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java b/tests/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java index 6b3daae539..6b3daae539 100644 --- a/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java +++ b/tests/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java diff --git a/src/com/vaadin/tests/components/HierarchicalContainerSorting.java b/tests/src/com/vaadin/tests/components/HierarchicalContainerSorting.java index 6f1352f164..6f1352f164 100644 --- a/src/com/vaadin/tests/components/HierarchicalContainerSorting.java +++ b/tests/src/com/vaadin/tests/components/HierarchicalContainerSorting.java diff --git a/src/com/vaadin/tests/components/MultipleDebugIds.java b/tests/src/com/vaadin/tests/components/MultipleDebugIds.java index ebfa29b9e9..ebfa29b9e9 100644 --- a/src/com/vaadin/tests/components/MultipleDebugIds.java +++ b/tests/src/com/vaadin/tests/components/MultipleDebugIds.java diff --git a/src/com/vaadin/tests/components/TestBase.java b/tests/src/com/vaadin/tests/components/TestBase.java index 62368d1525..62368d1525 100644 --- a/src/com/vaadin/tests/components/TestBase.java +++ b/tests/src/com/vaadin/tests/components/TestBase.java diff --git a/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.html b/tests/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.html index ff5c890abf..ff5c890abf 100644 --- a/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.html +++ b/tests/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.html diff --git a/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.java b/tests/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.java index f6bff579a3..f6bff579a3 100644 --- a/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.java +++ b/tests/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.java diff --git a/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html index ef2c784e15..ef2c784e15 100644 --- a/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html +++ b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html diff --git a/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java index 69705d4143..69705d4143 100644 --- a/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java +++ b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java diff --git a/src/com/vaadin/tests/components/accordion/AccordionInactiveTabSize.java b/tests/src/com/vaadin/tests/components/accordion/AccordionInactiveTabSize.java index c0172cfee0..c0172cfee0 100644 --- a/src/com/vaadin/tests/components/accordion/AccordionInactiveTabSize.java +++ b/tests/src/com/vaadin/tests/components/accordion/AccordionInactiveTabSize.java diff --git a/src/com/vaadin/tests/components/accordion/RemoveTabs.html b/tests/src/com/vaadin/tests/components/accordion/RemoveTabs.html index ec24ade8ce..ec24ade8ce 100644 --- a/src/com/vaadin/tests/components/accordion/RemoveTabs.html +++ b/tests/src/com/vaadin/tests/components/accordion/RemoveTabs.html diff --git a/src/com/vaadin/tests/components/accordion/RemoveTabs.java b/tests/src/com/vaadin/tests/components/accordion/RemoveTabs.java index a345ad61a2..a345ad61a2 100644 --- a/src/com/vaadin/tests/components/accordion/RemoveTabs.java +++ b/tests/src/com/vaadin/tests/components/accordion/RemoveTabs.java diff --git a/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java b/tests/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java index 5a42599005..5a42599005 100644 --- a/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java +++ b/tests/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java diff --git a/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java b/tests/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java index 15f292a6ca..15f292a6ca 100644 --- a/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java +++ b/tests/src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java diff --git a/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.html b/tests/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.html index a37e8ea662..a37e8ea662 100644 --- a/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.html +++ b/tests/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.html diff --git a/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java b/tests/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java index 20becea974..20becea974 100644 --- a/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java +++ b/tests/src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java diff --git a/src/com/vaadin/tests/components/button/ButtonErrorMessage.java b/tests/src/com/vaadin/tests/components/button/ButtonErrorMessage.java index b543c69c51..b543c69c51 100644 --- a/src/com/vaadin/tests/components/button/ButtonErrorMessage.java +++ b/tests/src/com/vaadin/tests/components/button/ButtonErrorMessage.java diff --git a/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.html b/tests/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.html index 16d18d2e50..16d18d2e50 100644 --- a/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.html +++ b/tests/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.html diff --git a/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.java b/tests/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.java index 852e41bd05..852e41bd05 100644 --- a/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.java +++ b/tests/src/com/vaadin/tests/components/button/ButtonUndefinedWidth.java diff --git a/src/com/vaadin/tests/components/button/DisabledButtons.html b/tests/src/com/vaadin/tests/components/button/DisabledButtons.html index 65584fd4d0..65584fd4d0 100644 --- a/src/com/vaadin/tests/components/button/DisabledButtons.html +++ b/tests/src/com/vaadin/tests/components/button/DisabledButtons.html diff --git a/src/com/vaadin/tests/components/button/DisabledButtons.java b/tests/src/com/vaadin/tests/components/button/DisabledButtons.java index 3e438a5d5b..3e438a5d5b 100644 --- a/src/com/vaadin/tests/components/button/DisabledButtons.java +++ b/tests/src/com/vaadin/tests/components/button/DisabledButtons.java diff --git a/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.html b/tests/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.html index a05b439759..a05b439759 100644 --- a/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.html +++ b/tests/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.html diff --git a/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.java b/tests/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.java index c6a0ae96a9..c6a0ae96a9 100644 --- a/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.java +++ b/tests/src/com/vaadin/tests/components/button/IE7ButtonWithIcon.java diff --git a/src/com/vaadin/tests/components/button/TooltipForDisabledButton.java b/tests/src/com/vaadin/tests/components/button/TooltipForDisabledButton.java index 3fed5b9c02..3fed5b9c02 100644 --- a/src/com/vaadin/tests/components/button/TooltipForDisabledButton.java +++ b/tests/src/com/vaadin/tests/components/button/TooltipForDisabledButton.java diff --git a/src/com/vaadin/tests/components/caption/LargeCaptionIcon.html b/tests/src/com/vaadin/tests/components/caption/LargeCaptionIcon.html index d2928cf4c3..d2928cf4c3 100644 --- a/src/com/vaadin/tests/components/caption/LargeCaptionIcon.html +++ b/tests/src/com/vaadin/tests/components/caption/LargeCaptionIcon.html diff --git a/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java b/tests/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java index 0ff82e9847..0ff82e9847 100644 --- a/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java +++ b/tests/src/com/vaadin/tests/components/caption/LargeCaptionIcon.java diff --git a/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.html b/tests/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.html index 26ecc95721..26ecc95721 100644 --- a/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.html +++ b/tests/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.html diff --git a/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.java b/tests/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.java index 540af083c4..540af083c4 100644 --- a/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.java +++ b/tests/src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.java diff --git a/src/com/vaadin/tests/components/checkbox/CheckboxIcon.java b/tests/src/com/vaadin/tests/components/checkbox/CheckboxIcon.java index 1f96a05084..1f96a05084 100644 --- a/src/com/vaadin/tests/components/checkbox/CheckboxIcon.java +++ b/tests/src/com/vaadin/tests/components/checkbox/CheckboxIcon.java diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java index 9636af0284..9636af0284 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html index 447000d6d7..447000d6d7 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java index 4800316a5a..4800316a5a 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java index 1992c12943..1992c12943 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.html b/tests/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.html index 1f1248fce8..1f1248fce8 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.html +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.html diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.java index 245fc123df..245fc123df 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxNavigation.java diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.html b/tests/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.html index 2aab40f13f..2aab40f13f 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.html +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.html diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java index c91a707859..c91a707859 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java diff --git a/src/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java b/tests/src/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java index 75cefe9360..75cefe9360 100644 --- a/src/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java diff --git a/src/com/vaadin/tests/components/combobox/ComboxBoxErrorMessage.java b/tests/src/com/vaadin/tests/components/combobox/ComboxBoxErrorMessage.java index a6eaf7d3e6..a6eaf7d3e6 100644 --- a/src/com/vaadin/tests/components/combobox/ComboxBoxErrorMessage.java +++ b/tests/src/com/vaadin/tests/components/combobox/ComboxBoxErrorMessage.java diff --git a/src/com/vaadin/tests/components/combobox/fi.gif b/tests/src/com/vaadin/tests/components/combobox/fi.gif Binary files differindex 8d3a191828..8d3a191828 100755 --- a/src/com/vaadin/tests/components/combobox/fi.gif +++ b/tests/src/com/vaadin/tests/components/combobox/fi.gif diff --git a/src/com/vaadin/tests/components/combobox/se.gif b/tests/src/com/vaadin/tests/components/combobox/se.gif Binary files differindex 80f6285228..80f6285228 100755 --- a/src/com/vaadin/tests/components/combobox/se.gif +++ b/tests/src/com/vaadin/tests/components/combobox/se.gif diff --git a/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html b/tests/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html index af711b9ab8..af711b9ab8 100644 --- a/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html +++ b/tests/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html diff --git a/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.java b/tests/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.java index ae31d25190..ae31d25190 100644 --- a/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.java +++ b/tests/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.java diff --git a/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth b/tests/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth index 48b11e1f7c..48b11e1f7c 100644 --- a/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth +++ b/tests/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth diff --git a/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java b/tests/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java index 3f26e106ee..3f26e106ee 100644 --- a/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java +++ b/tests/src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java diff --git a/src/com/vaadin/tests/components/datefield/TestDatefieldYear.html b/tests/src/com/vaadin/tests/components/datefield/TestDatefieldYear.html index 9ecb803ab0..9ecb803ab0 100644 --- a/src/com/vaadin/tests/components/datefield/TestDatefieldYear.html +++ b/tests/src/com/vaadin/tests/components/datefield/TestDatefieldYear.html diff --git a/src/com/vaadin/tests/components/datefield/TestDatefieldYear.java b/tests/src/com/vaadin/tests/components/datefield/TestDatefieldYear.java index fb1a1934c2..fb1a1934c2 100644 --- a/src/com/vaadin/tests/components/datefield/TestDatefieldYear.java +++ b/tests/src/com/vaadin/tests/components/datefield/TestDatefieldYear.java diff --git a/src/com/vaadin/tests/components/embedded/EmbeddedFlash.java b/tests/src/com/vaadin/tests/components/embedded/EmbeddedFlash.java index 87e0714545..87e0714545 100644 --- a/src/com/vaadin/tests/components/embedded/EmbeddedFlash.java +++ b/tests/src/com/vaadin/tests/components/embedded/EmbeddedFlash.java diff --git a/src/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java b/tests/src/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java index e2b4ca5a2e..e2b4ca5a2e 100644 --- a/src/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java +++ b/tests/src/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java diff --git a/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java b/tests/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java index 37dbacb830..37dbacb830 100644 --- a/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java +++ b/tests/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java diff --git a/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html b/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html index b0305e60dc..b0305e60dc 100644 --- a/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html +++ b/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html diff --git a/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java b/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java index 6431e0aeb1..6431e0aeb1 100644 --- a/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java +++ b/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java diff --git a/src/com/vaadin/tests/components/form/FormNotGettingSmaller.java b/tests/src/com/vaadin/tests/components/form/FormNotGettingSmaller.java index 1cf21126a0..1cf21126a0 100644 --- a/src/com/vaadin/tests/components/form/FormNotGettingSmaller.java +++ b/tests/src/com/vaadin/tests/components/form/FormNotGettingSmaller.java diff --git a/src/com/vaadin/tests/components/form/FormRenderingFlicker.java b/tests/src/com/vaadin/tests/components/form/FormRenderingFlicker.java index 6956eee017..6956eee017 100644 --- a/src/com/vaadin/tests/components/form/FormRenderingFlicker.java +++ b/tests/src/com/vaadin/tests/components/form/FormRenderingFlicker.java diff --git a/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.html b/tests/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.html index 667f08ba4f..667f08ba4f 100644 --- a/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.html +++ b/tests/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.html diff --git a/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java b/tests/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java index d494ac176e..d494ac176e 100644 --- a/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java +++ b/tests/src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java diff --git a/src/com/vaadin/tests/components/label/LabelWrapping.html b/tests/src/com/vaadin/tests/components/label/LabelWrapping.html index b8038a75b4..b8038a75b4 100644 --- a/src/com/vaadin/tests/components/label/LabelWrapping.html +++ b/tests/src/com/vaadin/tests/components/label/LabelWrapping.html diff --git a/src/com/vaadin/tests/components/label/LabelWrapping.java b/tests/src/com/vaadin/tests/components/label/LabelWrapping.java index d702f2440d..d702f2440d 100644 --- a/src/com/vaadin/tests/components/label/LabelWrapping.java +++ b/tests/src/com/vaadin/tests/components/label/LabelWrapping.java diff --git a/src/com/vaadin/tests/components/link/LinkIcon.java b/tests/src/com/vaadin/tests/components/link/LinkIcon.java index 372417a45c..372417a45c 100644 --- a/src/com/vaadin/tests/components/link/LinkIcon.java +++ b/tests/src/com/vaadin/tests/components/link/LinkIcon.java diff --git a/src/com/vaadin/tests/components/link/LinkTargetSize.java b/tests/src/com/vaadin/tests/components/link/LinkTargetSize.java index d5542cab04..d5542cab04 100644 --- a/src/com/vaadin/tests/components/link/LinkTargetSize.java +++ b/tests/src/com/vaadin/tests/components/link/LinkTargetSize.java diff --git a/src/com/vaadin/tests/components/loginform/LoginFormTest.java b/tests/src/com/vaadin/tests/components/loginform/LoginFormTest.java index f8e8b96f62..f8e8b96f62 100644 --- a/src/com/vaadin/tests/components/loginform/LoginFormTest.java +++ b/tests/src/com/vaadin/tests/components/loginform/LoginFormTest.java diff --git a/src/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java b/tests/src/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java index ccb5b10c08..ccb5b10c08 100644 --- a/src/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java +++ b/tests/src/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java diff --git a/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.html b/tests/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.html index 7a071030dc..7a071030dc 100644 --- a/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.html +++ b/tests/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.html diff --git a/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java b/tests/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java index c081382ee1..c081382ee1 100644 --- a/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java +++ b/tests/src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java diff --git a/src/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java b/tests/src/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java index 982cbced5b..982cbced5b 100644 --- a/src/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java +++ b/tests/src/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java diff --git a/src/com/vaadin/tests/components/popupview/PopupViewLabelResized.java b/tests/src/com/vaadin/tests/components/popupview/PopupViewLabelResized.java index 52bdd47790..52bdd47790 100644 --- a/src/com/vaadin/tests/components/popupview/PopupViewLabelResized.java +++ b/tests/src/com/vaadin/tests/components/popupview/PopupViewLabelResized.java diff --git a/src/com/vaadin/tests/components/popupview/PopupViewNullValues.java b/tests/src/com/vaadin/tests/components/popupview/PopupViewNullValues.java index 30fa028c40..30fa028c40 100644 --- a/src/com/vaadin/tests/components/popupview/PopupViewNullValues.java +++ b/tests/src/com/vaadin/tests/components/popupview/PopupViewNullValues.java diff --git a/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.html b/tests/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.html index 99ee864179..99ee864179 100644 --- a/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.html +++ b/tests/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.html diff --git a/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.java b/tests/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.java index 194c76d9df..194c76d9df 100644 --- a/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.java +++ b/tests/src/com/vaadin/tests/components/popupview/PopupViewOffScreen.java diff --git a/src/com/vaadin/tests/components/popupview/PopupViewWithRTE.java b/tests/src/com/vaadin/tests/components/popupview/PopupViewWithRTE.java index 06319a5019..06319a5019 100644 --- a/src/com/vaadin/tests/components/popupview/PopupViewWithRTE.java +++ b/tests/src/com/vaadin/tests/components/popupview/PopupViewWithRTE.java diff --git a/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.html b/tests/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.html index 7708c88e54..7708c88e54 100644 --- a/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.html +++ b/tests/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.html diff --git a/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.java b/tests/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.java index ce8dcb4df8..ce8dcb4df8 100644 --- a/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.java +++ b/tests/src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.java diff --git a/src/com/vaadin/tests/components/select/NullSelectionItemId.java b/tests/src/com/vaadin/tests/components/select/NullSelectionItemId.java index f42995a601..f42995a601 100644 --- a/src/com/vaadin/tests/components/select/NullSelectionItemId.java +++ b/tests/src/com/vaadin/tests/components/select/NullSelectionItemId.java diff --git a/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.html b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.html index e8e7395198..e8e7395198 100644 --- a/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.html +++ b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.html diff --git a/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java index 9d9800eeaf..9d9800eeaf 100644 --- a/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java +++ b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java diff --git a/src/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java index 89008754ba..89008754ba 100644 --- a/src/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java +++ b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java diff --git a/src/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java index b49131b94f..b49131b94f 100644 --- a/src/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java +++ b/tests/src/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java diff --git a/src/com/vaadin/tests/components/table/ClippedComponentsInTable.html b/tests/src/com/vaadin/tests/components/table/ClippedComponentsInTable.html index 4a6ccbbe2d..4a6ccbbe2d 100644 --- a/src/com/vaadin/tests/components/table/ClippedComponentsInTable.html +++ b/tests/src/com/vaadin/tests/components/table/ClippedComponentsInTable.html diff --git a/src/com/vaadin/tests/components/table/ClippedComponentsInTable.java b/tests/src/com/vaadin/tests/components/table/ClippedComponentsInTable.java index 8b6775cc74..8b6775cc74 100644 --- a/src/com/vaadin/tests/components/table/ClippedComponentsInTable.java +++ b/tests/src/com/vaadin/tests/components/table/ClippedComponentsInTable.java diff --git a/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.html b/tests/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.html index 9e529836b6..9e529836b6 100644 --- a/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.html +++ b/tests/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.html diff --git a/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java b/tests/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java index 11a111acf8..11a111acf8 100644 --- a/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java +++ b/tests/src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java diff --git a/src/com/vaadin/tests/components/table/ColumnExpandRatio.html b/tests/src/com/vaadin/tests/components/table/ColumnExpandRatio.html index 6d5422831e..6d5422831e 100644 --- a/src/com/vaadin/tests/components/table/ColumnExpandRatio.html +++ b/tests/src/com/vaadin/tests/components/table/ColumnExpandRatio.html diff --git a/src/com/vaadin/tests/components/table/ColumnExpandRatio.java b/tests/src/com/vaadin/tests/components/table/ColumnExpandRatio.java index be176d83fa..be176d83fa 100644 --- a/src/com/vaadin/tests/components/table/ColumnExpandRatio.java +++ b/tests/src/com/vaadin/tests/components/table/ColumnExpandRatio.java diff --git a/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.html b/tests/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.html index eb338c8dde..eb338c8dde 100644 --- a/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.html +++ b/tests/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.html diff --git a/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.java b/tests/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.java index f0c3779a4e..f0c3779a4e 100644 --- a/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.java +++ b/tests/src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.java diff --git a/src/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java b/tests/src/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java index d3dfa61ceb..d3dfa61ceb 100644 --- a/src/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java +++ b/tests/src/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java diff --git a/src/com/vaadin/tests/components/table/ColumnWidths.java b/tests/src/com/vaadin/tests/components/table/ColumnWidths.java index 9fe7a98179..9fe7a98179 100644 --- a/src/com/vaadin/tests/components/table/ColumnWidths.java +++ b/tests/src/com/vaadin/tests/components/table/ColumnWidths.java diff --git a/src/com/vaadin/tests/components/table/ContainerSizeChange.html b/tests/src/com/vaadin/tests/components/table/ContainerSizeChange.html index 7c2374f322..7c2374f322 100644 --- a/src/com/vaadin/tests/components/table/ContainerSizeChange.html +++ b/tests/src/com/vaadin/tests/components/table/ContainerSizeChange.html diff --git a/src/com/vaadin/tests/components/table/ContainerSizeChange.java b/tests/src/com/vaadin/tests/components/table/ContainerSizeChange.java index 567cde8a54..567cde8a54 100644 --- a/src/com/vaadin/tests/components/table/ContainerSizeChange.java +++ b/tests/src/com/vaadin/tests/components/table/ContainerSizeChange.java diff --git a/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html b/tests/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html index e8dccea4e7..e8dccea4e7 100644 --- a/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html +++ b/tests/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html diff --git a/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java b/tests/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java index dc6cf53de7..dc6cf53de7 100644 --- a/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java +++ b/tests/src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java diff --git a/src/com/vaadin/tests/components/table/MissingScrollbar.html b/tests/src/com/vaadin/tests/components/table/MissingScrollbar.html index dfea329e60..dfea329e60 100644 --- a/src/com/vaadin/tests/components/table/MissingScrollbar.html +++ b/tests/src/com/vaadin/tests/components/table/MissingScrollbar.html diff --git a/src/com/vaadin/tests/components/table/MissingScrollbar.java b/tests/src/com/vaadin/tests/components/table/MissingScrollbar.java index 26ad70e79b..26ad70e79b 100644 --- a/src/com/vaadin/tests/components/table/MissingScrollbar.java +++ b/tests/src/com/vaadin/tests/components/table/MissingScrollbar.java diff --git a/src/com/vaadin/tests/components/table/ModifyContainerProperty.java b/tests/src/com/vaadin/tests/components/table/ModifyContainerProperty.java index 0038e7f083..0038e7f083 100644 --- a/src/com/vaadin/tests/components/table/ModifyContainerProperty.java +++ b/tests/src/com/vaadin/tests/components/table/ModifyContainerProperty.java diff --git a/src/com/vaadin/tests/components/table/NotselectablePaintSelections.java b/tests/src/com/vaadin/tests/components/table/NotselectablePaintSelections.java index 9d3011365d..9d3011365d 100644 --- a/src/com/vaadin/tests/components/table/NotselectablePaintSelections.java +++ b/tests/src/com/vaadin/tests/components/table/NotselectablePaintSelections.java diff --git a/src/com/vaadin/tests/components/table/PropertyValueChange.html b/tests/src/com/vaadin/tests/components/table/PropertyValueChange.html index 41f97ebb61..41f97ebb61 100644 --- a/src/com/vaadin/tests/components/table/PropertyValueChange.html +++ b/tests/src/com/vaadin/tests/components/table/PropertyValueChange.html diff --git a/src/com/vaadin/tests/components/table/PropertyValueChange.java b/tests/src/com/vaadin/tests/components/table/PropertyValueChange.java index 353d2f13ef..353d2f13ef 100644 --- a/src/com/vaadin/tests/components/table/PropertyValueChange.java +++ b/tests/src/com/vaadin/tests/components/table/PropertyValueChange.java diff --git a/src/com/vaadin/tests/components/table/RowAdditionTest.java b/tests/src/com/vaadin/tests/components/table/RowAdditionTest.java index 9b600eff7a..9b600eff7a 100644 --- a/src/com/vaadin/tests/components/table/RowAdditionTest.java +++ b/tests/src/com/vaadin/tests/components/table/RowAdditionTest.java diff --git a/src/com/vaadin/tests/components/table/TableItemIcon.java b/tests/src/com/vaadin/tests/components/table/TableItemIcon.java index b8a6733e83..b8a6733e83 100644 --- a/src/com/vaadin/tests/components/table/TableItemIcon.java +++ b/tests/src/com/vaadin/tests/components/table/TableItemIcon.java diff --git a/src/com/vaadin/tests/components/table/TableLastRowMissing.html b/tests/src/com/vaadin/tests/components/table/TableLastRowMissing.html index ca8ee6d6a4..ca8ee6d6a4 100644 --- a/src/com/vaadin/tests/components/table/TableLastRowMissing.html +++ b/tests/src/com/vaadin/tests/components/table/TableLastRowMissing.html diff --git a/src/com/vaadin/tests/components/table/TableLastRowMissing.java b/tests/src/com/vaadin/tests/components/table/TableLastRowMissing.java index 4e4a223e23..4e4a223e23 100644 --- a/src/com/vaadin/tests/components/table/TableLastRowMissing.java +++ b/tests/src/com/vaadin/tests/components/table/TableLastRowMissing.java diff --git a/src/com/vaadin/tests/components/table/TablePageLengthUpdate.html b/tests/src/com/vaadin/tests/components/table/TablePageLengthUpdate.html index fe5887634f..fe5887634f 100644 --- a/src/com/vaadin/tests/components/table/TablePageLengthUpdate.html +++ b/tests/src/com/vaadin/tests/components/table/TablePageLengthUpdate.html diff --git a/src/com/vaadin/tests/components/table/TablePageLengthUpdate.java b/tests/src/com/vaadin/tests/components/table/TablePageLengthUpdate.java index 8906b8e835..8906b8e835 100644 --- a/src/com/vaadin/tests/components/table/TablePageLengthUpdate.java +++ b/tests/src/com/vaadin/tests/components/table/TablePageLengthUpdate.java diff --git a/src/com/vaadin/tests/components/table/TableRowHeight.html b/tests/src/com/vaadin/tests/components/table/TableRowHeight.html index a28df6329f..a28df6329f 100644 --- a/src/com/vaadin/tests/components/table/TableRowHeight.html +++ b/tests/src/com/vaadin/tests/components/table/TableRowHeight.html diff --git a/src/com/vaadin/tests/components/table/TableRowHeight.java b/tests/src/com/vaadin/tests/components/table/TableRowHeight.java index 7e51226094..7e51226094 100644 --- a/src/com/vaadin/tests/components/table/TableRowHeight.java +++ b/tests/src/com/vaadin/tests/components/table/TableRowHeight.java diff --git a/src/com/vaadin/tests/components/table/TableRowHeight2.html b/tests/src/com/vaadin/tests/components/table/TableRowHeight2.html index bd83c1d9dc..bd83c1d9dc 100644 --- a/src/com/vaadin/tests/components/table/TableRowHeight2.html +++ b/tests/src/com/vaadin/tests/components/table/TableRowHeight2.html diff --git a/src/com/vaadin/tests/components/table/TableRowHeight2.java b/tests/src/com/vaadin/tests/components/table/TableRowHeight2.java index 2c9d75808b..2c9d75808b 100644 --- a/src/com/vaadin/tests/components/table/TableRowHeight2.java +++ b/tests/src/com/vaadin/tests/components/table/TableRowHeight2.java diff --git a/src/com/vaadin/tests/components/table/TableRowHeight3.html b/tests/src/com/vaadin/tests/components/table/TableRowHeight3.html index 2aa90085e4..2aa90085e4 100644 --- a/src/com/vaadin/tests/components/table/TableRowHeight3.html +++ b/tests/src/com/vaadin/tests/components/table/TableRowHeight3.html diff --git a/src/com/vaadin/tests/components/table/TableRowHeight3.java b/tests/src/com/vaadin/tests/components/table/TableRowHeight3.java index d0b7afe94c..d0b7afe94c 100644 --- a/src/com/vaadin/tests/components/table/TableRowHeight3.java +++ b/tests/src/com/vaadin/tests/components/table/TableRowHeight3.java diff --git a/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.html b/tests/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.html index 05325cb9e6..05325cb9e6 100644 --- a/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.html +++ b/tests/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.html diff --git a/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java b/tests/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java index 8f7f781684..8f7f781684 100644 --- a/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java +++ b/tests/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java diff --git a/src/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java b/tests/src/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java index d74c3b7238..d74c3b7238 100644 --- a/src/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java +++ b/tests/src/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java diff --git a/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html b/tests/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html index 5b5ea40168..5b5ea40168 100644 --- a/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html +++ b/tests/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html diff --git a/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java b/tests/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java index b3c75ea06d..b3c75ea06d 100644 --- a/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java +++ b/tests/src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java diff --git a/src/com/vaadin/tests/components/table/fi.gif b/tests/src/com/vaadin/tests/components/table/fi.gif Binary files differindex 8d3a191828..8d3a191828 100755 --- a/src/com/vaadin/tests/components/table/fi.gif +++ b/tests/src/com/vaadin/tests/components/table/fi.gif diff --git a/src/com/vaadin/tests/components/table/se.gif b/tests/src/com/vaadin/tests/components/table/se.gif Binary files differindex 80f6285228..80f6285228 100755 --- a/src/com/vaadin/tests/components/table/se.gif +++ b/tests/src/com/vaadin/tests/components/table/se.gif diff --git a/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.html b/tests/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.html index e919454fc2..e919454fc2 100644 --- a/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.html diff --git a/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java b/tests/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java index 44859fb511..44859fb511 100644 --- a/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java diff --git a/src/com/vaadin/tests/components/tabsheet/PreventTabChange.html b/tests/src/com/vaadin/tests/components/tabsheet/PreventTabChange.html index c4f5998f47..c4f5998f47 100644 --- a/src/com/vaadin/tests/components/tabsheet/PreventTabChange.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/PreventTabChange.html diff --git a/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java b/tests/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java index f1faecb711..f1faecb711 100644 --- a/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/PreventTabChange.java diff --git a/src/com/vaadin/tests/components/tabsheet/RemoveTabs.java b/tests/src/com/vaadin/tests/components/tabsheet/RemoveTabs.java index c2f8af8454..c2f8af8454 100644 --- a/src/com/vaadin/tests/components/tabsheet/RemoveTabs.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/RemoveTabs.java diff --git a/src/com/vaadin/tests/components/tabsheet/RemoveTabsTabsheet.html b/tests/src/com/vaadin/tests/components/tabsheet/RemoveTabsTabsheet.html index 18fa4705ce..18fa4705ce 100644 --- a/src/com/vaadin/tests/components/tabsheet/RemoveTabsTabsheet.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/RemoveTabsTabsheet.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.html b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.html index d240d4b419..d240d4b419 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java index 699988489f..699988489f 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.html b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.html index bc03f7687b..bc03f7687b 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java index 612960f2cf..612960f2cf 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html index 425da11af4..425da11af4 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java index 49c9784eb9..49c9784eb9 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.html b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.html index 36e85c1b37..36e85c1b37 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.java b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.java index d766277b48..d766277b48 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.java diff --git a/src/com/vaadin/tests/components/tabsheet/TabsheetNPE.java b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetNPE.java index a9ebd2dfa0..a9ebd2dfa0 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabsheetNPE.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetNPE.java diff --git a/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.html b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.html index 16657e27c4..16657e27c4 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java index 718a10aadd..718a10aadd 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java diff --git a/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html index c476374a70..c476374a70 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html diff --git a/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java index 18934e9318..18934e9318 100644 --- a/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java diff --git a/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.html b/tests/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.html index 3da03edb6a..3da03edb6a 100644 --- a/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.html +++ b/tests/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.html diff --git a/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java b/tests/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java index a94aa1cd47..a94aa1cd47 100644 --- a/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java +++ b/tests/src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java diff --git a/src/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java b/tests/src/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java index bf9924cdbb..bf9924cdbb 100644 --- a/src/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java +++ b/tests/src/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java diff --git a/src/com/vaadin/tests/components/textfield/IE6Cursor.java b/tests/src/com/vaadin/tests/components/textfield/IE6Cursor.java index aee56dd7ee..aee56dd7ee 100644 --- a/src/com/vaadin/tests/components/textfield/IE6Cursor.java +++ b/tests/src/com/vaadin/tests/components/textfield/IE6Cursor.java diff --git a/src/com/vaadin/tests/components/textfield/TextFields.html b/tests/src/com/vaadin/tests/components/textfield/TextFields.html index 4b6f845b7c..4b6f845b7c 100644 --- a/src/com/vaadin/tests/components/textfield/TextFields.html +++ b/tests/src/com/vaadin/tests/components/textfield/TextFields.html diff --git a/src/com/vaadin/tests/components/textfield/TextFields.java b/tests/src/com/vaadin/tests/components/textfield/TextFields.java index 7b7c3b3415..7b7c3b3415 100644 --- a/src/com/vaadin/tests/components/textfield/TextFields.java +++ b/tests/src/com/vaadin/tests/components/textfield/TextFields.java diff --git a/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.html b/tests/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.html index f98482f4c7..f98482f4c7 100644 --- a/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.html +++ b/tests/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.html diff --git a/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java b/tests/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java index 2101abb630..2101abb630 100644 --- a/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java +++ b/tests/src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java diff --git a/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.html b/tests/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.html index 2e15d8d645..2e15d8d645 100644 --- a/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.html +++ b/tests/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.html diff --git a/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.java b/tests/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.java index 51b6568f94..51b6568f94 100644 --- a/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.java +++ b/tests/src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.java diff --git a/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.html b/tests/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.html index d74e09dd6a..d74e09dd6a 100644 --- a/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.html +++ b/tests/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.html diff --git a/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.java b/tests/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.java index f1ef0069c9..f1ef0069c9 100644 --- a/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.java +++ b/tests/src/com/vaadin/tests/components/window/EmbeddedInSubWindow.java diff --git a/src/com/vaadin/tests/components/window/FullSizedWindow.java b/tests/src/com/vaadin/tests/components/window/FullSizedWindow.java index 3cb5f45712..3cb5f45712 100644 --- a/src/com/vaadin/tests/components/window/FullSizedWindow.java +++ b/tests/src/com/vaadin/tests/components/window/FullSizedWindow.java diff --git a/src/com/vaadin/tests/components/window/SubWindowOrder.java b/tests/src/com/vaadin/tests/components/window/SubWindowOrder.java index ca0d4e662e..ca0d4e662e 100644 --- a/src/com/vaadin/tests/components/window/SubWindowOrder.java +++ b/tests/src/com/vaadin/tests/components/window/SubWindowOrder.java diff --git a/src/com/vaadin/tests/components/window/SubwindowInvalidLayout.java b/tests/src/com/vaadin/tests/components/window/SubwindowInvalidLayout.java index aeab7f6c97..aeab7f6c97 100644 --- a/src/com/vaadin/tests/components/window/SubwindowInvalidLayout.java +++ b/tests/src/com/vaadin/tests/components/window/SubwindowInvalidLayout.java diff --git a/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.html b/tests/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.html index f926696d63..f926696d63 100644 --- a/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.html +++ b/tests/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.html diff --git a/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.java b/tests/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.java index 859c1b4b5d..859c1b4b5d 100644 --- a/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.java +++ b/tests/src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.java diff --git a/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.html b/tests/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.html index 68bb3c5f2d..68bb3c5f2d 100644 --- a/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.html +++ b/tests/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.html diff --git a/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.java b/tests/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.java index c8009c8431..c8009c8431 100644 --- a/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.java +++ b/tests/src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.java diff --git a/src/com/vaadin/tests/components/window/WindowResizeListener.java b/tests/src/com/vaadin/tests/components/window/WindowResizeListener.java index 0ba87336f6..0ba87336f6 100644 --- a/src/com/vaadin/tests/components/window/WindowResizeListener.java +++ b/tests/src/com/vaadin/tests/components/window/WindowResizeListener.java diff --git a/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.html b/tests/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.html index 4923bff58a..4923bff58a 100644 --- a/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.html +++ b/tests/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.html diff --git a/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java b/tests/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java index d61deffef8..d61deffef8 100644 --- a/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java +++ b/tests/src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java diff --git a/src/com/vaadin/tests/components/window/WindowStyleNames.java b/tests/src/com/vaadin/tests/components/window/WindowStyleNames.java index 3a36926b42..3a36926b42 100644 --- a/src/com/vaadin/tests/components/window/WindowStyleNames.java +++ b/tests/src/com/vaadin/tests/components/window/WindowStyleNames.java diff --git a/src/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/tests/src/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java index e4b65d5676..e4b65d5676 100644 --- a/src/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java +++ b/tests/src/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java diff --git a/src/com/vaadin/tests/containers/BeanItemContainerTest.java b/tests/src/com/vaadin/tests/containers/BeanItemContainerTest.java index 905ec2f9ff..905ec2f9ff 100644 --- a/src/com/vaadin/tests/containers/BeanItemContainerTest.java +++ b/tests/src/com/vaadin/tests/containers/BeanItemContainerTest.java diff --git a/src/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/tests/src/com/vaadin/tests/containers/IndexedContainerFilteringTest.java index d66435bdaa..d66435bdaa 100644 --- a/src/com/vaadin/tests/containers/IndexedContainerFilteringTest.java +++ b/tests/src/com/vaadin/tests/containers/IndexedContainerFilteringTest.java diff --git a/src/com/vaadin/tests/featurebrowser/Feature.java b/tests/src/com/vaadin/tests/featurebrowser/Feature.java index f3335f8e24..f3335f8e24 100644 --- a/src/com/vaadin/tests/featurebrowser/Feature.java +++ b/tests/src/com/vaadin/tests/featurebrowser/Feature.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java index 2b8668aa94..2b8668aa94 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java index 48ead2f676..48ead2f676 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureButton.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureButton.java index a47eda9d35..a47eda9d35 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureButton.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureButton.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureContainers.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureContainers.java index 319be0056b..319be0056b 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureContainers.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureContainers.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java index 97ce9761a1..97ce9761a1 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureDateField.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureDateField.java index 31a3c53438..31a3c53438 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureDateField.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureDateField.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java index 65453a8ecc..65453a8ecc 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureForm.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureForm.java index f50ad70ffc..f50ad70ffc 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureForm.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureForm.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java index 297248001e..297248001e 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureItems.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureItems.java index 00e06deafd..00e06deafd 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureItems.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureItems.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureLabel.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureLabel.java index f12a76b39b..f12a76b39b 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureLabel.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureLabel.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureLink.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureLink.java index c20f8fe456..c20f8fe456 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureLink.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureLink.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java index 1ef07a6878..1ef07a6878 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java diff --git a/src/com/vaadin/tests/featurebrowser/FeaturePanel.java b/tests/src/com/vaadin/tests/featurebrowser/FeaturePanel.java index a12e51cae2..a12e51cae2 100644 --- a/src/com/vaadin/tests/featurebrowser/FeaturePanel.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeaturePanel.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureParameters.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureParameters.java index 4bb90e02b0..4bb90e02b0 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureParameters.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureParameters.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureProperties.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureProperties.java index 5c2b07b3e2..5c2b07b3e2 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureProperties.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureProperties.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureSelect.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureSelect.java index d38815e960..d38815e960 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureSelect.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureSelect.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java index 5dd686e60e..5dd686e60e 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTable.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureTable.java index ecc000320b..ecc000320b 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureTable.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureTable.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTextField.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureTextField.java index f2612ec857..f2612ec857 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureTextField.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureTextField.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTree.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureTree.java index 368b2df0f7..368b2df0f7 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureTree.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureTree.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureUpload.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureUpload.java index 2dd586d7b8..2dd586d7b8 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureUpload.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureUpload.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureUtil.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureUtil.java index 077ee4fbe5..077ee4fbe5 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureUtil.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureUtil.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureValidators.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureValidators.java index 5f251929a5..5f251929a5 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureValidators.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureValidators.java diff --git a/src/com/vaadin/tests/featurebrowser/FeatureWindow.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureWindow.java index 0153bf5a0e..0153bf5a0e 100644 --- a/src/com/vaadin/tests/featurebrowser/FeatureWindow.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureWindow.java diff --git a/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java b/tests/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java index 2d3ac436ad..2d3ac436ad 100644 --- a/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroBasic.java b/tests/src/com/vaadin/tests/featurebrowser/IntroBasic.java index 5d480c106a..5d480c106a 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroBasic.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroBasic.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroComponents.java b/tests/src/com/vaadin/tests/featurebrowser/IntroComponents.java index c4898a7fcc..c4898a7fcc 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroComponents.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroComponents.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java b/tests/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java index d164442d4c..d164442d4c 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroDataModel.java b/tests/src/com/vaadin/tests/featurebrowser/IntroDataModel.java index b4fb8f6757..b4fb8f6757 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroDataModel.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroDataModel.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java b/tests/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java index db9909946c..db9909946c 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroLayouts.java b/tests/src/com/vaadin/tests/featurebrowser/IntroLayouts.java index bd180a860c..bd180a860c 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroLayouts.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroLayouts.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroTerminal.java b/tests/src/com/vaadin/tests/featurebrowser/IntroTerminal.java index 8bb4a3f145..8bb4a3f145 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroTerminal.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroTerminal.java diff --git a/src/com/vaadin/tests/featurebrowser/IntroWelcome.java b/tests/src/com/vaadin/tests/featurebrowser/IntroWelcome.java index d9c20b96b2..d9c20b96b2 100644 --- a/src/com/vaadin/tests/featurebrowser/IntroWelcome.java +++ b/tests/src/com/vaadin/tests/featurebrowser/IntroWelcome.java diff --git a/src/com/vaadin/tests/featurebrowser/PropertyPanel.java b/tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java index 5e105dbf1e..5e105dbf1e 100644 --- a/src/com/vaadin/tests/featurebrowser/PropertyPanel.java +++ b/tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java diff --git a/src/com/vaadin/tests/featurebrowser/components.png b/tests/src/com/vaadin/tests/featurebrowser/components.png Binary files differindex e5681d4d37..e5681d4d37 100644 --- a/src/com/vaadin/tests/featurebrowser/components.png +++ b/tests/src/com/vaadin/tests/featurebrowser/components.png diff --git a/src/com/vaadin/tests/featurebrowser/icon_demo.png b/tests/src/com/vaadin/tests/featurebrowser/icon_demo.png Binary files differindex 6a5c295d6a..6a5c295d6a 100644 --- a/src/com/vaadin/tests/featurebrowser/icon_demo.png +++ b/tests/src/com/vaadin/tests/featurebrowser/icon_demo.png diff --git a/src/com/vaadin/tests/featurebrowser/icon_intro.png b/tests/src/com/vaadin/tests/featurebrowser/icon_intro.png Binary files differindex 032712985c..032712985c 100644 --- a/src/com/vaadin/tests/featurebrowser/icon_intro.png +++ b/tests/src/com/vaadin/tests/featurebrowser/icon_intro.png diff --git a/src/com/vaadin/tests/featurebrowser/itmill.gif b/tests/src/com/vaadin/tests/featurebrowser/itmill.gif Binary files differindex b1c3e053f0..b1c3e053f0 100644 --- a/src/com/vaadin/tests/featurebrowser/itmill.gif +++ b/tests/src/com/vaadin/tests/featurebrowser/itmill.gif diff --git a/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif b/tests/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif Binary files differindex fa6b38b4c9..fa6b38b4c9 100644 --- a/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif +++ b/tests/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif diff --git a/src/com/vaadin/tests/featurebrowser/m.gif b/tests/src/com/vaadin/tests/featurebrowser/m.gif Binary files differindex 2201bdfc1c..2201bdfc1c 100644 --- a/src/com/vaadin/tests/featurebrowser/m.gif +++ b/tests/src/com/vaadin/tests/featurebrowser/m.gif diff --git a/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf b/tests/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf Binary files differindex 9e58ce29c6..9e58ce29c6 100644 --- a/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf +++ b/tests/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf diff --git a/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java b/tests/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java index 7172dd7e0d..7172dd7e0d 100644 --- a/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java +++ b/tests/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java diff --git a/src/com/vaadin/tests/layouts/DeepComponentTrees.java b/tests/src/com/vaadin/tests/layouts/DeepComponentTrees.java index e13cdf5c3a..e13cdf5c3a 100644 --- a/src/com/vaadin/tests/layouts/DeepComponentTrees.java +++ b/tests/src/com/vaadin/tests/layouts/DeepComponentTrees.java diff --git a/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/tests/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java index 8934adae0a..8934adae0a 100644 --- a/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java +++ b/tests/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java diff --git a/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java b/tests/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java index 781e39bb4e..781e39bb4e 100644 --- a/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java +++ b/tests/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java diff --git a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java b/tests/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java index bc2e8c01cb..bc2e8c01cb 100644 --- a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java +++ b/tests/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java diff --git a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java b/tests/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java index 22fabab4d7..22fabab4d7 100644 --- a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java +++ b/tests/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java diff --git a/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/tests/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java index e548d7dacc..e548d7dacc 100644 --- a/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java +++ b/tests/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java diff --git a/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/tests/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java index 3167947697..3167947697 100644 --- a/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ b/tests/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java diff --git a/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java b/tests/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java index 6073edf249..6073edf249 100644 --- a/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java +++ b/tests/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java diff --git a/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/tests/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java index efabf0ac9a..efabf0ac9a 100644 --- a/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java +++ b/tests/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java diff --git a/src/com/vaadin/tests/layouts/TestLayoutPerformance.java b/tests/src/com/vaadin/tests/layouts/TestLayoutPerformance.java index 896581ce3d..896581ce3d 100644 --- a/src/com/vaadin/tests/layouts/TestLayoutPerformance.java +++ b/tests/src/com/vaadin/tests/layouts/TestLayoutPerformance.java diff --git a/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java b/tests/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java index 9aadbadd78..9aadbadd78 100644 --- a/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java +++ b/tests/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java diff --git a/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java b/tests/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java index 8ff742c179..8ff742c179 100644 --- a/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java +++ b/tests/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java diff --git a/src/com/vaadin/tests/m.gif b/tests/src/com/vaadin/tests/m.gif Binary files differindex 2201bdfc1c..2201bdfc1c 100644 --- a/src/com/vaadin/tests/m.gif +++ b/tests/src/com/vaadin/tests/m.gif diff --git a/src/com/vaadin/tests/resources/ResourceDownload.java b/tests/src/com/vaadin/tests/resources/ResourceDownload.java index d7da9c2d63..d7da9c2d63 100644 --- a/src/com/vaadin/tests/resources/ResourceDownload.java +++ b/tests/src/com/vaadin/tests/resources/ResourceDownload.java diff --git a/src/com/vaadin/tests/robustness/Robustness.java b/tests/src/com/vaadin/tests/robustness/Robustness.java index 6294e09d4e..6294e09d4e 100644 --- a/src/com/vaadin/tests/robustness/Robustness.java +++ b/tests/src/com/vaadin/tests/robustness/Robustness.java diff --git a/src/com/vaadin/tests/robustness/RobustnessSimple.java b/tests/src/com/vaadin/tests/robustness/RobustnessSimple.java index 63324ad9bc..63324ad9bc 100644 --- a/src/com/vaadin/tests/robustness/RobustnessSimple.java +++ b/tests/src/com/vaadin/tests/robustness/RobustnessSimple.java diff --git a/src/com/vaadin/tests/themes/ButtonsTest.java b/tests/src/com/vaadin/tests/themes/ButtonsTest.java index 9ad2a9f39e..9ad2a9f39e 100644 --- a/src/com/vaadin/tests/themes/ButtonsTest.java +++ b/tests/src/com/vaadin/tests/themes/ButtonsTest.java diff --git a/src/com/vaadin/tests/tickets/Ticket1225.java b/tests/src/com/vaadin/tests/tickets/Ticket1225.java index 5244308f45..5244308f45 100644 --- a/src/com/vaadin/tests/tickets/Ticket1225.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1225.java diff --git a/src/com/vaadin/tests/tickets/Ticket1230.java b/tests/src/com/vaadin/tests/tickets/Ticket1230.java index 233dd3aae8..233dd3aae8 100644 --- a/src/com/vaadin/tests/tickets/Ticket1230.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1230.java diff --git a/src/com/vaadin/tests/tickets/Ticket124.java b/tests/src/com/vaadin/tests/tickets/Ticket124.java index 1c2ca1a2e1..1c2ca1a2e1 100644 --- a/src/com/vaadin/tests/tickets/Ticket124.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket124.java diff --git a/src/com/vaadin/tests/tickets/Ticket1245.java b/tests/src/com/vaadin/tests/tickets/Ticket1245.java index c2a150b8ba..c2a150b8ba 100644 --- a/src/com/vaadin/tests/tickets/Ticket1245.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1245.java diff --git a/src/com/vaadin/tests/tickets/Ticket1362Login.java b/tests/src/com/vaadin/tests/tickets/Ticket1362Login.java index 8640b06bc0..8640b06bc0 100644 --- a/src/com/vaadin/tests/tickets/Ticket1362Login.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1362Login.java diff --git a/src/com/vaadin/tests/tickets/Ticket1365.java b/tests/src/com/vaadin/tests/tickets/Ticket1365.java index 1a890e313e..1a890e313e 100644 --- a/src/com/vaadin/tests/tickets/Ticket1365.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1365.java diff --git a/src/com/vaadin/tests/tickets/Ticket1368.java b/tests/src/com/vaadin/tests/tickets/Ticket1368.java index 9df316fdcb..9df316fdcb 100644 --- a/src/com/vaadin/tests/tickets/Ticket1368.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1368.java diff --git a/src/com/vaadin/tests/tickets/Ticket1397.java b/tests/src/com/vaadin/tests/tickets/Ticket1397.java index b56620365c..b56620365c 100644 --- a/src/com/vaadin/tests/tickets/Ticket1397.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1397.java diff --git a/src/com/vaadin/tests/tickets/Ticket1435.java b/tests/src/com/vaadin/tests/tickets/Ticket1435.java index 9058184d8f..9058184d8f 100644 --- a/src/com/vaadin/tests/tickets/Ticket1435.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1435.java diff --git a/src/com/vaadin/tests/tickets/Ticket1444.java b/tests/src/com/vaadin/tests/tickets/Ticket1444.java index 2944f460f6..2944f460f6 100644 --- a/src/com/vaadin/tests/tickets/Ticket1444.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1444.java diff --git a/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/tests/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java index 3437ca5d2a..3437ca5d2a 100644 --- a/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java diff --git a/src/com/vaadin/tests/tickets/Ticket1506.java b/tests/src/com/vaadin/tests/tickets/Ticket1506.java index 4788d27aad..4788d27aad 100644 --- a/src/com/vaadin/tests/tickets/Ticket1506.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1506.java diff --git a/src/com/vaadin/tests/tickets/Ticket1506_Panel.java b/tests/src/com/vaadin/tests/tickets/Ticket1506_Panel.java index edbfd8928d..edbfd8928d 100644 --- a/src/com/vaadin/tests/tickets/Ticket1506_Panel.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1506_Panel.java diff --git a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/tests/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java index 7002602ca2..7002602ca2 100644 --- a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java diff --git a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/tests/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java index 4345b3e581..4345b3e581 100644 --- a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java diff --git a/src/com/vaadin/tests/tickets/Ticket1519.java b/tests/src/com/vaadin/tests/tickets/Ticket1519.java index d088b2be23..d088b2be23 100644 --- a/src/com/vaadin/tests/tickets/Ticket1519.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1519.java diff --git a/src/com/vaadin/tests/tickets/Ticket1572.java b/tests/src/com/vaadin/tests/tickets/Ticket1572.java index b2bc0397fd..b2bc0397fd 100644 --- a/src/com/vaadin/tests/tickets/Ticket1572.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1572.java diff --git a/src/com/vaadin/tests/tickets/Ticket1581.java b/tests/src/com/vaadin/tests/tickets/Ticket1581.java index 0b170260d9..0b170260d9 100644 --- a/src/com/vaadin/tests/tickets/Ticket1581.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1581.java diff --git a/src/com/vaadin/tests/tickets/Ticket1589.java b/tests/src/com/vaadin/tests/tickets/Ticket1589.java index 3debf78f25..3debf78f25 100644 --- a/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1589.java diff --git a/src/com/vaadin/tests/tickets/Ticket1598.java b/tests/src/com/vaadin/tests/tickets/Ticket1598.java index 0b35a223cc..0b35a223cc 100644 --- a/src/com/vaadin/tests/tickets/Ticket1598.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1598.java diff --git a/src/com/vaadin/tests/tickets/Ticket161.java b/tests/src/com/vaadin/tests/tickets/Ticket161.java index a09b0d01cb..a09b0d01cb 100644 --- a/src/com/vaadin/tests/tickets/Ticket161.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket161.java diff --git a/src/com/vaadin/tests/tickets/Ticket1632.java b/tests/src/com/vaadin/tests/tickets/Ticket1632.java index 1c521f8afb..1c521f8afb 100644 --- a/src/com/vaadin/tests/tickets/Ticket1632.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1632.java diff --git a/src/com/vaadin/tests/tickets/Ticket1659.java b/tests/src/com/vaadin/tests/tickets/Ticket1659.java index 78715c89d1..78715c89d1 100644 --- a/src/com/vaadin/tests/tickets/Ticket1659.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1659.java diff --git a/src/com/vaadin/tests/tickets/Ticket1663.java b/tests/src/com/vaadin/tests/tickets/Ticket1663.java index 04adfa3c79..04adfa3c79 100644 --- a/src/com/vaadin/tests/tickets/Ticket1663.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1663.java diff --git a/src/com/vaadin/tests/tickets/Ticket1673.java b/tests/src/com/vaadin/tests/tickets/Ticket1673.java index 845e49daed..845e49daed 100644 --- a/src/com/vaadin/tests/tickets/Ticket1673.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1673.java diff --git a/src/com/vaadin/tests/tickets/Ticket1710.java b/tests/src/com/vaadin/tests/tickets/Ticket1710.java index f65fd0c8e4..f65fd0c8e4 100644 --- a/src/com/vaadin/tests/tickets/Ticket1710.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1710.java diff --git a/src/com/vaadin/tests/tickets/Ticket1737.java b/tests/src/com/vaadin/tests/tickets/Ticket1737.java index cc44e43c46..cc44e43c46 100644 --- a/src/com/vaadin/tests/tickets/Ticket1737.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1737.java diff --git a/src/com/vaadin/tests/tickets/Ticket1767.java b/tests/src/com/vaadin/tests/tickets/Ticket1767.java index a65a601175..a65a601175 100644 --- a/src/com/vaadin/tests/tickets/Ticket1767.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1767.java diff --git a/src/com/vaadin/tests/tickets/Ticket1772.java b/tests/src/com/vaadin/tests/tickets/Ticket1772.java index 977d8563f0..977d8563f0 100644 --- a/src/com/vaadin/tests/tickets/Ticket1772.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1772.java diff --git a/src/com/vaadin/tests/tickets/Ticket1775.java b/tests/src/com/vaadin/tests/tickets/Ticket1775.java index cd66ecf0e5..cd66ecf0e5 100644 --- a/src/com/vaadin/tests/tickets/Ticket1775.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1775.java diff --git a/src/com/vaadin/tests/tickets/Ticket1804.java b/tests/src/com/vaadin/tests/tickets/Ticket1804.java index 5a0cc7e30b..5a0cc7e30b 100644 --- a/src/com/vaadin/tests/tickets/Ticket1804.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1804.java diff --git a/src/com/vaadin/tests/tickets/Ticket1805.java b/tests/src/com/vaadin/tests/tickets/Ticket1805.java index ef80904854..ef80904854 100644 --- a/src/com/vaadin/tests/tickets/Ticket1805.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1805.java diff --git a/src/com/vaadin/tests/tickets/Ticket1806.java b/tests/src/com/vaadin/tests/tickets/Ticket1806.java index 1949fddfa1..1949fddfa1 100644 --- a/src/com/vaadin/tests/tickets/Ticket1806.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1806.java diff --git a/src/com/vaadin/tests/tickets/Ticket1811.java b/tests/src/com/vaadin/tests/tickets/Ticket1811.java index 29571220a2..29571220a2 100644 --- a/src/com/vaadin/tests/tickets/Ticket1811.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1811.java diff --git a/src/com/vaadin/tests/tickets/Ticket1819.java b/tests/src/com/vaadin/tests/tickets/Ticket1819.java index e014dfee29..e014dfee29 100644 --- a/src/com/vaadin/tests/tickets/Ticket1819.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1819.java diff --git a/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/tests/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java index 13e9591303..13e9591303 100644 --- a/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java diff --git a/src/com/vaadin/tests/tickets/Ticket1857.java b/tests/src/com/vaadin/tests/tickets/Ticket1857.java index 74278af70b..74278af70b 100644 --- a/src/com/vaadin/tests/tickets/Ticket1857.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1857.java diff --git a/src/com/vaadin/tests/tickets/Ticket1868.java b/tests/src/com/vaadin/tests/tickets/Ticket1868.java index 3b68146df3..3b68146df3 100644 --- a/src/com/vaadin/tests/tickets/Ticket1868.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1868.java diff --git a/src/com/vaadin/tests/tickets/Ticket1869.java b/tests/src/com/vaadin/tests/tickets/Ticket1869.java index 6c101441a6..6c101441a6 100644 --- a/src/com/vaadin/tests/tickets/Ticket1869.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1869.java diff --git a/src/com/vaadin/tests/tickets/Ticket1878.java b/tests/src/com/vaadin/tests/tickets/Ticket1878.java index 04f6efb78c..04f6efb78c 100644 --- a/src/com/vaadin/tests/tickets/Ticket1878.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1878.java diff --git a/src/com/vaadin/tests/tickets/Ticket1900.java b/tests/src/com/vaadin/tests/tickets/Ticket1900.java index a6f3c5c224..a6f3c5c224 100644 --- a/src/com/vaadin/tests/tickets/Ticket1900.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1900.java diff --git a/src/com/vaadin/tests/tickets/Ticket1902.java b/tests/src/com/vaadin/tests/tickets/Ticket1902.java index 716b6b94f0..716b6b94f0 100644 --- a/src/com/vaadin/tests/tickets/Ticket1902.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1902.java diff --git a/src/com/vaadin/tests/tickets/Ticket1904.java b/tests/src/com/vaadin/tests/tickets/Ticket1904.java index 87ea8eeb1f..87ea8eeb1f 100644 --- a/src/com/vaadin/tests/tickets/Ticket1904.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1904.java diff --git a/src/com/vaadin/tests/tickets/Ticket1916.java b/tests/src/com/vaadin/tests/tickets/Ticket1916.java index 9976393664..9976393664 100644 --- a/src/com/vaadin/tests/tickets/Ticket1916.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1916.java diff --git a/src/com/vaadin/tests/tickets/Ticket1919.java b/tests/src/com/vaadin/tests/tickets/Ticket1919.java index bf9b826b38..bf9b826b38 100644 --- a/src/com/vaadin/tests/tickets/Ticket1919.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1919.java diff --git a/src/com/vaadin/tests/tickets/Ticket1921.java b/tests/src/com/vaadin/tests/tickets/Ticket1921.java index 8dae844b75..8dae844b75 100644 --- a/src/com/vaadin/tests/tickets/Ticket1921.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1921.java diff --git a/src/com/vaadin/tests/tickets/Ticket1923.java b/tests/src/com/vaadin/tests/tickets/Ticket1923.java index 8ed9273a06..8ed9273a06 100644 --- a/src/com/vaadin/tests/tickets/Ticket1923.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1923.java diff --git a/src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java b/tests/src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java index 4fb357b94e..4fb357b94e 100644 --- a/src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java diff --git a/src/com/vaadin/tests/tickets/Ticket1925.java b/tests/src/com/vaadin/tests/tickets/Ticket1925.java index 83e5e1cfd4..83e5e1cfd4 100644 --- a/src/com/vaadin/tests/tickets/Ticket1925.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1925.java diff --git a/src/com/vaadin/tests/tickets/Ticket1934.java b/tests/src/com/vaadin/tests/tickets/Ticket1934.java index b80dfc07e0..b80dfc07e0 100644 --- a/src/com/vaadin/tests/tickets/Ticket1934.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1934.java diff --git a/src/com/vaadin/tests/tickets/Ticket1939.java b/tests/src/com/vaadin/tests/tickets/Ticket1939.java index 429834c382..429834c382 100644 --- a/src/com/vaadin/tests/tickets/Ticket1939.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1939.java diff --git a/src/com/vaadin/tests/tickets/Ticket1940.java b/tests/src/com/vaadin/tests/tickets/Ticket1940.java index 129a761e1c..129a761e1c 100644 --- a/src/com/vaadin/tests/tickets/Ticket1940.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1940.java diff --git a/src/com/vaadin/tests/tickets/Ticket1953.java b/tests/src/com/vaadin/tests/tickets/Ticket1953.java index 43e7f10220..43e7f10220 100644 --- a/src/com/vaadin/tests/tickets/Ticket1953.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1953.java diff --git a/src/com/vaadin/tests/tickets/Ticket1966.java b/tests/src/com/vaadin/tests/tickets/Ticket1966.java index d6c5accd4c..d6c5accd4c 100644 --- a/src/com/vaadin/tests/tickets/Ticket1966.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1966.java diff --git a/src/com/vaadin/tests/tickets/Ticket1966_2.java b/tests/src/com/vaadin/tests/tickets/Ticket1966_2.java index 862cb8ecd3..862cb8ecd3 100644 --- a/src/com/vaadin/tests/tickets/Ticket1966_2.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1966_2.java diff --git a/src/com/vaadin/tests/tickets/Ticket1966_3.java b/tests/src/com/vaadin/tests/tickets/Ticket1966_3.java index 6cd552b6b2..6cd552b6b2 100644 --- a/src/com/vaadin/tests/tickets/Ticket1966_3.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1966_3.java diff --git a/src/com/vaadin/tests/tickets/Ticket1969.java b/tests/src/com/vaadin/tests/tickets/Ticket1969.java index 5e183beb78..5e183beb78 100644 --- a/src/com/vaadin/tests/tickets/Ticket1969.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1969.java diff --git a/src/com/vaadin/tests/tickets/Ticket1970.java b/tests/src/com/vaadin/tests/tickets/Ticket1970.java index b23a3f58d6..b23a3f58d6 100644 --- a/src/com/vaadin/tests/tickets/Ticket1970.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1970.java diff --git a/src/com/vaadin/tests/tickets/Ticket1972.java b/tests/src/com/vaadin/tests/tickets/Ticket1972.java index 6cbbbb9f92..6cbbbb9f92 100644 --- a/src/com/vaadin/tests/tickets/Ticket1972.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1972.java diff --git a/src/com/vaadin/tests/tickets/Ticket1973.java b/tests/src/com/vaadin/tests/tickets/Ticket1973.java index 4e93ef57b4..4e93ef57b4 100644 --- a/src/com/vaadin/tests/tickets/Ticket1973.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1973.java diff --git a/src/com/vaadin/tests/tickets/Ticket1973_2.java b/tests/src/com/vaadin/tests/tickets/Ticket1973_2.java index 875cc70bc6..875cc70bc6 100644 --- a/src/com/vaadin/tests/tickets/Ticket1973_2.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1973_2.java diff --git a/src/com/vaadin/tests/tickets/Ticket1975.java b/tests/src/com/vaadin/tests/tickets/Ticket1975.java index 9adc67f529..9adc67f529 100644 --- a/src/com/vaadin/tests/tickets/Ticket1975.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1975.java diff --git a/src/com/vaadin/tests/tickets/Ticket1982.java b/tests/src/com/vaadin/tests/tickets/Ticket1982.java index a81478ff67..a81478ff67 100644 --- a/src/com/vaadin/tests/tickets/Ticket1982.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1982.java diff --git a/src/com/vaadin/tests/tickets/Ticket1983.java b/tests/src/com/vaadin/tests/tickets/Ticket1983.java index b02047aca2..b02047aca2 100644 --- a/src/com/vaadin/tests/tickets/Ticket1983.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1983.java diff --git a/src/com/vaadin/tests/tickets/Ticket1986.java b/tests/src/com/vaadin/tests/tickets/Ticket1986.java index 1b96f7bd39..1b96f7bd39 100644 --- a/src/com/vaadin/tests/tickets/Ticket1986.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1986.java diff --git a/src/com/vaadin/tests/tickets/Ticket1991.java b/tests/src/com/vaadin/tests/tickets/Ticket1991.java index 430c54ec92..430c54ec92 100644 --- a/src/com/vaadin/tests/tickets/Ticket1991.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1991.java diff --git a/src/com/vaadin/tests/tickets/Ticket1995.java b/tests/src/com/vaadin/tests/tickets/Ticket1995.java index 1745ace18c..1745ace18c 100644 --- a/src/com/vaadin/tests/tickets/Ticket1995.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1995.java diff --git a/src/com/vaadin/tests/tickets/Ticket20.java b/tests/src/com/vaadin/tests/tickets/Ticket20.java index 7adb2e932e..7adb2e932e 100644 --- a/src/com/vaadin/tests/tickets/Ticket20.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket20.java diff --git a/src/com/vaadin/tests/tickets/Ticket2001.java b/tests/src/com/vaadin/tests/tickets/Ticket2001.java index f3fbb4c508..f3fbb4c508 100644 --- a/src/com/vaadin/tests/tickets/Ticket2001.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2001.java diff --git a/src/com/vaadin/tests/tickets/Ticket2002.java b/tests/src/com/vaadin/tests/tickets/Ticket2002.java index 35f2c84872..35f2c84872 100644 --- a/src/com/vaadin/tests/tickets/Ticket2002.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2002.java diff --git a/src/com/vaadin/tests/tickets/Ticket2007.java b/tests/src/com/vaadin/tests/tickets/Ticket2007.java index e925519ee2..e925519ee2 100644 --- a/src/com/vaadin/tests/tickets/Ticket2007.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2007.java diff --git a/src/com/vaadin/tests/tickets/Ticket2009.java b/tests/src/com/vaadin/tests/tickets/Ticket2009.java index 4118794aa7..4118794aa7 100644 --- a/src/com/vaadin/tests/tickets/Ticket2009.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2009.java diff --git a/src/com/vaadin/tests/tickets/Ticket2011.java b/tests/src/com/vaadin/tests/tickets/Ticket2011.java index d4e5890635..d4e5890635 100644 --- a/src/com/vaadin/tests/tickets/Ticket2011.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2011.java diff --git a/src/com/vaadin/tests/tickets/Ticket2014.java b/tests/src/com/vaadin/tests/tickets/Ticket2014.java index 1cf0e4c58e..1cf0e4c58e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2014.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2014.java diff --git a/src/com/vaadin/tests/tickets/Ticket2021.java b/tests/src/com/vaadin/tests/tickets/Ticket2021.java index 5ea423ea99..5ea423ea99 100644 --- a/src/com/vaadin/tests/tickets/Ticket2021.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2021.java diff --git a/src/com/vaadin/tests/tickets/Ticket2022.java b/tests/src/com/vaadin/tests/tickets/Ticket2022.java index 9dfcabc208..9dfcabc208 100644 --- a/src/com/vaadin/tests/tickets/Ticket2022.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2022.java diff --git a/src/com/vaadin/tests/tickets/Ticket2023.java b/tests/src/com/vaadin/tests/tickets/Ticket2023.java index fac09e07ea..fac09e07ea 100644 --- a/src/com/vaadin/tests/tickets/Ticket2023.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2023.java diff --git a/src/com/vaadin/tests/tickets/Ticket2024.java b/tests/src/com/vaadin/tests/tickets/Ticket2024.java index 1c2c7b4a33..1c2c7b4a33 100644 --- a/src/com/vaadin/tests/tickets/Ticket2024.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2024.java diff --git a/src/com/vaadin/tests/tickets/Ticket2026.java b/tests/src/com/vaadin/tests/tickets/Ticket2026.java index 4bbb9057ff..4bbb9057ff 100644 --- a/src/com/vaadin/tests/tickets/Ticket2026.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2026.java diff --git a/src/com/vaadin/tests/tickets/Ticket2029.java b/tests/src/com/vaadin/tests/tickets/Ticket2029.java index 4c53e2cd9e..4c53e2cd9e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2029.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2029.java diff --git a/src/com/vaadin/tests/tickets/Ticket2032.java b/tests/src/com/vaadin/tests/tickets/Ticket2032.java index f51984f336..f51984f336 100644 --- a/src/com/vaadin/tests/tickets/Ticket2032.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2032.java diff --git a/src/com/vaadin/tests/tickets/Ticket2033.java b/tests/src/com/vaadin/tests/tickets/Ticket2033.java index 744195619e..744195619e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2033.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2033.java diff --git a/src/com/vaadin/tests/tickets/Ticket2037.java b/tests/src/com/vaadin/tests/tickets/Ticket2037.java index 084ca14c0f..084ca14c0f 100644 --- a/src/com/vaadin/tests/tickets/Ticket2037.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2037.java diff --git a/src/com/vaadin/tests/tickets/Ticket2038.java b/tests/src/com/vaadin/tests/tickets/Ticket2038.java index e566d50520..e566d50520 100644 --- a/src/com/vaadin/tests/tickets/Ticket2038.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2038.java diff --git a/src/com/vaadin/tests/tickets/Ticket2040.java b/tests/src/com/vaadin/tests/tickets/Ticket2040.java index e5300d5eed..e5300d5eed 100644 --- a/src/com/vaadin/tests/tickets/Ticket2040.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2040.java diff --git a/src/com/vaadin/tests/tickets/Ticket2042.java b/tests/src/com/vaadin/tests/tickets/Ticket2042.java index 6339222a0b..6339222a0b 100644 --- a/src/com/vaadin/tests/tickets/Ticket2042.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2042.java diff --git a/src/com/vaadin/tests/tickets/Ticket2043.java b/tests/src/com/vaadin/tests/tickets/Ticket2043.java index aad3cb554a..aad3cb554a 100644 --- a/src/com/vaadin/tests/tickets/Ticket2043.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2043.java diff --git a/src/com/vaadin/tests/tickets/Ticket2048.java b/tests/src/com/vaadin/tests/tickets/Ticket2048.java index f1bfecdcc0..f1bfecdcc0 100644 --- a/src/com/vaadin/tests/tickets/Ticket2048.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2048.java diff --git a/src/com/vaadin/tests/tickets/Ticket2051.java b/tests/src/com/vaadin/tests/tickets/Ticket2051.java index b31acbde11..b31acbde11 100644 --- a/src/com/vaadin/tests/tickets/Ticket2051.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2051.java diff --git a/src/com/vaadin/tests/tickets/Ticket2053.java b/tests/src/com/vaadin/tests/tickets/Ticket2053.java index 167a1440c0..167a1440c0 100644 --- a/src/com/vaadin/tests/tickets/Ticket2053.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2053.java diff --git a/src/com/vaadin/tests/tickets/Ticket2060.java b/tests/src/com/vaadin/tests/tickets/Ticket2060.java index 09a391e80d..09a391e80d 100644 --- a/src/com/vaadin/tests/tickets/Ticket2060.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2060.java diff --git a/src/com/vaadin/tests/tickets/Ticket2061.java b/tests/src/com/vaadin/tests/tickets/Ticket2061.java index b6c8f1fb38..b6c8f1fb38 100644 --- a/src/com/vaadin/tests/tickets/Ticket2061.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2061.java diff --git a/src/com/vaadin/tests/tickets/Ticket2061b.java b/tests/src/com/vaadin/tests/tickets/Ticket2061b.java index 8d87a70788..8d87a70788 100644 --- a/src/com/vaadin/tests/tickets/Ticket2061b.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2061b.java diff --git a/src/com/vaadin/tests/tickets/Ticket2061c.java b/tests/src/com/vaadin/tests/tickets/Ticket2061c.java index 77381dcbfd..77381dcbfd 100644 --- a/src/com/vaadin/tests/tickets/Ticket2061c.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2061c.java diff --git a/src/com/vaadin/tests/tickets/Ticket2062.java b/tests/src/com/vaadin/tests/tickets/Ticket2062.java index e5650ae18c..e5650ae18c 100644 --- a/src/com/vaadin/tests/tickets/Ticket2062.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2062.java diff --git a/src/com/vaadin/tests/tickets/Ticket2083.java b/tests/src/com/vaadin/tests/tickets/Ticket2083.java index e074210fec..e074210fec 100644 --- a/src/com/vaadin/tests/tickets/Ticket2083.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2083.java diff --git a/src/com/vaadin/tests/tickets/Ticket2090.java b/tests/src/com/vaadin/tests/tickets/Ticket2090.java index 5bc69e0a64..5bc69e0a64 100644 --- a/src/com/vaadin/tests/tickets/Ticket2090.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2090.java diff --git a/src/com/vaadin/tests/tickets/Ticket2095.java b/tests/src/com/vaadin/tests/tickets/Ticket2095.java index 49353db114..49353db114 100644 --- a/src/com/vaadin/tests/tickets/Ticket2095.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2095.java diff --git a/src/com/vaadin/tests/tickets/Ticket2098.java b/tests/src/com/vaadin/tests/tickets/Ticket2098.java index 829fb30070..829fb30070 100644 --- a/src/com/vaadin/tests/tickets/Ticket2098.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2098.java diff --git a/src/com/vaadin/tests/tickets/Ticket2099.java b/tests/src/com/vaadin/tests/tickets/Ticket2099.java index 44c264e07e..44c264e07e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2099.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2099.java diff --git a/src/com/vaadin/tests/tickets/Ticket2101.java b/tests/src/com/vaadin/tests/tickets/Ticket2101.java index 9a260635cf..9a260635cf 100644 --- a/src/com/vaadin/tests/tickets/Ticket2101.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2101.java diff --git a/src/com/vaadin/tests/tickets/Ticket2103.java b/tests/src/com/vaadin/tests/tickets/Ticket2103.java index 3e655b6753..3e655b6753 100644 --- a/src/com/vaadin/tests/tickets/Ticket2103.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2103.java diff --git a/src/com/vaadin/tests/tickets/Ticket2104.java b/tests/src/com/vaadin/tests/tickets/Ticket2104.java index 974e97871f..974e97871f 100644 --- a/src/com/vaadin/tests/tickets/Ticket2104.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2104.java diff --git a/src/com/vaadin/tests/tickets/Ticket2106.java b/tests/src/com/vaadin/tests/tickets/Ticket2106.java index 8168e06154..8168e06154 100644 --- a/src/com/vaadin/tests/tickets/Ticket2106.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2106.java diff --git a/src/com/vaadin/tests/tickets/Ticket2107.java b/tests/src/com/vaadin/tests/tickets/Ticket2107.java index adb6784275..adb6784275 100644 --- a/src/com/vaadin/tests/tickets/Ticket2107.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2107.java diff --git a/src/com/vaadin/tests/tickets/Ticket2117.java b/tests/src/com/vaadin/tests/tickets/Ticket2117.java index 6a22915f03..6a22915f03 100644 --- a/src/com/vaadin/tests/tickets/Ticket2117.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2117.java diff --git a/src/com/vaadin/tests/tickets/Ticket2119.java b/tests/src/com/vaadin/tests/tickets/Ticket2119.java index 7e782dc2a0..7e782dc2a0 100644 --- a/src/com/vaadin/tests/tickets/Ticket2119.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2119.java diff --git a/src/com/vaadin/tests/tickets/Ticket2125.java b/tests/src/com/vaadin/tests/tickets/Ticket2125.java index 49610597db..49610597db 100644 --- a/src/com/vaadin/tests/tickets/Ticket2125.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2125.java diff --git a/src/com/vaadin/tests/tickets/Ticket2126.java b/tests/src/com/vaadin/tests/tickets/Ticket2126.java index 01ef18f2ef..01ef18f2ef 100644 --- a/src/com/vaadin/tests/tickets/Ticket2126.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2126.java diff --git a/src/com/vaadin/tests/tickets/Ticket2151.java b/tests/src/com/vaadin/tests/tickets/Ticket2151.java index 06d1f15336..06d1f15336 100644 --- a/src/com/vaadin/tests/tickets/Ticket2151.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2151.java diff --git a/src/com/vaadin/tests/tickets/Ticket2157.java b/tests/src/com/vaadin/tests/tickets/Ticket2157.java index c4f6ff30d3..c4f6ff30d3 100644 --- a/src/com/vaadin/tests/tickets/Ticket2157.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2157.java diff --git a/src/com/vaadin/tests/tickets/Ticket2178.java b/tests/src/com/vaadin/tests/tickets/Ticket2178.java index c663b29778..c663b29778 100644 --- a/src/com/vaadin/tests/tickets/Ticket2178.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2178.java diff --git a/src/com/vaadin/tests/tickets/Ticket2179.java b/tests/src/com/vaadin/tests/tickets/Ticket2179.java index 4612f7464f..4612f7464f 100644 --- a/src/com/vaadin/tests/tickets/Ticket2179.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2179.java diff --git a/src/com/vaadin/tests/tickets/Ticket2180.java b/tests/src/com/vaadin/tests/tickets/Ticket2180.java index 9f5e2a2de1..9f5e2a2de1 100644 --- a/src/com/vaadin/tests/tickets/Ticket2180.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2180.java diff --git a/src/com/vaadin/tests/tickets/Ticket2181.java b/tests/src/com/vaadin/tests/tickets/Ticket2181.java index d5afb01e0d..d5afb01e0d 100644 --- a/src/com/vaadin/tests/tickets/Ticket2181.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2181.java diff --git a/src/com/vaadin/tests/tickets/Ticket2186.java b/tests/src/com/vaadin/tests/tickets/Ticket2186.java index 55eff60fef..55eff60fef 100644 --- a/src/com/vaadin/tests/tickets/Ticket2186.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2186.java diff --git a/src/com/vaadin/tests/tickets/Ticket2204.java b/tests/src/com/vaadin/tests/tickets/Ticket2204.java index d4bcd55c55..d4bcd55c55 100644 --- a/src/com/vaadin/tests/tickets/Ticket2204.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2204.java diff --git a/src/com/vaadin/tests/tickets/Ticket2208.java b/tests/src/com/vaadin/tests/tickets/Ticket2208.java index 0c8639603e..0c8639603e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2208.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2208.java diff --git a/src/com/vaadin/tests/tickets/Ticket2209.java b/tests/src/com/vaadin/tests/tickets/Ticket2209.java index 02450e23c1..02450e23c1 100644 --- a/src/com/vaadin/tests/tickets/Ticket2209.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2209.java diff --git a/src/com/vaadin/tests/tickets/Ticket2209OL.java b/tests/src/com/vaadin/tests/tickets/Ticket2209OL.java index 620fed1021..620fed1021 100644 --- a/src/com/vaadin/tests/tickets/Ticket2209OL.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2209OL.java diff --git a/src/com/vaadin/tests/tickets/Ticket2209OL2.java b/tests/src/com/vaadin/tests/tickets/Ticket2209OL2.java index 5f250b7976..5f250b7976 100644 --- a/src/com/vaadin/tests/tickets/Ticket2209OL2.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2209OL2.java diff --git a/src/com/vaadin/tests/tickets/Ticket2215.java b/tests/src/com/vaadin/tests/tickets/Ticket2215.java index 51b0236ad0..51b0236ad0 100644 --- a/src/com/vaadin/tests/tickets/Ticket2215.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2215.java diff --git a/src/com/vaadin/tests/tickets/Ticket2221.java b/tests/src/com/vaadin/tests/tickets/Ticket2221.java index 30d3070043..30d3070043 100644 --- a/src/com/vaadin/tests/tickets/Ticket2221.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2221.java diff --git a/src/com/vaadin/tests/tickets/Ticket2222.java b/tests/src/com/vaadin/tests/tickets/Ticket2222.java index 40980fcef2..40980fcef2 100644 --- a/src/com/vaadin/tests/tickets/Ticket2222.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2222.java diff --git a/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/tests/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java index a8b4867323..a8b4867323 100644 --- a/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java diff --git a/src/com/vaadin/tests/tickets/Ticket2231.java b/tests/src/com/vaadin/tests/tickets/Ticket2231.java index c9f773a4a4..c9f773a4a4 100644 --- a/src/com/vaadin/tests/tickets/Ticket2231.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2231.java diff --git a/src/com/vaadin/tests/tickets/Ticket2232.java b/tests/src/com/vaadin/tests/tickets/Ticket2232.java index 2b33ee39cf..2b33ee39cf 100644 --- a/src/com/vaadin/tests/tickets/Ticket2232.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2232.java diff --git a/src/com/vaadin/tests/tickets/Ticket2234.java b/tests/src/com/vaadin/tests/tickets/Ticket2234.java index 25d74e8574..25d74e8574 100644 --- a/src/com/vaadin/tests/tickets/Ticket2234.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2234.java diff --git a/src/com/vaadin/tests/tickets/Ticket2235.java b/tests/src/com/vaadin/tests/tickets/Ticket2235.java index 98c618453d..98c618453d 100644 --- a/src/com/vaadin/tests/tickets/Ticket2235.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2235.java diff --git a/src/com/vaadin/tests/tickets/Ticket2240.java b/tests/src/com/vaadin/tests/tickets/Ticket2240.java index e28a463eed..e28a463eed 100644 --- a/src/com/vaadin/tests/tickets/Ticket2240.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2240.java diff --git a/src/com/vaadin/tests/tickets/Ticket2242.java b/tests/src/com/vaadin/tests/tickets/Ticket2242.java index 0c1bf21a3f..0c1bf21a3f 100644 --- a/src/com/vaadin/tests/tickets/Ticket2242.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2242.java diff --git a/src/com/vaadin/tests/tickets/Ticket2244.java b/tests/src/com/vaadin/tests/tickets/Ticket2244.java index 4631f63cc4..4631f63cc4 100644 --- a/src/com/vaadin/tests/tickets/Ticket2244.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2244.java diff --git a/src/com/vaadin/tests/tickets/Ticket2245.java b/tests/src/com/vaadin/tests/tickets/Ticket2245.java index 8232b7bc38..8232b7bc38 100644 --- a/src/com/vaadin/tests/tickets/Ticket2245.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2245.java diff --git a/src/com/vaadin/tests/tickets/Ticket2267.java b/tests/src/com/vaadin/tests/tickets/Ticket2267.java index 2ccbce604a..2ccbce604a 100644 --- a/src/com/vaadin/tests/tickets/Ticket2267.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2267.java diff --git a/src/com/vaadin/tests/tickets/Ticket2271.java b/tests/src/com/vaadin/tests/tickets/Ticket2271.java index 50a5466645..50a5466645 100644 --- a/src/com/vaadin/tests/tickets/Ticket2271.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2271.java diff --git a/src/com/vaadin/tests/tickets/Ticket2279.java b/tests/src/com/vaadin/tests/tickets/Ticket2279.java index 06f2cb9348..06f2cb9348 100644 --- a/src/com/vaadin/tests/tickets/Ticket2279.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2279.java diff --git a/src/com/vaadin/tests/tickets/Ticket2282.java b/tests/src/com/vaadin/tests/tickets/Ticket2282.java index 1e5924fced..1e5924fced 100644 --- a/src/com/vaadin/tests/tickets/Ticket2282.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2282.java diff --git a/src/com/vaadin/tests/tickets/Ticket2283.java b/tests/src/com/vaadin/tests/tickets/Ticket2283.java index 6504355676..6504355676 100644 --- a/src/com/vaadin/tests/tickets/Ticket2283.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2283.java diff --git a/src/com/vaadin/tests/tickets/Ticket2287.java b/tests/src/com/vaadin/tests/tickets/Ticket2287.java index cd6770e156..cd6770e156 100644 --- a/src/com/vaadin/tests/tickets/Ticket2287.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2287.java diff --git a/src/com/vaadin/tests/tickets/Ticket2289.java b/tests/src/com/vaadin/tests/tickets/Ticket2289.java index bd92311f73..bd92311f73 100644 --- a/src/com/vaadin/tests/tickets/Ticket2289.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2289.java diff --git a/src/com/vaadin/tests/tickets/Ticket2292.java b/tests/src/com/vaadin/tests/tickets/Ticket2292.java index 9cd448a5c7..9cd448a5c7 100644 --- a/src/com/vaadin/tests/tickets/Ticket2292.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2292.java diff --git a/src/com/vaadin/tests/tickets/Ticket2294.java b/tests/src/com/vaadin/tests/tickets/Ticket2294.java index f6c8a14420..f6c8a14420 100644 --- a/src/com/vaadin/tests/tickets/Ticket2294.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2294.java diff --git a/src/com/vaadin/tests/tickets/Ticket2296.java b/tests/src/com/vaadin/tests/tickets/Ticket2296.java index e4eb3e7a1d..e4eb3e7a1d 100644 --- a/src/com/vaadin/tests/tickets/Ticket2296.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2296.java diff --git a/src/com/vaadin/tests/tickets/Ticket2297.java b/tests/src/com/vaadin/tests/tickets/Ticket2297.java index 48265ded63..48265ded63 100644 --- a/src/com/vaadin/tests/tickets/Ticket2297.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2297.java diff --git a/src/com/vaadin/tests/tickets/Ticket2303.java b/tests/src/com/vaadin/tests/tickets/Ticket2303.java index 927358723d..927358723d 100644 --- a/src/com/vaadin/tests/tickets/Ticket2303.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2303.java diff --git a/src/com/vaadin/tests/tickets/Ticket2304.java b/tests/src/com/vaadin/tests/tickets/Ticket2304.java index 57c7acefc1..57c7acefc1 100644 --- a/src/com/vaadin/tests/tickets/Ticket2304.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2304.java diff --git a/src/com/vaadin/tests/tickets/Ticket2310.java b/tests/src/com/vaadin/tests/tickets/Ticket2310.java index 3318456afa..3318456afa 100644 --- a/src/com/vaadin/tests/tickets/Ticket2310.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2310.java diff --git a/src/com/vaadin/tests/tickets/Ticket2319.java b/tests/src/com/vaadin/tests/tickets/Ticket2319.java index 9d61a27613..9d61a27613 100644 --- a/src/com/vaadin/tests/tickets/Ticket2319.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2319.java diff --git a/src/com/vaadin/tests/tickets/Ticket2323.java b/tests/src/com/vaadin/tests/tickets/Ticket2323.java index 4def857112..4def857112 100644 --- a/src/com/vaadin/tests/tickets/Ticket2323.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2323.java diff --git a/src/com/vaadin/tests/tickets/Ticket2325.java b/tests/src/com/vaadin/tests/tickets/Ticket2325.java index 3b46d89a5e..3b46d89a5e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2325.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2325.java diff --git a/src/com/vaadin/tests/tickets/Ticket2329.java b/tests/src/com/vaadin/tests/tickets/Ticket2329.java index c55ab9cac5..c55ab9cac5 100644 --- a/src/com/vaadin/tests/tickets/Ticket2329.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2329.java diff --git a/src/com/vaadin/tests/tickets/Ticket2337.java b/tests/src/com/vaadin/tests/tickets/Ticket2337.java index aae4807277..aae4807277 100644 --- a/src/com/vaadin/tests/tickets/Ticket2337.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2337.java diff --git a/src/com/vaadin/tests/tickets/Ticket2339.java b/tests/src/com/vaadin/tests/tickets/Ticket2339.java index 6476807ada..6476807ada 100644 --- a/src/com/vaadin/tests/tickets/Ticket2339.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2339.java diff --git a/src/com/vaadin/tests/tickets/Ticket2341.java b/tests/src/com/vaadin/tests/tickets/Ticket2341.java index b6dd4cc1f0..b6dd4cc1f0 100644 --- a/src/com/vaadin/tests/tickets/Ticket2341.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2341.java diff --git a/src/com/vaadin/tests/tickets/Ticket2344.java b/tests/src/com/vaadin/tests/tickets/Ticket2344.java index cb36fbca9e..cb36fbca9e 100644 --- a/src/com/vaadin/tests/tickets/Ticket2344.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2344.java diff --git a/src/com/vaadin/tests/tickets/Ticket2347.java b/tests/src/com/vaadin/tests/tickets/Ticket2347.java index 08e1aae34c..08e1aae34c 100644 --- a/src/com/vaadin/tests/tickets/Ticket2347.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2347.java diff --git a/src/com/vaadin/tests/tickets/Ticket2364.java b/tests/src/com/vaadin/tests/tickets/Ticket2364.java index 7f7290dd80..7f7290dd80 100644 --- a/src/com/vaadin/tests/tickets/Ticket2364.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2364.java diff --git a/src/com/vaadin/tests/tickets/Ticket2365.java b/tests/src/com/vaadin/tests/tickets/Ticket2365.java index 1fee955e6b..1fee955e6b 100644 --- a/src/com/vaadin/tests/tickets/Ticket2365.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2365.java diff --git a/src/com/vaadin/tests/tickets/Ticket2398.java b/tests/src/com/vaadin/tests/tickets/Ticket2398.java index dee0417eff..dee0417eff 100644 --- a/src/com/vaadin/tests/tickets/Ticket2398.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2398.java diff --git a/src/com/vaadin/tests/tickets/Ticket2404.java b/tests/src/com/vaadin/tests/tickets/Ticket2404.java index 478d8b7786..478d8b7786 100644 --- a/src/com/vaadin/tests/tickets/Ticket2404.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2404.java diff --git a/src/com/vaadin/tests/tickets/Ticket2405.java b/tests/src/com/vaadin/tests/tickets/Ticket2405.java index 174d6e5d6c..174d6e5d6c 100644 --- a/src/com/vaadin/tests/tickets/Ticket2405.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2405.java diff --git a/src/com/vaadin/tests/tickets/Ticket2406.java b/tests/src/com/vaadin/tests/tickets/Ticket2406.java index b4f8ec77cf..b4f8ec77cf 100644 --- a/src/com/vaadin/tests/tickets/Ticket2406.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2406.java diff --git a/src/com/vaadin/tests/tickets/Ticket2407.java b/tests/src/com/vaadin/tests/tickets/Ticket2407.java index e095bb294c..e095bb294c 100644 --- a/src/com/vaadin/tests/tickets/Ticket2407.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2407.java diff --git a/src/com/vaadin/tests/tickets/Ticket2411.java b/tests/src/com/vaadin/tests/tickets/Ticket2411.java index b402ced300..b402ced300 100644 --- a/src/com/vaadin/tests/tickets/Ticket2411.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2411.java diff --git a/src/com/vaadin/tests/tickets/Ticket2415.java b/tests/src/com/vaadin/tests/tickets/Ticket2415.java index 5c1d0c2a51..5c1d0c2a51 100644 --- a/src/com/vaadin/tests/tickets/Ticket2415.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2415.java diff --git a/src/com/vaadin/tests/tickets/Ticket2420.java b/tests/src/com/vaadin/tests/tickets/Ticket2420.java index e40d73877c..e40d73877c 100644 --- a/src/com/vaadin/tests/tickets/Ticket2420.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2420.java diff --git a/src/com/vaadin/tests/tickets/Ticket2425.java b/tests/src/com/vaadin/tests/tickets/Ticket2425.java index 75810137ad..75810137ad 100644 --- a/src/com/vaadin/tests/tickets/Ticket2425.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2425.java diff --git a/src/com/vaadin/tests/tickets/Ticket2426.java b/tests/src/com/vaadin/tests/tickets/Ticket2426.java index bbad5ef686..bbad5ef686 100644 --- a/src/com/vaadin/tests/tickets/Ticket2426.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2426.java diff --git a/src/com/vaadin/tests/tickets/Ticket2431.java b/tests/src/com/vaadin/tests/tickets/Ticket2431.java index 5ab8486663..5ab8486663 100644 --- a/src/com/vaadin/tests/tickets/Ticket2431.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2431.java diff --git a/src/com/vaadin/tests/tickets/Ticket2432.java b/tests/src/com/vaadin/tests/tickets/Ticket2432.java index 635a356e49..635a356e49 100644 --- a/src/com/vaadin/tests/tickets/Ticket2432.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2432.java diff --git a/src/com/vaadin/tests/tickets/Ticket2434.java b/tests/src/com/vaadin/tests/tickets/Ticket2434.java index 5d4a884895..5d4a884895 100644 --- a/src/com/vaadin/tests/tickets/Ticket2434.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2434.java diff --git a/src/com/vaadin/tests/tickets/Ticket2436.java b/tests/src/com/vaadin/tests/tickets/Ticket2436.java index 0d6a4a1444..0d6a4a1444 100644 --- a/src/com/vaadin/tests/tickets/Ticket2436.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2436.java diff --git a/src/com/vaadin/tests/tickets/Ticket2440.java b/tests/src/com/vaadin/tests/tickets/Ticket2440.java index 16b8c3e707..16b8c3e707 100644 --- a/src/com/vaadin/tests/tickets/Ticket2440.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2440.java diff --git a/src/com/vaadin/tests/tickets/Ticket2526.java b/tests/src/com/vaadin/tests/tickets/Ticket2526.java index 05528ef086..05528ef086 100644 --- a/src/com/vaadin/tests/tickets/Ticket2526.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2526.java diff --git a/src/com/vaadin/tests/tickets/Ticket2742.java b/tests/src/com/vaadin/tests/tickets/Ticket2742.java index 11eb01e051..11eb01e051 100644 --- a/src/com/vaadin/tests/tickets/Ticket2742.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2742.java diff --git a/src/com/vaadin/tests/tickets/Ticket2901.java b/tests/src/com/vaadin/tests/tickets/Ticket2901.java index 61537488ca..61537488ca 100644 --- a/src/com/vaadin/tests/tickets/Ticket2901.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2901.java diff --git a/src/com/vaadin/tests/tickets/Ticket2998.java b/tests/src/com/vaadin/tests/tickets/Ticket2998.java index 11fc3194b0..11fc3194b0 100644 --- a/src/com/vaadin/tests/tickets/Ticket2998.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2998.java diff --git a/src/com/vaadin/tests/tickets/Ticket3146.java b/tests/src/com/vaadin/tests/tickets/Ticket3146.java index 53600b9299..53600b9299 100644 --- a/src/com/vaadin/tests/tickets/Ticket3146.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket3146.java diff --git a/src/com/vaadin/tests/tickets/Ticket34.java b/tests/src/com/vaadin/tests/tickets/Ticket34.java index beb6813d4d..beb6813d4d 100644 --- a/src/com/vaadin/tests/tickets/Ticket34.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket34.java diff --git a/src/com/vaadin/tests/tickets/Ticket677.java b/tests/src/com/vaadin/tests/tickets/Ticket677.java index ab945a2d8e..ab945a2d8e 100644 --- a/src/com/vaadin/tests/tickets/Ticket677.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket677.java diff --git a/src/com/vaadin/tests/tickets/Ticket695.java b/tests/src/com/vaadin/tests/tickets/Ticket695.java index a328133014..a328133014 100644 --- a/src/com/vaadin/tests/tickets/Ticket695.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket695.java diff --git a/src/com/vaadin/tests/tickets/Ticket736.java b/tests/src/com/vaadin/tests/tickets/Ticket736.java index 45d46866a5..45d46866a5 100644 --- a/src/com/vaadin/tests/tickets/Ticket736.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket736.java diff --git a/src/com/vaadin/tests/tickets/Ticket846.java b/tests/src/com/vaadin/tests/tickets/Ticket846.java index 888906105d..888906105d 100644 --- a/src/com/vaadin/tests/tickets/Ticket846.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket846.java diff --git a/src/com/vaadin/tests/tickets/Ticket932.java b/tests/src/com/vaadin/tests/tickets/Ticket932.java index 6a8a459042..6a8a459042 100644 --- a/src/com/vaadin/tests/tickets/Ticket932.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket932.java diff --git a/src/com/vaadin/tests/util/LogPrintWriter.java b/tests/src/com/vaadin/tests/util/LogPrintWriter.java index 1f07a9c7ae..1f07a9c7ae 100644 --- a/src/com/vaadin/tests/util/LogPrintWriter.java +++ b/tests/src/com/vaadin/tests/util/LogPrintWriter.java diff --git a/src/com/vaadin/tests/util/LoremIpsum.java b/tests/src/com/vaadin/tests/util/LoremIpsum.java index 3dc775badf..3dc775badf 100644 --- a/src/com/vaadin/tests/util/LoremIpsum.java +++ b/tests/src/com/vaadin/tests/util/LoremIpsum.java diff --git a/src/com/vaadin/tests/util/RandomComponents.java b/tests/src/com/vaadin/tests/util/RandomComponents.java index fdfb878e04..fdfb878e04 100644 --- a/src/com/vaadin/tests/util/RandomComponents.java +++ b/tests/src/com/vaadin/tests/util/RandomComponents.java diff --git a/src/com/vaadin/tests/util/TestClickListener.java b/tests/src/com/vaadin/tests/util/TestClickListener.java index 730452ac72..730452ac72 100644 --- a/src/com/vaadin/tests/util/TestClickListener.java +++ b/tests/src/com/vaadin/tests/util/TestClickListener.java diff --git a/src/com/vaadin/tests/vaadin_spin.swf b/tests/src/com/vaadin/tests/vaadin_spin.swf Binary files differindex 9e58ce29c6..9e58ce29c6 100644 --- a/src/com/vaadin/tests/vaadin_spin.swf +++ b/tests/src/com/vaadin/tests/vaadin_spin.swf diff --git a/src/com/vaadin/tests/validation/RequiredErrorMessage.java b/tests/src/com/vaadin/tests/validation/RequiredErrorMessage.java index 7f5048bd80..7f5048bd80 100644 --- a/src/com/vaadin/tests/validation/RequiredErrorMessage.java +++ b/tests/src/com/vaadin/tests/validation/RequiredErrorMessage.java diff --git a/src/com/vaadin/tests/validation/RequiredIndicatorForReadOnly.java b/tests/src/com/vaadin/tests/validation/RequiredIndicatorForReadOnly.java index 6e806b60f4..6e806b60f4 100644 --- a/src/com/vaadin/tests/validation/RequiredIndicatorForReadOnly.java +++ b/tests/src/com/vaadin/tests/validation/RequiredIndicatorForReadOnly.java diff --git a/src/com/vaadin/tests/validation/TestValidators.java b/tests/src/com/vaadin/tests/validation/TestValidators.java index 75eaa61ce4..75eaa61ce4 100644 --- a/src/com/vaadin/tests/validation/TestValidators.java +++ b/tests/src/com/vaadin/tests/validation/TestValidators.java |