(String str)
| 35 | |
| 36 | |
| 37 | static public SyntaxStyle fromString(String str) { |
| 38 | StringTokenizer st = new StringTokenizer(str, ","); |
| 39 | |
| 40 | String s = st.nextToken(); |
| 41 | if (s.indexOf("#") == 0) s = s.substring(1); |
| 42 | Color color = new Color(Integer.parseInt(s, 16)); |
| 43 | |
| 44 | s = st.nextToken(); |
| 45 | boolean bold = s.contains("bold"); |
| 46 | //boolean italic = s.contains("italic"); |
| 47 | |
| 48 | return new SyntaxStyle(color, bold); |
| 49 | } |
| 50 | |
| 51 | |
| 52 | /** Returns the color specified in this style. */ |
no test coverage detected