Parent

Class Index [+]

Quicksearch

TaskJuggler::ReportTableLine

Attributes

table[R]
property[R]
scopeLine[R]
height[RW]
indentation[RW]
fontSize[RW]
bold[RW]
no[RW]
lineNo[RW]
subLineNo[RW]

Public Class Methods

new(table, property, scopeLine) click to toggle source

Create a ReportTableCell object and initialize the variables with default values. table is a reference to the ReportTable object this line belongs to. property is a reference to the Task or Resource that is displayed in this line. scopeLine is the line that sets the scope for this line. The value is nil if this is a primary line.

    # File lib/taskjuggler/reports/ReportTableLine.rb, line 29
29:     def initialize(table, property, scopeLine)
30:       @table = table
31:       @property = property
32:       @scopeLine = scopeLine
33: 
34:       # Register the new line with the table it belongs to.
35:       @table.addLine(self)
36:       # The cells of this line. Should be references to ReportTableCell objects.
37:       @cells = []
38:       # Heigh of the line in screen pixels
39:       @height = 21
40:       # Indentation for hierachiecal columns in screen pixels.
41:       @indentation = 0
42:       # The factor used to enlarge or shrink the font size for this line.
43:       @fontSize = 12
44:       # Specifies whether the whole line should be in bold type or not.
45:       @bold = false
46:       # Counter that counts primary and nested lines separately. It restarts
47:       # with 0 for each new nested line set. Scenario lines don't count.
48:       @no = nil
49:       # Counter that counts the primary lines. Scenario lines don't count.
50:       @lineNo = nil
51:       # Counter that counts all lines.
52:       @subLineNo = nil
53:     end

Public Instance Methods

addCell(cell) click to toggle source

Add the new cell to the line. cell must reference a ReportTableCell object.

    # File lib/taskjuggler/reports/ReportTableLine.rb, line 66
66:     def addCell(cell)
67:       @cells << cell
68:     end
last(count = 0) click to toggle source

Return the last non-hidden cell of the line. Start to look for the cell at the first cell after count cells.

    # File lib/taskjuggler/reports/ReportTableLine.rb, line 57
57:     def last(count = 0)
58:       (1 + count).upto(@cells.length) do |i|
59:         return @cells[-i] unless @cells[-i].hidden
60:       end
61:       nil
62:     end
scopeProperty() click to toggle source

Return the scope property or nil

    # File lib/taskjuggler/reports/ReportTableLine.rb, line 71
71:     def scopeProperty
72:       @scopeLine ? @scopeLine.property : nil
73:     end
to_csv(csv, startColumn, lineIdx) click to toggle source

Convert the intermediate format into an Array of values. One entry for every column cell of this line.

    # File lib/taskjuggler/reports/ReportTableLine.rb, line 87
87:     def to_csv(csv, startColumn, lineIdx)
88:       columnIdx = startColumn
89:       @cells.each do |cell|
90:         columnIdx += cell.to_csv(csv, columnIdx, lineIdx)
91:       end
92:       columnIdx - startColumn
93:     end
to_html() click to toggle source

Return this line as a set of XMLElement that represent the line in HTML.

    # File lib/taskjuggler/reports/ReportTableLine.rb, line 76
76:     def to_html
77:       style = ""
78:       style += "height:#{@height}px; " if @table.equiLines
79:       style += "font-size:#{@fontSize}px; " if @fontSize
80:       tr = XMLElement.new('tr', 'class' => 'tabline', 'style' => style)
81:       @cells.each { |cell| tr << cell.to_html }
82:       tr
83:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.