author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 25 Jan 2016 16:35:43 +0000 | |
changeset 298 | 9696f76605bd |
parent 296 | ea3dbc023c80 |
permissions | -rw-r--r-- |
3
7909b6680107
Loaded into & commited from 5.3.6
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2
diff
changeset
|
1 |
"{ Package: 'stx:goodies/xmlsuite/core' }" |
0 | 2 |
|
3 |
"{ NameSpace: XMLv2 }" |
|
4 |
||
5 |
IndentingXMLWriter subclass:#IndentingAndHighlightingXMLWriter |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'XML Suite-XML Writer' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!IndentingAndHighlightingXMLWriter class methodsFor:'accessing - colors'! |
|
14 |
||
15 |
attributeValueColor |
|
16 |
||
17 |
^Color red:0 green:0 blue:100 |
|
18 |
||
19 |
"Created: / 21-12-2005 / 16:54:14 / janfrog" |
|
20 |
! |
|
21 |
||
22 |
commentColor |
|
23 |
||
24 |
^Color red:0 green:51 blue:0 |
|
25 |
||
26 |
"Created: / 21-12-2005 / 16:54:14 / janfrog" |
|
27 |
! |
|
28 |
||
29 |
elementNameColor |
|
30 |
||
31 |
^Color red:58 green:15 blue:58 |
|
32 |
||
33 |
"Created: / 21-12-2005 / 16:54:14 / janfrog" |
|
34 |
! |
|
35 |
||
36 |
normalColor |
|
37 |
||
38 |
^Color black |
|
39 |
||
40 |
"Created: / 21-12-2005 / 16:54:14 / janfrog" |
|
41 |
! |
|
42 |
||
43 |
piColor |
|
44 |
||
45 |
^Color gray |
|
46 |
||
47 |
"Created: / 21-12-2005 / 16:54:14 / janfrog" |
|
48 |
! ! |
|
49 |
||
50 |
!IndentingAndHighlightingXMLWriter methodsFor:'SAX2 events'! |
|
51 |
||
52 |
attributeValueColor |
|
53 |
^ self class attributeValueColor |
|
54 |
||
55 |
"Created: / 21-12-2005 / 16:54:04 / janfrog" |
|
56 |
! |
|
57 |
||
58 |
comment:aString |
|
59 |
||
60 |
self emphasis:(Array with:(#color->self commentColor) with:#italic). |
|
61 |
super comment:aString. |
|
62 |
self emphasis:nil. |
|
63 |
||
64 |
"Created: / 21-12-2005 / 16:57:51 / janfrog" |
|
65 |
! |
|
66 |
||
67 |
commentColor |
|
68 |
^ self class commentColor |
|
69 |
||
70 |
"Created: / 21-12-2005 / 16:54:04 / janfrog" |
|
71 |
! |
|
72 |
||
73 |
elementNameColor |
|
74 |
^ self class elementNameColor |
|
75 |
||
76 |
"Created: / 21-12-2005 / 16:54:04 / janfrog" |
|
77 |
! |
|
78 |
||
79 |
emphasis: anObject |
|
80 |
||
81 |
stream emphasis: anObject |
|
82 |
||
83 |
"Created: / 21-12-2005 / 16:54:54 / janfrog" |
|
84 |
! |
|
85 |
||
86 |
nextPutAttribute:anAttr implicitNamespace:implicitNS |
|
87 |
self |
|
88 |
space; |
|
89 |
emphasis:#bold; |
|
90 |
nextPutAll: |
|
91 |
(anAttr namespaceURI = implicitNS |
|
92 |
ifTrue:[anAttr localName ] |
|
93 |
ifFalse:[anAttr nodeName]); |
|
94 |
emphasis:nil; |
|
95 |
nextPut:$=; |
|
96 |
emphasis:#color -> self attributeValueColor; |
|
97 |
nextPut:$"; |
|
98 |
nextPutString:(anAttr nodeValue); |
|
99 |
emphasis:nil; |
|
100 |
nextPut:$" |
|
101 |
||
102 |
"Created: / 09-04-2007 / 11:19:59 / janfrog" |
|
103 |
! |
|
104 |
||
105 |
nextPutPrefix:prefix localName:localName |
|
106 |
||
107 |
self emphasis:#color -> self elementNameColor. |
|
108 |
super nextPutPrefix:prefix localName:localName. |
|
109 |
self emphasis:#nil. |
|
110 |
||
111 |
"Modified: / 21-12-2005 / 16:56:51 / janfrog" |
|
112 |
! |
|
113 |
||
114 |
nextPutProlog |
|
115 |
||
116 |
self emphasis:(Array with: #color->self piColor with:#italic). |
|
117 |
super nextPutProlog. |
|
118 |
self emphasis:nil. |
|
119 |
||
120 |
"Created: / 21-12-2005 / 16:51:26 / janfrog" |
|
121 |
"Modified: / 21-12-2005 / 17:53:20 / janfrog" |
|
122 |
! |
|
123 |
||
124 |
normalColor |
|
125 |
^ self class normalColor |
|
126 |
||
127 |
"Created: / 21-12-2005 / 16:54:04 / janfrog" |
|
128 |
! |
|
129 |
||
130 |
piColor |
|
131 |
^ self class piColor |
|
132 |
||
133 |
"Created: / 21-12-2005 / 16:54:04 / janfrog" |
|
134 |
! |
|
135 |
||
136 |
processingInstruction:target data:data |
|
137 |
||
138 |
self emphasis:(Array with:(#color->self piColor) with:#italic). |
|
139 |
self processingInstruction:target data:data. |
|
140 |
self emphasis:nil. |
|
141 |
||
142 |
"Created: / 21-12-2005 / 16:57:51 / janfrog" |
|
143 |
! ! |
|
144 |
||
145 |
!IndentingAndHighlightingXMLWriter class methodsFor:'documentation'! |
|
146 |
||
147 |
version |
|
148 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/XMLv2__IndentingAndHighlightingXMLWriter.st,v 1.2 2007-04-10 08:33:08 vranyj1 Exp $' |
|
174
76f50ac2e6a0
removed dependency on libutilui ans sunit, testcases are autoloaded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
149 |
! |
76f50ac2e6a0
removed dependency on libutilui ans sunit, testcases are autoloaded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
150 |
|
76f50ac2e6a0
removed dependency on libutilui ans sunit, testcases are autoloaded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
151 |
version_SVN |
76f50ac2e6a0
removed dependency on libutilui ans sunit, testcases are autoloaded
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3
diff
changeset
|
152 |
^ '$Id$' |
0 | 153 |
! ! |