*/
private LinkedList<RepaintRequestListener> repaintRequestListeners = null;
- /**
- * Are all the repaint listeners notified about recent changes ?
- */
- private boolean repaintRequestListenersNotified = false;
-
private String testingId;
/* Sizeable fields */
/* Component painting */
- /* Documented in super interface */
+ @Deprecated
public void requestRepaintRequests() {
- repaintRequestListenersNotified = false;
+ // This is no longer needed. Remove when Component no longer extends
+ // Paintable
}
/**
// nothing to do but flag as deferred and close the paintable tag
// paint() will be called again later to paint the contents
target.addAttribute("deferred", true);
- } else if (PaintStatus.CACHED == status
- && !repaintRequestListenersNotified) {
- // Contents have not changed, only cached presentation can be used
- target.addAttribute("cached", true);
} else {
// Paint the contents of the component
}
target.endPaintable(this);
- repaintRequestListenersNotified = false;
}
/**
private void fireRequestRepaintEvent(
Collection<RepaintRequestListener> alreadyNotified) {
// Notify listeners only once
- if (!repaintRequestListenersNotified) {
- // Notify the listeners
- if (repaintRequestListeners != null
- && !repaintRequestListeners.isEmpty()) {
- final Object[] listeners = repaintRequestListeners.toArray();
- final RepaintRequestEvent event = new RepaintRequestEvent(this);
- for (int i = 0; i < listeners.length; i++) {
- if (alreadyNotified == null) {
- alreadyNotified = new LinkedList<RepaintRequestListener>();
- }
- if (!alreadyNotified.contains(listeners[i])) {
- ((RepaintRequestListener) listeners[i])
- .repaintRequested(event);
- alreadyNotified
- .add((RepaintRequestListener) listeners[i]);
- repaintRequestListenersNotified = true;
- }
+ // Notify the listeners
+ if (repaintRequestListeners != null
+ && !repaintRequestListeners.isEmpty()) {
+ final Object[] listeners = repaintRequestListeners.toArray();
+ final RepaintRequestEvent event = new RepaintRequestEvent(this);
+ for (int i = 0; i < listeners.length; i++) {
+ if (alreadyNotified == null) {
+ alreadyNotified = new LinkedList<RepaintRequestListener>();
+ }
+ if (!alreadyNotified.contains(listeners[i])) {
+ ((RepaintRequestListener) listeners[i])
+ .repaintRequested(event);
+ alreadyNotified.add((RepaintRequestListener) listeners[i]);
}
}
+ }
- // Notify the parent
- final Component parent = getParent();
- if (parent != null) {
- parent.childRequestedRepaint(alreadyNotified);
- }
+ // Notify the parent
+ final Component parent = getParent();
+ if (parent != null) {
+ parent.childRequestedRepaint(alreadyNotified);
}
}
import com.vaadin.terminal.Paintable.RepaintRequestEvent;
import com.vaadin.terminal.Paintable.RepaintRequestListener;
-
+import com.vaadin.terminal.gwt.server.ClientConnector;
+
+/**
+ * A class that tracks dirty {@link ClientConnector}s. A {@link ClientConnector}
+ * is dirty when an operation has been performed on it on the server and as a
+ * result of this operation new information needs to be sent to its client side
+ * counterpart.
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ *
+ */
public class DirtyConnectorTracker implements RepaintRequestListener {
private Set<Component> dirtyComponents = new HashSet<Component>();
private Root root;
+ /**
+ * Gets a logger for this class
+ *
+ * @return A logger instance for logging within this class
+ *
+ */
public static Logger getLogger() {
return Logger.getLogger(DirtyConnectorTracker.class.getName());
}
}
dirtyComponents.remove(component);
- // TODO .... WTF ....
- component.requestRepaintRequests();
-
}
private String getDebugInfo(Component component) {