Belle II Software  release-05-02-19
InfoWidget Class Reference

text-based info viewer showing DataStore contents. More...

#include <InfoWidget.h>

Inheritance diagram for InfoWidget:
Collaboration diagram for InfoWidget:

Classes

struct  URI
 a parsed URI. More...
 

Public Member Functions

 InfoWidget (const TGWindow *p)
 ctor.
 
void update ()
 reset for new event (try to show same object if it exists).
 
void show (const char *uri="main:", bool clearSelection=true)
 Navigate to given URI. More...
 
void show (const TObject *obj)
 Navigate to page belonging to given object. More...
 
void back ()
 navigate to previous page, clearing current page from history.
 
virtual int IsVisited (const char *uri) override
 Used to colour visited links.
 

Private Member Functions

TString createMainPage () const
 create DataStore overview.
 
TString createArrayPage (const URI &uri) const
 create list of array contents.
 
TString createObjectPage (const URI &uri) const
 create object info.
 
TString getHeader (const URI &uri=URI()) const
 returns string with title, breadcrumbs, menu.
 
 ClassDefOverride (InfoWidget, 0)
 text-based info viewer showing DataStore contents.
 

Static Private Member Functions

static TString getContents (const TObject *obj)
 Get object contents (member data).
 
static TString getRelatedInfo (const TObject *obj)
 return HTML-formatted list of related objects.
 

Private Attributes

std::set< TString > m_visited
 list of all pages viewed in current event.
 
std::vector< TString > m_history
 ordered list of all pages viewed in current event.
 

Detailed Description

text-based info viewer showing DataStore contents.

Definition at line 20 of file InfoWidget.h.

Member Function Documentation

◆ show() [1/2]

void show ( const char *  uri = "main:",
bool  clearSelection = true 
)

Navigate to given URI.

Parameters
uriwhat to show, see InfoWidget::URI
clearSelectionwhen showing an object, this determines wether to clear an existing selection

Definition at line 86 of file InfoWidget.cc.

87 {
88  B2DEBUG(100, "Navigating to: " << uri);
89 
90  if (std::string(uri) == "back:") {
91  back();
92  return;
93  }
94 
95  m_visited.insert(uri);
96  m_history.push_back(uri);
97 
98  URI parsedURI = URI(uri);
99  TString info;
100  if (parsedURI.object) {
101  info = createObjectPage(parsedURI);
102 
103  //highlight in display
104  if (clearSelection)
106  VisualRepMap::getInstance()->select(parsedURI.object);
107  } else if (parsedURI.entryName != "") {
108  info = createArrayPage(parsedURI);
109  } else {
110  info = createMainPage();
111  }
112  info = "<html><body>" + info + "</body></html>";
113 
114  Clear();
115  //string only passed to function taking const char*...
116  ParseText(const_cast<char*>(info.Data()));
117  Layout();
118 }

◆ show() [2/2]

void show ( const TObject *  obj)

Navigate to page belonging to given object.

Special in that it doesn't clear the current selection.

Definition at line 81 of file InfoWidget.cc.


The documentation for this class was generated from the following files:
Belle2::InfoWidget::m_history
std::vector< TString > m_history
ordered list of all pages viewed in current event.
Definition: InfoWidget.h:88
Belle2::InfoWidget::back
void back()
navigate to previous page, clearing current page from history.
Definition: InfoWidget.cc:72
Belle2::InfoWidget::m_visited
std::set< TString > m_visited
list of all pages viewed in current event.
Definition: InfoWidget.h:86
Belle2::VisualRepMap::select
void select(const TObject *object) const
Select the representation of the given object.
Definition: VisualRepMap.cc:89
Belle2::VisualRepMap::getInstance
static VisualRepMap * getInstance()
get instance pointer.
Definition: VisualRepMap.cc:38
Belle2::VisualRepMap::clearSelection
void clearSelection() const
Clear existing selection in Eve Browser.
Definition: VisualRepMap.cc:129
Belle2::InfoWidget::createArrayPage
TString createArrayPage(const URI &uri) const
create list of array contents.
Definition: InfoWidget.cc:172
Belle2::InfoWidget::createObjectPage
TString createObjectPage(const URI &uri) const
create object info.
Definition: InfoWidget.cc:191
Belle2::InfoWidget::createMainPage
TString createMainPage() const
create DataStore overview.
Definition: InfoWidget.cc:120