Class: HLabelTag
Instance Attribute Summary collapse
-
#modelName ⇒ Object
Returns the value of attribute modelName.
-
#name ⇒ Object
Returns the value of attribute name.
-
#placeholder ⇒ Object
Returns the value of attribute placeholder.
Attributes inherited from HWidget
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(name = "", modelName = "", placeholder = "") ⇒ HLabelTag
constructor
A new instance of HLabelTag.
- #setCarriageReturn(value = true) ⇒ Object
Methods inherited from HWidget
#_addJsSlot, #_set, #_setStyle, #addJsFunction, #appendChild, #appendChilds, #buildSignature, #closeTag, #connect, #copyConstructor, #get, #getChilds, #getElementBy, #getSystemProperty, #hotLog, #openTag, #replacePlaceholder, #reset, #set, #setChilds, #setCloseTag, #setClosedTag, #setEnablePlaceholder, #setInnerHTML, #setParent, #setPlaceholder, #setPlaceholders, #setProperties, #setSlots, #setStyle, #setStyles, #setSystemProperties, #setSystemProperty, #setTag, #storeSlots, #storeStyle, #strProperties, test, #unset, widgetSpace
Constructor Details
#initialize(name = "", modelName = "", placeholder = "") ⇒ HLabelTag
Returns a new instance of HLabelTag.
5 6 7 8 9 10 11 |
# File 'lib/hwidgets/hlabeltag.rb', line 5 def initialize(name = "", modelName = "", placeholder = "") super("label") @name = name @modelName = modelName @placeholder = placeholder @carriageReturn = false end |
Instance Attribute Details
#modelName ⇒ Object
Returns the value of attribute modelName.
3 4 5 |
# File 'lib/hwidgets/hlabeltag.rb', line 3 def modelName @modelName end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/hwidgets/hlabeltag.rb', line 3 def name @name end |
#placeholder ⇒ Object
Returns the value of attribute placeholder.
3 4 5 |
# File 'lib/hwidgets/hlabeltag.rb', line 3 def placeholder @placeholder end |
Instance Method Details
#html ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hwidgets/hlabeltag.rb', line 18 def html() return "" if(@placeholder == nil) cr = (@carriageReturn) ? HIO.htmlEcholn("<br/>") : "" self.set(for: "#{@modelName}_#{@name}"). setInnerHTML(@placeholder) return super() + cr end |
#setCarriageReturn(value = true) ⇒ Object
13 14 15 16 |
# File 'lib/hwidgets/hlabeltag.rb', line 13 def setCarriageReturn(value = true) @carriageReturn = value return self end |