Basic element of browsable hierarchy.
Provides access to data, creates iterator if any
Definition at line 34 of file RElement.hxx.
Public Types | |
enum | EActionKind { kActNone , kActBrowse , kActEdit , kActImage , kActDraw6 , kActDraw7 , kActCanvas , kActTree , kActGeom } |
Possible actions on double-click. More... | |
enum | EContentKind { kNone , kText , kImage , kPng , kJpeg , kJson , kFileName } |
Public Member Functions | |
virtual | ~RElement ()=default |
virtual bool | cd () |
Select element as active. | |
virtual bool | CheckValid () |
Check if element still contains valid content. | |
virtual std::unique_ptr< RItem > | CreateItem () const |
Returns item with element description. | |
virtual std::unique_ptr< RLevelIter > | GetChildsIter () |
Create iterator for childs elements if any. | |
virtual std::string | GetContent (const std::string &="text") |
Returns element content, depends from kind. | |
virtual EActionKind | GetDefaultAction () const |
Get default action. | |
virtual std::string | GetName () const =0 |
Name of browsable, must be provided in derived classes. | |
virtual int | GetNumChilds () |
Returns number of childs By default creates iterator and iterates over all items. | |
virtual std::unique_ptr< RHolder > | GetObject () |
Access object. | |
virtual std::string | GetTitle () const |
Title of browsable (optional) | |
virtual bool | IsCapable (EActionKind action) const |
Check if want to perform action. | |
virtual bool | IsExpandByDefault () const |
Should item representing element be expand by default. | |
virtual bool | IsFolder () const |
Check if element can have childs. | |
virtual bool | IsObject (void *) |
Check if element contains provided pointer. | |
virtual bool | MatchName (const std::string &name) const |
Checks if element name match to provided value. | |
Static Public Member Functions | |
static int | ComparePaths (const RElementPath_t &path1, const RElementPath_t &path2) |
Compare two paths, Returns number of elements matches in both paths. | |
static int | ExtractItemIndex (std::string &name) |
Extract index from name Index coded by client with ###<indx>$$$ suffix Such coding used by browser to identify element by index. | |
static EContentKind | GetContentKind (const std::string &kind) |
Find item with specified name Default implementation, should work for all. | |
static std::string | GetPathAsString (const RElementPath_t &path) |
Converts element path back to string. | |
static std::shared_ptr< RElement > | GetSubElement (std::shared_ptr< RElement > &elem, const RElementPath_t &path) |
Returns sub element. | |
static RElementPath_t | ParsePath (const std::string &str) |
Parse string path to produce RElementPath_t One should avoid to use string pathes as much as possible. | |
#include <ROOT/Browsable/RElement.hxx>
Possible actions on double-click.
Definition at line 50 of file RElement.hxx.
Definition at line 37 of file RElement.hxx.
|
virtualdefault |
Select element as active.
Reimplemented in TDirectoryElement.
Definition at line 103 of file RElement.hxx.
Check if element still contains valid content.
Reimplemented in ROOT::Browsable::TObjectElement.
Definition at line 91 of file RElement.hxx.
|
static |
Compare two paths, Returns number of elements matches in both paths.
Definition at line 145 of file RElement.cxx.
|
virtual |
Returns item with element description.
Reimplemented in ROOT::Browsable::TObjectElement, RNTupleElement, and TKeyElement.
Definition at line 105 of file RElement.cxx.
|
static |
Extract index from name Index coded by client with ###<indx>$$$
suffix Such coding used by browser to identify element by index.
Definition at line 178 of file RElement.cxx.
|
virtual |
Create iterator for childs elements if any.
Returns child iterator (if any)
Reimplemented in ROOT::Browsable::RGroup, ROOT::Browsable::RSysFile, ROOT::Browsable::RWrapper, ROOT::Browsable::TObjectElement, RFieldElement, RNTupleElement, TBrBrowsableElement, TDirectoryElement, TKeyElement, ROOT::Browsable::TGeoVolumeElement, ROOT::Browsable::TGeoNodeElement, ROOT::Browsable::TGeoManagerElement, TFolderElement, and TCollectionElement.
Definition at line 30 of file RElement.cxx.
|
virtual |
Returns element content, depends from kind.
Returns string content like text file content or json representation.
Can be "text" or "image64" or "json"
Reimplemented in ROOT::Browsable::RSysFile, TTreeBrowsingElement, TDirectoryElement, and ROOT::Browsable::RWrapper.
Definition at line 90 of file RElement.cxx.
|
static |
Find item with specified name Default implementation, should work for all.
Definition at line 52 of file RElement.cxx.
|
inlinevirtual |
Get default action.
Reimplemented in ROOT::Browsable::RSysFile, ROOT::Browsable::RWrapper, ROOT::Browsable::TObjectElement, RFieldElement, TTreeBrowsingElement, TTreeElement, TDirectoryElement, TKeyElement, ROOT::Browsable::TGeoVolumeElement, ROOT::Browsable::TGeoNodeElement, ROOT::Browsable::TGeoManagerElement, and TColorElement.
Definition at line 94 of file RElement.hxx.
|
pure virtual |
Name of browsable, must be provided in derived classes.
Implemented in ROOT::Browsable::RGroup, ROOT::Browsable::RSysFile, ROOT::Browsable::RWrapper, ROOT::Browsable::TObjectElement, RFieldElement, RNTupleElement, TDirectoryElement, and TKeyElement.
|
virtual |
Returns number of childs By default creates iterator and iterates over all items.
Reimplemented in TBrBrowsableElement, TFolderElement, and TCollectionElement.
Definition at line 39 of file RElement.cxx.
Access object.
Reimplemented in ROOT::Browsable::RWrapper, ROOT::Browsable::TObjectElement, RFieldElement, and TKeyElement.
Definition at line 80 of file RElement.hxx.
|
static |
Converts element path back to string.
Definition at line 160 of file RElement.cxx.
|
static |
Returns sub element.
Definition at line 69 of file RElement.cxx.
|
inlinevirtual |
Title of browsable (optional)
Reimplemented in ROOT::Browsable::RGroup, ROOT::Browsable::RSysFile, ROOT::Browsable::RWrapper, ROOT::Browsable::TObjectElement, RFieldElement, RNTupleElement, TDirectoryElement, and TKeyElement.
Definition at line 71 of file RElement.hxx.
|
inlinevirtual |
Check if want to perform action.
Reimplemented in ROOT::Browsable::RWrapper, TTreeBrowsingElement, TTreeElement, TKeyElement, ROOT::Browsable::TGeoVolumeElement, ROOT::Browsable::TGeoNodeElement, ROOT::Browsable::TGeoManagerElement, RFieldElement, and ROOT::Browsable::TObjectElement.
Definition at line 97 of file RElement.hxx.
Should item representing element be expand by default.
Reimplemented in ROOT::Browsable::RWrapper.
Definition at line 100 of file RElement.hxx.
Check if element can have childs.
Reimplemented in ROOT::Browsable::TObjectElement, TDirectoryElement, TKeyElement, ROOT::Browsable::TGeoVolumeElement, and ROOT::Browsable::TGeoManagerElement.
Definition at line 86 of file RElement.hxx.
Check if element contains provided pointer.
Reimplemented in ROOT::Browsable::TObjectElement.
Definition at line 83 of file RElement.hxx.
Checks if element name match to provided value.
Reimplemented in ROOT::Browsable::RSysFile.
Definition at line 68 of file RElement.hxx.
|
static |
Parse string path to produce RElementPath_t One should avoid to use string pathes as much as possible.
Definition at line 116 of file RElement.cxx.