]> source.dussan.org Git - vaadin-framework.git/commitdiff
Refactor GET parameter names to ApplicationConstants 61/161/1
authorJohannes Dahlström <johannesd@vaadin.com>
Fri, 19 Oct 2012 14:35:57 +0000 (17:35 +0300)
committerJohannes Dahlström <johannesd@vaadin.com>
Wed, 24 Oct 2012 10:19:48 +0000 (13:19 +0300)
Change-Id: Id599a6f02f41fa4d4828007cf46bdfa397d81180

client/src/com/vaadin/client/ApplicationConnection.java
server/src/com/vaadin/server/AbstractCommunicationManager.java
shared/src/com/vaadin/shared/ApplicationConstants.java

index 944219877276abcfe25ef627d1a8e3bf77f57ecc..750e733b511082bbf52e8c786bf733b61cb0f7f2 100644 (file)
@@ -573,7 +573,8 @@ public class ApplicationConnection {
      * for debugging during development.
      */
     public void analyzeLayouts() {
-        String params = getRepaintAllParameters() + "&analyzeLayouts=1";
+        String params = getRepaintAllParameters() + "&"
+                + ApplicationConstants.PARAM_ANALYZE_LAYOUTS + "=1";
         makeUidlRequest("", params, false);
     }
 
@@ -585,7 +586,8 @@ public class ApplicationConnection {
      * @param serverConnector
      */
     void highlightConnector(ServerConnector serverConnector) {
-        String params = getRepaintAllParameters() + "&highlightConnector="
+        String params = getRepaintAllParameters() + "&"
+                + ApplicationConstants.PARAM_HIGHLIGHT_CONNECTOR + "="
                 + serverConnector.getConnectorId();
         makeUidlRequest("", params, false);
     }
index 7274ff8cafc27eb361bfd79ec5cf9d4249c558d4..5bbf8f5cea57fd3e3faee6f7420d660116182e66 100644 (file)
@@ -142,8 +142,6 @@ public abstract class AbstractCommunicationManager implements Serializable {
     /* Same as in apache commons file upload library that was previously used. */
     private static final int MAX_UPLOAD_BUFFER_SIZE = 4 * 1024;
 
-    private static final String GET_PARAM_ANALYZE_LAYOUTS = "analyzeLayouts";
-
     /**
      * The session this communication manager is used for
      */
@@ -192,8 +190,6 @@ public abstract class AbstractCommunicationManager implements Serializable {
 
     private static final String UTF8 = "UTF8";
 
-    private static final String GET_PARAM_HIGHLIGHT_CONNECTOR = "highlightConnector";
-
     private static String readLine(InputStream stream) throws IOException {
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
         int readByte = stream.read();
@@ -555,11 +551,12 @@ public abstract class AbstractCommunicationManager implements Serializable {
         boolean analyzeLayouts = false;
         if (repaintAll) {
             // analyzing can be done only with repaintAll
-            analyzeLayouts = (request.getParameter(GET_PARAM_ANALYZE_LAYOUTS) != null);
+            analyzeLayouts = (request
+                    .getParameter(ApplicationConstants.PARAM_ANALYZE_LAYOUTS) != null);
 
-            if (request.getParameter(GET_PARAM_HIGHLIGHT_CONNECTOR) != null) {
-                String pid = request
-                        .getParameter(GET_PARAM_HIGHLIGHT_CONNECTOR);
+            String pid = request
+                    .getParameter(ApplicationConstants.PARAM_HIGHLIGHT_CONNECTOR);
+            if (pid != null) {
                 highlightedConnector = uI.getConnectorTracker().getConnector(
                         pid);
                 highlightConnector(highlightedConnector);
@@ -713,19 +710,19 @@ public abstract class AbstractCommunicationManager implements Serializable {
         sb.append(".java");
         sb.append(":1)");
         int l = 1;
-        for (ClientConnector conector2 : h) {
+        for (ClientConnector connector2 : h) {
             sb.append("\n");
             for (int i = 0; i < l; i++) {
                 sb.append("  ");
             }
             l++;
-            Class<? extends ClientConnector> componentClass = conector2
+            Class<? extends ClientConnector> connectorClass = connector2
                     .getClass();
-            Class<?> topClass = componentClass;
+            Class<?> topClass = connectorClass;
             while (topClass.getEnclosingClass() != null) {
                 topClass = topClass.getEnclosingClass();
             }
-            sb.append(componentClass.getName());
+            sb.append(connectorClass.getName());
             sb.append("(");
             sb.append(topClass.getSimpleName());
             sb.append(".java:1)");
index 80b05d6021253ff373d28b7d69f0aee365cc2a96..a5eb109cb6488ed4cdf3148189422b9a3f7c111c 100644 (file)
@@ -36,6 +36,8 @@ public class ApplicationConstants {
     public static final String UIDL_SECURITY_TOKEN_ID = "Vaadin-Security-Key";
 
     public static final String PARAM_UNLOADBURST = "onunloadburst";
+    public static final String PARAM_ANALYZE_LAYOUTS = "analyzeLayouts";
+    public static final String PARAM_HIGHLIGHT_CONNECTOR = "highlightConnector";
 
     @Deprecated
     public static final String UPDATE_VARIABLE_INTERFACE = "v";