1 11 package org.eclipse.debug.internal.ui; 12 13 14 import java.util.StringTokenizer ; 15 16 public class VariablesViewModelPresentation extends DelegatingModelPresentation { 17 18 23 public String getText(Object element) { 24 StringBuffer string= new StringBuffer (); 25 StringTokenizer tokenizer= new StringTokenizer (super.getText(element), "\b\f\n\r\t\\", true); String token; 27 while (tokenizer.hasMoreTokens()) { 28 token= tokenizer.nextToken(); 29 if (token.length() > 1) { 30 string.append(token); 31 } else { 32 switch (token.charAt(0)) { 33 case '\b': 34 string.append("\\b"); break; 36 case '\f': 37 string.append("\\f"); break; 39 case '\n': 40 string.append("\\n"); break; 42 case '\r': 43 string.append("\\r"); break; 45 case '\t': 46 string.append("\\t"); break; 48 case '\\': 49 string.append("\\\\"); break; 51 default: 52 string.append(token); 53 } 54 } 55 } 56 return string.toString(); 57 } 58 59 } 60 | Popular Tags |