A generic information container that can be used to decorate AST entities

Introduced properties

private var _content: HTMLTag

nitc :: HInfoBox :: _content

The content of the popuped infobox
private var _href: nullable String

nitc :: HInfoBox :: _href

The primary link where the entity points
private var _title: String

nitc :: HInfoBox :: _title

A short title for the AST element
private var _visitor: HtmlightVisitor

nitc :: HInfoBox :: _visitor

The visitor used for contextualisation, if needed
fun content: HTMLTag

nitc :: HInfoBox :: content

The content of the popuped infobox
protected fun content=(content: HTMLTag)

nitc :: HInfoBox :: content=

The content of the popuped infobox
init defaultinit(visitor: HtmlightVisitor, title: String)

nitc :: HInfoBox :: defaultinit

fun href: nullable String

nitc :: HInfoBox :: href

The primary link where the entity points
protected fun href=(href: nullable String)

nitc :: HInfoBox :: href=

The primary link where the entity points
fun new_dropdown(title: String, text: String, text_is_html: nullable Bool): HTMLTag

nitc :: HInfoBox :: new_dropdown

Append a new dropdown in the popuped content
fun new_field(title: String): HTMLTag

nitc :: HInfoBox :: new_field

Append a new field in the popuped infobox
fun title: String

nitc :: HInfoBox :: title

A short title for the AST element
protected fun title=(title: String)

nitc :: HInfoBox :: title=

A short title for the AST element
fun visitor: HtmlightVisitor

nitc :: HInfoBox :: visitor

The visitor used for contextualisation, if needed
protected fun visitor=(visitor: HtmlightVisitor)

nitc :: HInfoBox :: visitor=

The visitor used for contextualisation, if needed

Redefined properties

redef type SELF: HInfoBox

nitc $ HInfoBox :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _content: HTMLTag

nitc :: HInfoBox :: _content

The content of the popuped infobox
private var _href: nullable String

nitc :: HInfoBox :: _href

The primary link where the entity points
private var _title: String

nitc :: HInfoBox :: _title

A short title for the AST element
private var _visitor: HtmlightVisitor

nitc :: HInfoBox :: _visitor

The visitor used for contextualisation, if needed
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun content: HTMLTag

nitc :: HInfoBox :: content

The content of the popuped infobox
protected fun content=(content: HTMLTag)

nitc :: HInfoBox :: content=

The content of the popuped infobox
init defaultinit(visitor: HtmlightVisitor, title: String)

nitc :: HInfoBox :: defaultinit

fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun href: nullable String

nitc :: HInfoBox :: href

The primary link where the entity points
protected fun href=(href: nullable String)

nitc :: HInfoBox :: href=

The primary link where the entity points
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
fun new_dropdown(title: String, text: String, text_is_html: nullable Bool): HTMLTag

nitc :: HInfoBox :: new_dropdown

Append a new dropdown in the popuped content
fun new_field(title: String): HTMLTag

nitc :: HInfoBox :: new_field

Append a new field in the popuped infobox
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun title: String

nitc :: HInfoBox :: title

A short title for the AST element
protected fun title=(title: String)

nitc :: HInfoBox :: title=

A short title for the AST element
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun visitor: HtmlightVisitor

nitc :: HInfoBox :: visitor

The visitor used for contextualisation, if needed
protected fun visitor=(visitor: HtmlightVisitor)

nitc :: HInfoBox :: visitor=

The visitor used for contextualisation, if needed
package_diagram nitc::HInfoBox HInfoBox core::Object Object nitc::HInfoBox->core::Object

Parents

interface Object

core :: Object

The root of the class hierarchy.

Class definitions

nitc $ HInfoBox
# A generic information container that can be used to decorate AST entities
class HInfoBox
	# The visitor used for contextualisation, if needed
	var visitor: HtmlightVisitor

	# A short title for the AST element
	var title: String

	# The primary link where the entity points
	# null if no link
	var href: nullable String = null

	# The content of the popuped infobox
	var content = new HTMLTag("div")

	# Append a new field in the popuped infobox
	fun new_field(title: String): HTMLTag
	do
		content.open("b").text(title)
		content.append(" ")
		var res = content.open("span")
		content.open("br")
		return res
	end

	# Append a new dropdown in the popuped content
	fun new_dropdown(title, text: String, text_is_html: nullable Bool): HTMLTag
	do
		content.add_raw_html """<div class="dropdown"> <a data-toggle="dropdown" href="#"><b>"""
		content.append(title)
		content.add_raw_html "</b> "
		if text_is_html == true then
			content.add_raw_html(text)
		else content.append(text)
		content.add_raw_html """<span class="caret"></span></a>"""
		var res = content.open("ul").add_class("dropdown-menu").attr("role", "menu").attr("aria-labelledby", "dLabel")
		content.add_raw_html "</div>"
		return res
	end
end
src/htmlight.nit:375,1--414,3