Class: Cheri::JRuby::Explorer::HtmlViewer

Inherits:
Viewer
  • Object
show all
Includes:
Html
Defined in:
lib/cheri/jruby/explorer/viewer.rb

Direct Known Subclasses

HtmlTableViewer

Constant Summary collapse

TblWidth =
'98%'
TColor =
'#080080'
HtmlStyle =
%q[
  .method { font-family: monospaced, courier; font-size: medium }
  .oid { font-family: monospaced, courier; }
  .var { font-family: monospaced, courier; font-weight: bold }
  .val { font-family: monospaced, courier; color: #000080 }
  .hdr { font-family: sans-serif; font-size: large; font-weight: bold; color: #000080 }
  body { font-family: sans-serif; }
]
ContType =
'text/html'

Constants included from Html

Html::Aliases, Html::HtmlConnecter, Html::Types, Html::VERSION

Constants included from Swing

Swing::SwingConnecter

Instance Attribute Summary

Attributes included from ViewerInterface

#icon, #instance, #main, #title, #tooltip, #type

Instance Method Summary collapse

Methods inherited from Viewer

#initialize

Methods included from ViewerInterface

#close_view, #icon_tab, #icon_tree, #initialize, #leaf?, #proxy, #tab, #title_tab, #title_tree

Constructor Details

This class inherits a constructor from Cheri::JRuby::Explorer::Viewer

Instance Method Details

#html_contentObject



310
311
# File 'lib/cheri/jruby/explorer/viewer.rb', line 310

def html_content
end

#html_documentObject



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/cheri/jruby/explorer/viewer.rb', line 281

def html_document
  html do
    head do
      style html_style          
    end
    # TODO: body attrs should be in style sheet
    body :bgcolor => :white do
      div :align => :left do
        html_heading
        html_content            
      end 
    end         
  end

end

#html_headingObject



297
298
299
# File 'lib/cheri/jruby/explorer/viewer.rb', line 297

def html_heading
  html_title
end

#html_styleObject



265
266
267
# File 'lib/cheri/jruby/explorer/viewer.rb', line 265

def html_style
  HtmlStyle 
end

#html_titleObject



301
302
303
304
305
306
307
308
# File 'lib/cheri/jruby/explorer/viewer.rb', line 301

def html_title
  table :width => TblWidth, :cellspacing => 2, :cellpadding => 2, :border => 0 do
    tr do 
      td esc(title), :class => :hdr, :align => :left, :colspan=> 2
    end
  end
  #h2 title, :align => :left, :text => TColor
end

#refreshObject



313
314
315
316
317
# File 'lib/cheri/jruby/explorer/viewer.rb', line 313

def refresh
  cheri_yield @html_view do
    html_document
  end
end

#view(&block) ⇒ Object



269
270
271
272
273
274
275
276
277
278
279
# File 'lib/cheri/jruby/explorer/viewer.rb', line 269

def view(&block)
  @view ||= scroll_pane do
    align :LEFT
    @html_view = editor_pane do
      editable false
      content_type ContType
      html_document
    end
  end
  super
end