10 #include "QuoteForm.h" 11 #endif // WT_EMWEB_BUILD 14 #include <Wt/WAnchor.h> 15 #include <Wt/WStackedWidget.h> 16 #include <Wt/WTreeNode.h> 17 #include <Wt/WWidget.h> 18 #include <Wt/WViewWidget.h> 19 #include <Wt/WTabWidget.h> 20 #include <Wt/WMenuItem.h> 21 #include <Wt/WTable.h> 22 #include <Wt/WEnvironment.h> 23 #include <Wt/WLogger.h> 29 "JWt, Java Web Toolkit",
30 "jwt-home",
"css/jwt")
34 char* jwtExamplePath = getenv(
"JWT_EXAMPLE_PATH");
45 std::unique_ptr<WContainerWidget> result(cpp14::make_unique<WContainerWidget>());
47 std::unique_ptr<WText> intro(cpp14::make_unique<WText>(
tr(
"home.examples")));
48 intro->setInternalPathEncoding(
true);
49 result->addWidget(std::move(intro));
51 examplesMenu_ = result->addWidget(cpp14::make_unique<WTabWidget>());
52 WAnimation animation(AnimationEffect::SlideInFromRight, TimingFunction::EaseIn);
73 tr(
"widget-gallery"));
89 return std::move(result);
95 return cpp14::make_unique<QuoteForm>(QuoteForm::JWt);
103 return cpp14::make_unique<ExampleSourceViewer>(deployPath,
jwtExamplePath_ +
"/",
"JAVA");
106 std::unique_ptr<WWidget>
JWtHome::example(
const char *textKey,
const std::string& sourceDir)
108 std::unique_ptr<WContainerWidget> result = cpp14::make_unique<WContainerWidget>();
109 result->addWidget(cpp14::make_unique<WText>(
tr(textKey)));
111 return std::move(result);
116 return std::move(
example(
"home.examples.hello",
"hello"));
121 return std::move(
example(
"home.examples.chart",
"charts"));
126 return std::move(
example(
"home.examples.treeview",
"treeviewdragdrop"));
131 return std::move(
example(
"home.examples.composer",
"composer"));
136 return std::move(
example(
"home.examples.chat",
"simplechat"));
141 std::unique_ptr<WContainerWidget> result(cpp14::make_unique<WContainerWidget>());
142 WText *text = result->addWidget(cpp14::make_unique<WText>(
tr(
"home.examples.figtree")));
144 return std::move(result);
149 return std::move(
example(
"home.examples.widgetgallery",
"widgetgallery"));
154 return makeStaticModel(std::bind(createWidget,
this));
160 return cpp14::make_unique<JWtHome>(env, *blogDb);
virtual std::unique_ptr< WWidget > createQuoteForm()
std::unique_ptr< WWidget > figtreeExample()
std::unique_ptr< WWidget > chatExample()
std::unique_ptr< WWidget > linkSourceBrowser(const std::string &examplePath)
std::unique_ptr< WWidget > chartExample()
WString tr(const char *key)
std::unique_ptr< WWidget > wrapView(std::unique_ptr< WWidget >(JWtHome::*createFunction)())
virtual std::unique_ptr< WWidget > sourceViewer(const std::string &deployPath)
std::string jwtExamplePath_
std::unique_ptr< WWidget > helloWorldExample()
JWtHome(const WEnvironment &env, Dbo::SqlConnectionPool &blogDb)
std::unique_ptr< WWidget > widgetGalleryExample()
std::unique_ptr< WWidget > example(const char *textKey, const std::string &sourceDir)
void setInternalPathEncoding(bool enabled)
WTabWidget * examplesMenu_
std::unique_ptr< WWidget > treeviewExample()
virtual std::unique_ptr< WWidget > examples()
std::unique_ptr< Wt::WApplication > createWidget(const Wt::WEnvironment &env, SimpleChatServer &server)
std::unique_ptr< WApplication > createJWtHomeApplication(const WEnvironment &env, Dbo::SqlConnectionPool *blogDb)
std::unique_ptr< WWidget > composerExample()
void addLanguage(const Lang &l)
virtual Wt::Signals::connection connect(WObject *target, WObject::Method method) override
void googleAnalyticsLogger()