Wt examples  3.3.12
ExampleSourceViewer.h
Go to the documentation of this file.
1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2009 Emweb bvba
4  *
5  * See the LICENSE file for terms of use.
6  */
7 
8 #include <iostream>
9 #include <stdlib.h>
10 
11 #include <Wt/WContainerWidget>
12 #include <Wt/WTreeView>
13 #include <Wt/WStandardItemModel>
14 
15 #include "FileItem.h"
16 #include "SourceView.h"
17 
21 class ExampleSourceViewer: public Wt::WContainerWidget
22 {
23 public:
26  ExampleSourceViewer(const std::string& deployPath,
27  const std::string& examplesRoot,
28  const std::string& examplesType);
29 
30 private:
31  Wt::WTreeView *exampleView_;
33 
34  std::string deployPath_;
35  std::string examplesRoot_;
36  std::string examplesType_;
37 
38  Wt::WStandardItemModel *model_;
39 
40  void cppTraverseDir(Wt::WStandardItem* parent,
41  const boost::filesystem::path& path);
42  void javaTraverseDir(Wt::WStandardItem* parent,
43  const boost::filesystem::path& path);
44  void javaTraversePackages(Wt::WStandardItem *parent,
45  const boost::filesystem::path& srcPath,
46  const std::string packageName);
47 
50  void showFile();
51 
52  void handlePathChange();
53 
54  void setExample(const std::string& exampleDir,
55  const std::string& example);
56 };
ExampleSourceViewer::model_
Wt::WStandardItemModel * model_
Definition: ExampleSourceViewer.h:38
ExampleSourceViewer::examplesType_
std::string examplesType_
Definition: ExampleSourceViewer.h:36
ExampleSourceViewer::examplesRoot_
std::string examplesRoot_
Definition: ExampleSourceViewer.h:35
ExampleSourceViewer::ExampleSourceViewer
ExampleSourceViewer(const std::string &deployPath, const std::string &examplesRoot, const std::string &examplesType)
Constructor.
Definition: ExampleSourceViewer.C:71
ExampleSourceViewer::showFile
void showFile()
Displayed the currently selected file.
Definition: ExampleSourceViewer.C:365
SourceView
View class for source code.
Definition: SourceView.h:26
ExampleSourceViewer::javaTraverseDir
void javaTraverseDir(Wt::WStandardItem *parent, const boost::filesystem::path &path)
Definition: ExampleSourceViewer.C:324
ExampleSourceViewer::javaTraversePackages
void javaTraversePackages(Wt::WStandardItem *parent, const boost::filesystem::path &srcPath, const std::string packageName)
Definition: ExampleSourceViewer.C:290
ExampleSourceViewer::exampleView_
Wt::WTreeView * exampleView_
Definition: ExampleSourceViewer.h:31
ExampleSourceViewer::sourceView_
SourceView * sourceView_
Definition: ExampleSourceViewer.h:32
ExampleSourceViewer
A simple widget to visualise a set of example source files.
Definition: ExampleSourceViewer.h:21
ExampleSourceViewer::handlePathChange
void handlePathChange()
Definition: ExampleSourceViewer.C:84
ExampleSourceViewer::cppTraverseDir
void cppTraverseDir(Wt::WStandardItem *parent, const boost::filesystem::path &path)
Definition: ExampleSourceViewer.C:194
FileItem.h
SourceView.h
ExampleSourceViewer::setExample
void setExample(const std::string &exampleDir, const std::string &example)
Definition: ExampleSourceViewer.C:101
ExampleSourceViewer::deployPath_
std::string deployPath_
Definition: ExampleSourceViewer.h:34

Generated on Fri Apr 24 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.17