summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-12-21 14:02:28 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-12-21 14:02:28 +0000
commit4bab8436f277d1d28f0de7bc9655062e3dfaa87a (patch)
tree082d80709e376d3340041a1c7e586037a6f9f0f2
parent9732516f27607abd9c927c613b6950b9642e60fb (diff)
downloadvaadin-framework-4bab8436f277d1d28f0de7bc9655062e3dfaa87a.tar.gz
vaadin-framework-4bab8436f277d1d28f0de7bc9655062e3dfaa87a.zip
svn changeset:16611/svn branch:6.5
-rw-r--r--WebContent/multiapp.html9
-rw-r--r--build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.classbin0 -> 2900 bytes
-rw-r--r--build/buildhelpers/com/vaadin/buildhelpers/ManifestWriter.classbin0 -> 2930 bytes
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java10
-rw-r--r--src/com/vaadin/ui/AbstractListLayout.java196
-rw-r--r--tests/eclipse-run-selected-test.properties6
6 files changed, 212 insertions, 9 deletions
diff --git a/WebContent/multiapp.html b/WebContent/multiapp.html
index ddde191d28..acc925a941 100644
--- a/WebContent/multiapp.html
+++ b/WebContent/multiapp.html
@@ -5,12 +5,6 @@
<script type="text/javascript">
var vaadin = {
vaadinConfigurations: {
- 'fb' :{
- appUri:'/FeatureBrowser',
- pathInfo: '/',
- themeUri: '/VAADIN/themes/example',
- versionInfo : {vaadinVersion:"6.0.0-INTERNAL-NONVERSIONED-DEBUG-BUILD",applicationVersion:"NONVERSIONED"}
- },
'calc' :{
appUri:'/Calc',
pathInfo: '/',
@@ -38,5 +32,8 @@
<div id="fb" style="height:400px;border:2px solid red;margin:0"></div>
<div id="calc" style="border:2px solid green;margin:0"></div>
<div id="hello" style="border:2px solid blue;margin:0"></div>
+
+
+ <iframe src="/FeatureBrowser?debug" style="width:300px; height:200px;"></iframe>
</body>
</html> \ No newline at end of file
diff --git a/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.class b/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.class
new file mode 100644
index 0000000000..c7f0d86336
--- /dev/null
+++ b/build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.class
Binary files differ
diff --git a/build/buildhelpers/com/vaadin/buildhelpers/ManifestWriter.class b/build/buildhelpers/com/vaadin/buildhelpers/ManifestWriter.class
new file mode 100644
index 0000000000..bd48e3b356
--- /dev/null
+++ b/build/buildhelpers/com/vaadin/buildhelpers/ManifestWriter.class
Binary files differ
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index e8af424935..ef84d69085 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -332,6 +332,8 @@ public abstract class AbstractCommunicationManager implements
private int maxInactiveInterval;
+ private boolean paintPhase;
+
private static int nextUnusedWindowSuffix = 1;
/**
@@ -857,6 +859,8 @@ public abstract class AbstractCommunicationManager implements
Window window, boolean analyzeLayouts) throws PaintException,
IOException {
+ paintPhase = true;
+
if (repaintAll) {
makeAllPaintablesDirty(window);
}
@@ -911,6 +915,8 @@ public abstract class AbstractCommunicationManager implements
outWriter.close();
+ paintPhase = false;
+
}
public void writeUidlResponce(Callback callback, boolean repaintAll,
@@ -1970,6 +1976,10 @@ public abstract class AbstractCommunicationManager implements
* @see com.vaadin.terminal.Paintable.RepaintRequestListener#repaintRequested(com.vaadin.terminal.Paintable.RepaintRequestEvent)
*/
public void repaintRequested(RepaintRequestEvent event) {
+ if (paintPhase) {
+ throw new IllegalStateException(
+ "Paintables shouldn't become dirty in paint phase!!");
+ }
final Paintable p = event.getPaintable();
if (!dirtyPaintables.contains(p)) {
dirtyPaintables.add(p);
diff --git a/src/com/vaadin/ui/AbstractListLayout.java b/src/com/vaadin/ui/AbstractListLayout.java
new file mode 100644
index 0000000000..0b8759b1f6
--- /dev/null
+++ b/src/com/vaadin/ui/AbstractListLayout.java
@@ -0,0 +1,196 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+package com.vaadin.ui;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.PaintTarget;
+
+/**
+ * Super class for layout implementations whose children have an order. Backs
+ * child components in a List.
+ *
+ * TODO {@link AbstractOrderedLayout} should extend this class
+ */
+public abstract class AbstractListLayout extends AbstractLayout {
+
+ /**
+ *
+ * @deprecated this field should not be used directly by sub classses, use
+ * {@link #getComponents()} instead.
+ */
+ @Deprecated
+ protected LinkedList<Component> components = new LinkedList<Component>();
+
+ /**
+ * Add a component into this container. The component is added to the right
+ * or under the previous component.
+ *
+ * @param c
+ * the component to be added.
+ */
+ @Override
+ public void addComponent(Component c) {
+ components.add(c);
+ try {
+ super.addComponent(c);
+ requestRepaint();
+ } catch (IllegalArgumentException e) {
+ components.remove(c);
+ throw e;
+ }
+ }
+
+ /**
+ * Adds a component into this container. The component is added to the left
+ * or on top of the other components.
+ *
+ * @param c
+ * the component to be added.
+ */
+ public void addComponentAsFirst(Component c) {
+ components.addFirst(c);
+ try {
+ super.addComponent(c);
+ requestRepaint();
+ } catch (IllegalArgumentException e) {
+ components.remove(c);
+ throw e;
+ }
+ }
+
+ /**
+ * Adds a component into indexed position in this container.
+ *
+ * @param c
+ * the component to be added.
+ * @param index
+ * the Index of the component position. The components currently
+ * in and after the position are shifted forwards.
+ */
+ public void addComponent(Component c, int index) {
+ components.add(index, c);
+ try {
+ super.addComponent(c);
+ requestRepaint();
+ } catch (IllegalArgumentException e) {
+ components.remove(c);
+ throw e;
+ }
+ }
+
+ /**
+ * Removes the component from this container.
+ *
+ * @param c
+ * the component to be removed.
+ */
+ @Override
+ public void removeComponent(Component c) {
+ components.remove(c);
+ super.removeComponent(c);
+ requestRepaint();
+ }
+
+ /**
+ * Gets the component container iterator for going trough all the components
+ * in the container.
+ *
+ * @return the Iterator of the components inside the container.
+ */
+ public Iterator<Component> getComponentIterator() {
+ return components.iterator();
+ }
+
+ /**
+ * Gets the number of contained components. Consistent with the iterator
+ * returned by {@link #getComponentIterator()}.
+ *
+ * @return the number of contained components
+ */
+ public int getComponentCount() {
+ return components.size();
+ }
+
+ /**
+ * Paints the content of this component.
+ *
+ * @param target
+ * the Paint Event.
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ @Override
+ public void paintContent(PaintTarget target) throws PaintException {
+ super.paintContent(target);
+ paintComponents(target);
+ }
+
+ protected void paintComponents(PaintTarget target) throws PaintException {
+ for (Component c : getComponents()) {
+ paintComponent(target, c);
+ }
+ }
+
+ /**
+ * Gets the list of components used by this layout.
+ *
+ * @return the list of components used by this layout
+ */
+ protected List<Component> getComponents() {
+ return Collections.unmodifiableList(components);
+ }
+
+ protected void paintComponent(PaintTarget target, Component component)
+ throws PaintException {
+ component.paint(target);
+ }
+
+ /* Documented in superclass */
+ public void replaceComponent(Component oldComponent, Component newComponent) {
+
+ // Gets the locations
+ int oldLocation = -1;
+ int newLocation = -1;
+ int location = 0;
+ for (final Iterator<Component> i = components.iterator(); i.hasNext();) {
+ final Component component = i.next();
+
+ if (component == oldComponent) {
+ oldLocation = location;
+ }
+ if (component == newComponent) {
+ newLocation = location;
+ }
+
+ location++;
+ }
+
+ if (oldLocation == -1) {
+ addComponent(newComponent);
+ } else if (newLocation == -1) {
+ removeComponent(oldComponent);
+ addComponent(newComponent, oldLocation);
+ } else {
+ if (oldLocation > newLocation) {
+ components.remove(oldComponent);
+ components.add(newLocation, oldComponent);
+ components.remove(newComponent);
+ components.add(oldLocation, newComponent);
+ } else {
+ components.remove(newComponent);
+ components.add(oldLocation, newComponent);
+ components.remove(oldComponent);
+ components.add(newLocation, oldComponent);
+ }
+
+ requestRepaint();
+ }
+ }
+
+}
diff --git a/tests/eclipse-run-selected-test.properties b/tests/eclipse-run-selected-test.properties
index 49925925bc..6fd85346ca 100644
--- a/tests/eclipse-run-selected-test.properties
+++ b/tests/eclipse-run-selected-test.properties
@@ -1,12 +1,12 @@
; Location where vaadin-testbench jar can be found
-com.vaadin.testbench.lib.dir=<enter location of testbench here>
+com.vaadin.testbench.lib.dir=/Users/mattitahvonen/tb/
; Deployment url to use for testing. Context path must be /
-com.vaadin.testbench.deployment.url=http://<enter your ip here>:8888/
+com.vaadin.testbench.deployment.url=http://matin-vehje.office.itmill.com:8888/
; Location of the screenshot directory.
; This is the directory that contains the "references" directory
-com.vaadin.testbench.screenshot.directory=<enter the full path to the screenshots directory, parent of "references" directory>
+com.vaadin.testbench.screenshot.directory=/Users/mattitahvonen/tb/shots
; Run the whole test even if
com.vaadin.testbench.screenshot.softfail=true