#include <JWtHome.h>
Inherits Home.
Public Member Functions | |
| JWtHome (const WEnvironment &env) | |
Protected Member Functions | |
| virtual WWidget * | examples () |
| virtual WWidget * | download () |
| virtual WWidget * | sourceViewer (const std::string &deployPath) |
| virtual std::string | filePrefix () const |
| WWidget * | wrapView (WWidget *(JWtHome::*createFunction)()) |
Private Member Functions | |
| WWidget * | example (const char *textKey, const std::string &sourceDir) |
| WWidget * | helloWorldExample () |
| WWidget * | chartExample () |
| WWidget * | composerExample () |
| WWidget * | treeviewExample () |
Private Attributes | |
| std::string | jwtExamplePath_ |
Definition at line 16 of file JWtHome.h.
| JWtHome::JWtHome | ( | const WEnvironment & | env | ) |
Definition at line 22 of file JWtHome.C.
: Home(env, "JWt, Java Web Toolkit", "jwt-home", "css/jwt") { addLanguage(Lang("en", "/", "en", "English")); char* jwtExamplePath = getenv("JWT_EXAMPLE_PATH"); if (jwtExamplePath) jwtExamplePath_ = jwtExamplePath; else jwtExamplePath_ = "/home/pieter/projects/jwt/wt-port/java/examples/"; init(); }
| WWidget * JWtHome::chartExample | ( | ) | [private] |
| WWidget * JWtHome::composerExample | ( | ) | [private] |
| WWidget * JWtHome::download | ( | ) | [protected, virtual] |
Implements Home.
Definition at line 77 of file JWtHome.C.
{
WContainerWidget *result = new WContainerWidget();
result->addWidget(new WText(tr("home.download")));
result->addWidget(new WText(tr("home.download.license")));
result->addWidget(new WText(tr("home.download.requirements")));
result->addWidget(new WText(tr("home.download.cvs")));
result->addWidget(new WText(tr("home.download.packages")));
releases_ = new WTable();
readReleases(releases_);
result->addWidget(releases_);
return result;
}
| WWidget * JWtHome::example | ( | const char * | textKey, | |
| const std::string & | sourceDir | |||
| ) | [private] |
Definition at line 98 of file JWtHome.C.
{
WContainerWidget *result = new WContainerWidget();
new WText(tr(textKey), result);
result->addWidget(linkSourceBrowser(sourceDir));
return result;
}
| WWidget * JWtHome::examples | ( | ) | [protected, virtual] |
Implements Home.
Definition at line 38 of file JWtHome.C.
{
WContainerWidget *result = new WContainerWidget();
result->addWidget(new WText(tr("home.examples")));
examplesMenu_ = new WTabWidget(AlignTop | AlignJustify, result);
/*
* The following code is functionally equivalent to:
*
* examplesMenu_->addTab(helloWorldExample(), "Hello world");
*
* However, we optimize here for memory consumption (it is a homepage
* after all, and we hope to be slashdotted some day)
*
* Therefore, we wrap all the static content (including the tree
* widgets), into WViewWidgets with static models. In this way the
* widgets are not actually stored in memory on the server.
*/
// The call ->setPathComponent() is to use "/examples/" instead of
// "/examples/hello_world" as internal path
examplesMenu_->addTab(wrapView(&JWtHome::helloWorldExample),
tr("hello-world"))->setPathComponent("");
examplesMenu_->addTab(wrapView(&JWtHome::chartExample),
tr("charts"));
examplesMenu_->addTab(wrapView(&JWtHome::treeviewExample),
tr("treeview"));
examplesMenu_->addTab(wrapView(&JWtHome::composerExample),
tr("mail-composer"));
// Enable internal paths for the example menu
examplesMenu_->setInternalPathEnabled("/examples");
examplesMenu_->currentChanged().connect(SLOT(this, Home::googleAnalyticsLogger));
return result;
}
| virtual std::string JWtHome::filePrefix | ( | ) | const [inline, protected, virtual] |
| WWidget * JWtHome::helloWorldExample | ( | ) | [private] |
| WWidget * JWtHome::sourceViewer | ( | const std::string & | deployPath | ) | [protected, virtual] |
Implements Home.
Definition at line 93 of file JWtHome.C.
{
return new ExampleSourceViewer(deployPath, jwtExamplePath_ + "/", "JAVA");
}
| WWidget * JWtHome::treeviewExample | ( | ) | [private] |
std::string JWtHome::jwtExamplePath_ [private] |
1.7.1