Wt examples: wt-homepage/ExampleSourceViewer.h Source File

Wt examples 4.10.4

Loading...
Searching...
No Matches
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 bv, Herent, Belgium
4 *
5 * See the LICENSE file for terms of use.
6 */
7
8#include <iostream>
9#include <stdlib.h>
10
11#include <Wt/WContainerWidget.h>
12#include <Wt/WTreeView.h>
13#include <Wt/WStandardItemModel.h>
14
15#include "FileItem.h"
16#include "SourceView.h"
17
18using namespace Wt;
19
23 class ExampleSourceViewer: public WContainerWidget
24{
25public:
28 ExampleSourceViewer(const std::string& deployPath,
29 const std::string& examplesRoot,
30 const std::string& examplesType);
31
32private:
33 WTreeView *exampleView_;
34 SourceView *sourceView_;
35
36 std::string deployPath_;
37 std::string examplesRoot_;
38 std::string examplesType_;
39
40 std::shared_ptr<WStandardItemModel> model_;
41
42 void cppTraverseDir(WStandardItem* parent,
43 const boost::filesystem::path& path);
44 void javaTraverseDir(WStandardItem* parent,
45 const boost::filesystem::path& path);
46 void javaTraversePackages(WStandardItem *parent,
47 const boost::filesystem::path& srcPath,
48 const std::string packageName);
49
52 void showFile();
53
54 void handlePathChange();
55
56 void setExample(const std::string& exampleDir,
57 const std::string& example);
58};
FileItem.h
SourceView.h
ExampleSourceViewer
A simple widget to visualise a set of example source files.
Definition ExampleSourceViewer.h:24
ExampleSourceViewer::cppTraverseDir
void cppTraverseDir(WStandardItem *parent, const boost::filesystem::path &path)
Definition ExampleSourceViewer.C:197
ExampleSourceViewer::setExample
void setExample(const std::string &exampleDir, const std::string &example)
Definition ExampleSourceViewer.C:100
ExampleSourceViewer::model_
std::shared_ptr< WStandardItemModel > model_
Definition ExampleSourceViewer.h:40
ExampleSourceViewer::ExampleSourceViewer
ExampleSourceViewer(const std::string &deployPath, const std::string &examplesRoot, const std::string &examplesType)
Constructor.
Definition ExampleSourceViewer.C:70
ExampleSourceViewer::javaTraversePackages
void javaTraversePackages(WStandardItem *parent, const boost::filesystem::path &srcPath, const std::string packageName)
Definition ExampleSourceViewer.C:299
ExampleSourceViewer::deployPath_
std::string deployPath_
Definition ExampleSourceViewer.h:36
ExampleSourceViewer::examplesType_
std::string examplesType_
Definition ExampleSourceViewer.h:38
ExampleSourceViewer::examplesRoot_
std::string examplesRoot_
Definition ExampleSourceViewer.h:37
ExampleSourceViewer::showFile
void showFile()
Displayed the currently selected file.
Definition ExampleSourceViewer.C:381
ExampleSourceViewer::handlePathChange
void handlePathChange()
Definition ExampleSourceViewer.C:83
ExampleSourceViewer::javaTraverseDir
void javaTraverseDir(WStandardItem *parent, const boost::filesystem::path &path)
Definition ExampleSourceViewer.C:335
ExampleSourceViewer::exampleView_
WTreeView * exampleView_
Definition ExampleSourceViewer.h:33
ExampleSourceViewer::sourceView_
SourceView * sourceView_
Definition ExampleSourceViewer.h:34
SourceView
View class for source code.
Definition SourceView.h:29
Wt
Definition AddresseeEdit.h:16