Class: TaskJuggler::RTFNavigator

Inherits:
RichTextFunctionHandler show all
Defined in:
lib/taskjuggler/RichText/RTFNavigator.rb

Overview

This class is a specialized RichTextFunctionHandler that generates a navigation bar for all reports that match the specified LogicalExpression. It currently only supports HTML.

Instance Attribute Summary

Attributes inherited from RichTextFunctionHandler

#blockFunction, #function

Instance Method Summary collapse

Methods included from MessageHandler

#critical, #debug, #error, #fatal, #info, #warning

Constructor Details

#initialize(project, sourceFileInfo = nil) ⇒ RTFNavigator

Returns a new instance of RTFNavigator.



26
27
28
29
30
# File 'lib/taskjuggler/RichText/RTFNavigator.rb', line 26

def initialize(project, sourceFileInfo = nil)
  @project = project
  super('navigator', sourceFileInfo)
  @blockFunction = true
end

Instance Method Details

#to_html(args) ⇒ Object

Return a XMLElement tree that represents the navigator in HTML code.



38
39
40
41
42
43
44
45
46
47
# File 'lib/taskjuggler/RichText/RTFNavigator.rb', line 38

def to_html(args)
  if args.nil? || (id = args['id']).nil?
    error('rtf_nav_id_missing',
          "Argument 'id' missing to specify the navigator to be used.")
  end
  unless (navBar = @project['navigators'][id])
    error('rtf_nav_unknown_id', "Unknown navigator #{id}")
  end
  navBar.to_html
end

#to_s(args) ⇒ Object

Not supported for this function



33
34
35
# File 'lib/taskjuggler/RichText/RTFNavigator.rb', line 33

def to_s(args)
  ''
end

#to_tagged(args) ⇒ Object

Not supported for this function.



50
51
52
# File 'lib/taskjuggler/RichText/RTFNavigator.rb', line 50

def to_tagged(args)
  nil
end