WAHtmlElement


Seaside-Document

Comment:



Hierarchy:

ProtoObject
Object
WAHtmlElement

Summary:

instance variables:

attributes children isClosed name

methods:

instance class
as yet unclassified as yet unclassified

Detail:

instance variables:

attributes
inferredType:
UndefinedObject
children
inferredType:
UndefinedObject
isClosed
inferredType:
UndefinedObject
name
inferredType:
UndefinedObject

instance methods:

as yet unclassified
add: anElement

	children ifNil: [children _ OrderedCollection new].
	children add: anElement.
attributeAt: aString put: anObject

	attributes at: aString put: anObject
beClosed

	isClosed _ true
childrenDo: aBlock

	children ifNotNil: [children do: aBlock]
initializeWithName: aString attributes: anAttributes

	name _ aString.
	attributes _ anAttributes.
	isClosed _ true.
name

	^ name asLowercase
notClosed

	isClosed _ false
printCloseTagOn: aStream
 
	aStream
		nextPutAll: '</';
		nextPutAll: self name;
		nextPut: $>
printHtmlOn: aStream

	self printOpenTagOn: aStream.
	self childrenDo: [:ea | ea writeOn: aStream].
	self shouldPrintCloseTag ifTrue: [self printCloseTagOn: aStream].
printOpenTagOn: aStream
 
	aStream
		nextPut: $<;
		nextPutAll: self name.
	attributes ifNotNil: [attributes writeOn: aStream].
	self shouldPrintCloseTag ifFalse: [aStream nextPutAll: ' /'].
	aStream nextPut: $>
shouldPrintCloseTag

	^ isClosed
writeOn: aStream

	self printOpenTagOn: aStream.
	self childrenDo: [:ea | ea isString ifTrue: [aStream nextPutAll: ea] ifFalse: [ea writeOn: aStream]].
	self shouldPrintCloseTag ifTrue: [self printCloseTagOn: aStream].

class methods:

as yet unclassified
named: aString

	^ self named: aString attributes: (WAHtmlAttributes new)
named: aString attributes: anAttributes

	^ self new initializeWithName: aString attributes: anAttributes

^top


- made by Dandelion -