diff options
Diffstat (limited to 'server/src/com/vaadin/terminal')
5 files changed, 71 insertions, 13 deletions
diff --git a/server/src/com/vaadin/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java index 2b96c5fb35..d2490225fb 100644 --- a/server/src/com/vaadin/terminal/AbstractClientConnector.java +++ b/server/src/com/vaadin/terminal/AbstractClientConnector.java @@ -85,8 +85,15 @@ public abstract class AbstractClientConnector implements ClientConnector { private ClientConnector parent; /* Documentation copied from interface */ + @Deprecated @Override public void requestRepaint() { + markAsDirty(); + } + + /* Documentation copied from interface */ + @Override + public void markAsDirty() { Root root = getRoot(); if (root != null) { root.getConnectorTracker().markDirty(this); @@ -389,11 +396,17 @@ public abstract class AbstractClientConnector implements ClientConnector { } @Override + @Deprecated public void requestRepaintAll() { - requestRepaint(); + markAsDirtyRecursive(); + } + + @Override + public void markAsDirtyRecursive() { + markAsDirty(); for (ClientConnector connector : getAllChildrenIterable(this)) { - connector.requestRepaintAll(); + connector.markAsDirtyRecursive(); } } @@ -469,14 +482,14 @@ public abstract class AbstractClientConnector implements ClientConnector { extensions.add(extension); extension.setParent(this); - requestRepaint(); + markAsDirty(); } @Override public void removeExtension(Extension extension) { extension.setParent(null); extensions.remove(extension); - requestRepaint(); + markAsDirty(); } @Override @@ -513,7 +526,7 @@ public abstract class AbstractClientConnector implements ClientConnector { @Override public void attach() { - requestRepaint(); + markAsDirty(); getRoot().getConnectorTracker().registerConnector(this); diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java index 8eb77b7d0d..d41d500bb0 100644 --- a/server/src/com/vaadin/terminal/Page.java +++ b/server/src/com/vaadin/terminal/Page.java @@ -332,7 +332,7 @@ public class Page implements Serializable { if (fireEvents) { fireEvent(new FragmentChangedEvent(this, newFragment)); } - root.requestRepaint(); + root.markAsDirty(); } } @@ -523,7 +523,7 @@ public class Page implements Serializable { */ public void open(Resource resource) { openList.add(new OpenResource(resource, null, -1, -1, BORDER_DEFAULT)); - root.requestRepaint(); + root.markAsDirty(); } /** @@ -566,7 +566,7 @@ public class Page implements Serializable { public void open(Resource resource, String windowName) { openList.add(new OpenResource(resource, windowName, -1, -1, BORDER_DEFAULT)); - root.requestRepaint(); + root.markAsDirty(); } /** @@ -589,7 +589,7 @@ public class Page implements Serializable { int height, BorderStyle border) { openList.add(new OpenResource(resource, windowName, width, height, border)); - root.requestRepaint(); + root.markAsDirty(); } /** @@ -603,7 +603,7 @@ public class Page implements Serializable { notifications = new LinkedList<Notification>(); } notifications.add(notification); - root.requestRepaint(); + root.markAsDirty(); } /** diff --git a/server/src/com/vaadin/terminal/Vaadin6Component.java b/server/src/com/vaadin/terminal/Vaadin6Component.java index 048000e31d..eb169c90f9 100644 --- a/server/src/com/vaadin/terminal/Vaadin6Component.java +++ b/server/src/com/vaadin/terminal/Vaadin6Component.java @@ -52,4 +52,15 @@ public interface Vaadin6Component extends VariableOwner, Component, */ public void paintContent(PaintTarget target) throws PaintException; + /** + * (non-Javadoc) {@inheritDoc} + * <p> + * For a Vaadin6Component, markAsDirty will also cause + * {@link #paintContent(PaintTarget)} to be called before sending changes to + * the client. + * + * @see com.vaadin.terminal.gwt.server.ClientConnector#markAsDirty() + */ + @Override + public void markAsDirty(); } diff --git a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java index 87524fe28f..24675c9e45 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java +++ b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java @@ -65,17 +65,39 @@ public interface ClientConnector extends Connector, RpcTarget { public ClientConnector getParent(); /** - * Requests that the connector should be repainted as soon as possible. + * @deprecated As of 7.0.0, use {@link #markAsDirty()} instead */ + @Deprecated public void requestRepaint(); /** - * Causes a repaint of this connector, and all connectors below it. + * Marks that this connector's state might have changed. When the framework + * is about to send new data to the client-side, it will run + * {@link #beforeClientResponse(boolean)} followed by {@link #encodeState()} + * for all connectors that are marked as dirty and send any updated state + * info to the client. * + * @since 7.0.0 + */ + public void markAsDirty(); + + /** + * @deprecated As of 7.0.0, use {@link #markAsDirtyRecursive()} instead + */ + @Deprecated + public void requestRepaintAll(); + + /** + * Causes this connector and all connectors below it to be marked as dirty. + * <p> * This should only be used in special cases, e.g when the state of a * descendant depends on the state of an ancestor. + * + * @see #markAsDirty() + * + * @since 7.0.0 */ - public void requestRepaintAll(); + public void markAsDirtyRecursive(); /** * Sets the parent connector of the connector. diff --git a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 981d2569d1..221598171c 100644 --- a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -264,7 +264,13 @@ public class DragAndDropService implements VariableOwner, ClientConnector { } @Override + @Deprecated public void requestRepaint() { + markAsDirty(); + } + + @Override + public void markAsDirty() { // TODO Auto-generated method stub } @@ -276,7 +282,13 @@ public class DragAndDropService implements VariableOwner, ClientConnector { } @Override + @Deprecated public void requestRepaintAll() { + markAsDirtyRecursive(); + } + + @Override + public void markAsDirtyRecursive() { // TODO Auto-generated method stub } |