Author: [EMAIL PROTECTED]
Date: Mon Dec 1 08:44:27 2008
New Revision: 4213
Modified:
changes/kprobst/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
Log:
Small update for string literal layout.
Modified:
changes/kprobst/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
==============================================================================
---
changes/kprobst/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
(original)
+++
changes/kprobst/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
Mon Dec 1 08:44:27 2008
@@ -430,6 +430,9 @@
+
+
+
public static void makePackageClassesHtmls() throws IOException{
for (String packageName : GlobalInformation.packageToClasses.keySet()){
@@ -653,6 +656,8 @@
+
+
public static void makeLiteralsClassesHtmls(TreeMap<String,
LiteralsCollection> nameToLitColl) throws IOException{
@@ -666,7 +671,7 @@
outFile.println("<html>");
outFile.println("<head>");
outFile.println("<meta http-equiv=\"content-type\"
content=\"text/html;charset=ISO-8859-1\">");
- outFile.println("<title>Literals of type" + literalType
+ "</title>");
+ outFile.println("<title>Literals of type \"" + literalType
+ "\"</title>");
outFile.println("</head>");
outFile.println("<style type=\"text/css\">");
@@ -690,7 +695,7 @@
outFile.println("}");
outFile.println(".rowdiv {");
outFile.println("display: table-row;");
- outFile.println("width:100%;");
+ //outFile.println("width:90%;");
outFile.println("}");
outFile.println("</style>");
@@ -701,15 +706,51 @@
outFile.println("<hr>");
outFile.println("<div style=\"width:90%; height:80%;
overflow-y:auto; overflow-x:auto; top: 30px; left:60px; position:relative;
background-color:white\"");
- outFile.println("<div class=\"tablediv\">");
+ outFile.println("<div class=\"tablediv\">");
for (String literal :
nameToLitColl.get(literalType).literalToLocations.keySet()){
- String escliteral = escapeXml(literal);
+ if (literal.trim().compareTo("") == 0){
+ literal = "[whitespace only string]";
+ }
+
+
+ String newLiteral = "";
+ if(literal.length() > 100){
+ int i;
+ for (i = 100; i < literal.length(); i=i+100){
+ String part1 = literal.substring(i-100, i);
+ newLiteral = newLiteral + part1 + " ";
+ }
+ if (i-100 > 0){
+ newLiteral = newLiteral + literal.substring(i-100);
+ }
+ }
+ else{
+ newLiteral = literal;
+ }
+
+ String escliteral = escapeXml(newLiteral);
outFile.println("<div class=\"rowdiv\">");
- outFile.println("<div class=\"celldiv\">" + escliteral
+ "</div>");
+ outFile.println("<div class=\"celldiv\">" + escliteral + "</div>");
for (String location :
nameToLitColl.get(literalType).literalToLocations.get(literal)){
- outFile.println("<div class=\"celldiv\">" + location
+ "</div>");
+
+ String newLocation = "";
+ if(location.length() > 100){
+ int i;
+ for (i = 100; i < location.length(); i=i+100){
+ String part1 = location.substring(i-100, i);
+ newLocation = newLocation + part1 + " ";
+ }
+ if (i-100 > 0){
+ newLocation = newLocation + location.substring(i-100);
+ }
+ }
+ else{
+ newLocation = location;
+ }
+
+ outFile.println("<div class=\"celldiv\">" + newLocation
+ "</div>");
}
outFile.println("</div>");
}
@@ -720,6 +761,8 @@
}
}
+
+
public static void makeStringLiteralsClassesHtmls(TreeMap<String,
LiteralsCollection> nameToLitColl) throws IOException{
@@ -735,7 +778,7 @@
outFile.println("<html>");
outFile.println("<head>");
outFile.println("<meta http-equiv=\"content-type\"
content=\"text/html;charset=ISO-8859-1\">");
- outFile.println("<title>Literals of type" + literalType
+ "</title>");
+ outFile.println("<title>Literals of type \"" + literalType
+ "\"</title>");
outFile.println("</head>");
outFile.println("<style type=\"text/css\">");
@@ -777,12 +820,48 @@
if
(nameToLitColl.get("string").stringLiteralToType.get(literal).compareTo(literalType)
== 0){
- String escliteral = escapeXml(literal);
+
+ if (literal.trim().compareTo("") == 0){
+ literal = "[whitespace only string]";
+ }
+
+ String newLiteral = "";
+ if(literal.length() > 100){
+ int i;
+ for (i = 100; i < literal.length(); i=i+100){
+ String part1 = literal.substring(i-100, i);
+ newLiteral = newLiteral + part1 + " ";
+ }
+ if (i-100 > 0){
+ newLiteral = newLiteral + literal.substring(i-100);
+ }
+ }
+ else{
+ newLiteral = literal;
+ }
+
+ String escliteral = escapeXml(newLiteral);
outFile.println("<div class=\"rowdiv\">");
outFile.println("<div class=\"celldiv\">" + escliteral
+ "</div>");
for (String location :
nameToLitColl.get("string").literalToLocations.get(literal)){
- outFile.println("<div class=\"celldiv\">" + location
+ "</div>");
+
+ String newLocation = "";
+ if(location.length() > 100){
+ int i;
+ for (i = 100; i < location.length(); i=i+100){
+ String part1 = location.substring(i-100, i);
+ newLocation = newLocation + part1 + " ";
+ }
+ if (i-100 > 0){
+ newLocation = newLocation + location.substring(i-100);
+ }
+ }
+ else{
+ newLocation = location;
+ }
+
+ outFile.println("<div class=\"celldiv\">" + newLocation
+ "</div>");
}
outFile.println("</div>");
}
@@ -796,7 +875,7 @@
}
-
+
public static String escapeXml(String unescaped) {
String escaped = unescaped.replaceAll("\\&", "&");
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---