]> source.dussan.org Git - vaadin-framework.git/commitdiff
removed obsolete method, added check not to paint other windows paintables
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 28 Nov 2007 13:24:49 +0000 (13:24 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 28 Nov 2007 13:24:49 +0000 (13:24 +0000)
svn changeset:3021/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java

index fd0f89506dc7621258331b26ac974d3b3283c00c..dfaa007109cb2c8adaff9059d362a5db323d4f9e 100644 (file)
@@ -304,7 +304,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
                         requireLocale(application.getLocale().toString());
 
                     } else {
-                        paintables = getDirtyComponents();
+                        paintables = getDirtyComponents(window);
                     }
                     if (paintables != null) {
 
@@ -718,49 +718,6 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
         return window;
     }
 
-    /**
-     * Handles the requested URI. An application can add handlers to do special
-     * processing, when a certain URI is requested. The handlers are invoked
-     * before any windows URIs are processed and if a DownloadStream is returned
-     * it is sent to the client.
-     * 
-     * @param application
-     *                the Application owning the URI.
-     * @param request
-     *                the HTTP request instance.
-     * @param response
-     *                the HTTP response to write to.
-     * @return boolean <code>true</code> if the request was handled and
-     *         further processing should be suppressed, otherwise
-     *         <code>false</code>.
-     * @see com.itmill.toolkit.terminal.URIHandler
-     */
-    private DownloadStream handleURI(Application application,
-            HttpServletRequest request, HttpServletResponse response) {
-
-        String uri = request.getPathInfo();
-
-        // If no URI is available
-        if (uri == null || uri.length() == 0 || uri.equals("/")) {
-            return null;
-        }
-
-        // Remove the leading /
-        while (uri.startsWith("/") && uri.length() > 0) {
-            uri = uri.substring(1);
-        }
-
-        // Handle the uri
-        DownloadStream stream = null;
-        try {
-            stream = application.handleURI(application.getURL(), uri);
-        } catch (Throwable t) {
-            application.terminalError(new URIHandlerErrorImpl(application, t));
-        }
-
-        return stream;
-    }
-
     /**
      * Handles the requested URI. An application can add handlers to do special
      * processing, when a certain URI is requested. The handlers are invoked
@@ -809,8 +766,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
             if (i != null) {
                 while (i.hasNext()) {
                     String param = (String) i.next();
-                    response.setHeader((String) param, stream
-                            .getParameter(param));
+                    response.setHeader(param, stream.getParameter(param));
                 }
             }
 
@@ -895,10 +851,11 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
     }
 
     /**
-     * 
+     * @param w
+     *                main window for which dirty components is to be fetched
      * @return
      */
-    public synchronized Set getDirtyComponents() {
+    public synchronized Set getDirtyComponents(Window w) {
         HashSet resultset = new HashSet(dirtyPaintabletSet);
 
         // The following algorithm removes any components that would be painted
@@ -911,7 +868,9 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
         for (Iterator i = dirtyPaintabletSet.iterator(); i.hasNext();) {
             Paintable p = (Paintable) i.next();
             if (p instanceof Component) {
-                if (dirtyPaintabletSet.contains(((Component) p).getParent())) {
+                Component component = (Component) p;
+                if (component.getWindow() != w
+                        || dirtyPaintabletSet.contains(component.getParent())) {
                     resultset.remove(p);
                 }
             }