Wt examples  3.2.1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
JWtHome Class Reference

#include <JWtHome.h>

Inheritance diagram for JWtHome:
Inheritance graph
[legend]

Public Member Functions

 JWtHome (const WEnvironment &env)
- Public Member Functions inherited from Home
 Home (const WEnvironment &env, const std::string &title, const std::string &resourceBundle, const std::string &cssPath)
virtual ~Home ()
void googleAnalyticsLogger ()
- Public Member Functions inherited from Wt::WApplication
 WApplication (const WEnvironment &environment)
 ~WApplication ()
const WEnvironmentenvironment () const
WContainerWidgetroot () const
WWidgetfindWidget (const std::string &name)
void setTitle (const WString &title)
const WStringtitle () const
const WStringcloseMessage () const
WLocalizedStringslocalizedStrings ()
void setLocalizedStrings (WLocalizedStrings *stringResolver)
WMessageResourceBundlemessageResourceBundle ()
void setLocale (const std::string &locale)
std::string locale () const
virtual void refresh ()
void bindWidget (WWidget *widget, const std::string &domId)
std::string docRoot () const
std::string sessionId () const
void changeSessionId ()
void processEvents ()
void setAjaxMethod (AjaxMethod method)
AjaxMethod ajaxMethod () const
virtual void initialize ()
virtual void finalize ()
void setTwoPhaseRenderingThreshold (int size)
void setCookie (const std::string &name, const std::string &value, int maxAge, const std::string &domain="", const std::string &path="", bool secure=false)
void addMetaLink (const std::string &href, const std::string &rel, const std::string &media, const std::string &hreflang, const std::string &type, const std::string &sizes, bool disabled)
void removeMetaLink (const std::string &href)
void addMetaHeader (const std::string &name, const WString &content, const std::string &lang="")
void addMetaHeader (MetaHeaderType type, const std::string &name, const WString &content, const std::string &lang="")
void removeMetaHeader (MetaHeaderType type, const std::string &name="")
WLogEntry log (const std::string &type) const
void setLoadingIndicator (WLoadingIndicator *indicator)
WLoadingIndicatorloadingIndicator () const
void quit ()
bool isQuited () const
::int64_t maximumRequestSize () const
Signal< ::int64_t > & requestTooLarge ()
void setConfirmCloseMessage (const WString &message)
void deferRendering ()
void resumeRendering ()
boost::function< void()> bind (const F &f)
WCssStyleSheetstyleSheet ()
void useStyleSheet (const std::string &url)
void useStyleSheet (const std::string &url, const std::string &condition, const std::string &media="all")
void setCssTheme (const std::string &theme)
std::string cssTheme () const
void setLayoutDirection (LayoutDirection direction)
LayoutDirection layoutDirection () const
void setBodyClass (const std::string &styleClass)
std::string bodyClass () const
void setHtmlClass (const std::string &styleClass)
std::string htmlClass () const
std::string url (const std::string &internalPath=std::string()) const
virtual std::string makeAbsoluteUrl (const std::string &url) const
std::string resolveRelativeUrl (const std::string &url) const
std::string bookmarkUrl () const
std::string bookmarkUrl (const std::string &internalPath) const
void setInternalPath (const std::string &path, bool emitChange=false)
std::string internalPath () const
std::string internalPathNextPart (const std::string &path) const
std::string internalSubPath (const std::string &path) const
bool internalPathMatches (const std::string &path) const
Signal< std::string > & internalPathChanged ()
void redirect (const std::string &url)
void enableUpdates (bool enabled=true)
bool updatesEnabled () const
void triggerUpdate ()
UpdateLock getUpdateLock ()
void attachThread (bool attach=true)
void doJavaScript (const std::string &javascript, bool afterLoaded=true)
void addAutoJavaScript (const std::string &javascript)
void declareJavaScriptFunction (const std::string &name, const std::string &function)
bool require (const std::string &url, const std::string &symbol=std::string())
void setJavaScriptClass (const std::string &className)
std::string javaScriptClass ()
EventSignal< WKeyEvent > & globalKeyWentDown ()
EventSignal< WKeyEvent > & globalKeyPressed ()
EventSignal< WKeyEvent > & globalKeyWentUp ()
EventSignalglobalEnterPressed ()
EventSignalglobalEscapePressed ()
 WObject (WObject *parent=0)
virtual ~WObject ()
virtual const std::string id () const
void setObjectName (const std::string &name)
virtual std::string objectName () const
void resetLearnedSlots ()
void resetLearnedSlot (void(T::*method)())
WStatelessSlot * implementStateless (void(T::*method)())
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
void addChild (WObject *child)
virtual void removeChild (WObject *child)
const std::vector< WObject * > & children () const
WObjectparent () const

Protected Member Functions

virtual WWidgetexamples ()
virtual WWidgetcreateQuoteForm ()
virtual WWidgetsourceViewer (const std::string &deployPath)
virtual std::string filePrefix () const
WWidgetwrapView (WWidget *(JWtHome::*createFunction)())
- Protected Member Functions inherited from Home
void init ()
void addLanguage (const Lang &l)
WWidgetlinkSourceBrowser (const std::string &examplePath)
WString tr (const char *key)
std::string href (const std::string &url, const std::string &description)
void readReleases (WTable *releaseTable)
- Protected Member Functions inherited from Wt::WApplication
virtual void notify (const WEvent &e)
virtual bool isExposed (WWidget *w) const
virtual void enableAjax ()
virtual void unload ()
virtual WStatelessSlot * getStateless (Method method)

Private Member Functions

WWidgetexample (const char *textKey, const std::string &sourceDir)
WWidgethelloWorldExample ()
WWidgetchartExample ()
WWidgetcomposerExample ()
WWidgettreeviewExample ()
WWidgetchatExample ()
WWidgetfigtreeExample ()
WWidgetwidgetGalleryExample ()

Private Attributes

std::string jwtExamplePath_

Additional Inherited Members

- Public Types inherited from Wt::WApplication
enum  AjaxMethod
typedef Wt::ApplicationCreator ApplicationCreator
typedef void(WObject::* Method )()
typedef boost::function
< WApplication *(const
WEnvironment &)> 
ApplicationCreator
- Static Public Member Functions inherited from Wt::WApplication
static WApplicationinstance ()
static std::string resourcesUrl ()
static std::string appRoot ()
static bool readConfigurationProperty (const std::string &name, std::string &value)
- Public Attributes inherited from Wt::WApplication
 XMLHttpRequest
 DynamicScriptTag
- Static Protected Member Functions inherited from Wt::WApplication
static WObjectsender ()
- Protected Attributes inherited from Home
WTabWidgetexamplesMenu_
WTablereleases_

Detailed Description

Definition at line 16 of file JWtHome.h.

Constructor & Destructor Documentation

JWtHome::JWtHome ( const WEnvironment env)

Definition at line 27 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();
}

Member Function Documentation

WWidget * JWtHome::chartExample ( )
private

Definition at line 119 of file JWtHome.C.

{
return example("home.examples.chart", "charts");
}
WWidget * JWtHome::chatExample ( )
private

Definition at line 134 of file JWtHome.C.

{
return example("home.examples.chat", "simplechat");
}
WWidget * JWtHome::composerExample ( )
private

Definition at line 129 of file JWtHome.C.

{
return example("home.examples.composer", "composer");
}
WWidget * JWtHome::createQuoteForm ( )
protectedvirtual

Implements Home.

Definition at line 92 of file JWtHome.C.

{
#ifdef WT_EMWEB_BUILD
return new QuoteForm(QuoteForm::JWt);
#else
return 0;
#endif
}
WWidget * JWtHome::example ( const char *  textKey,
const std::string &  sourceDir 
)
private

Definition at line 106 of file JWtHome.C.

{
new WText(tr(textKey), result);
result->addWidget(linkSourceBrowser(sourceDir));
return result;
}
WWidget * JWtHome::examples ( )
protectedvirtual

Implements Home.

Definition at line 43 of file JWtHome.C.

{
WText *intro = new WText(tr("home.examples"));
result->addWidget(intro);
examplesMenu_ = new WTabWidget(AlignTop | AlignJustify, result);
WAnimation animation(WAnimation::SlideInFromRight, WAnimation::EaseIn);
/*
* 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
tr("hello-world"))->setPathComponent("");
tr("charts"));
tr("treeview"));
tr("mail-composer"));
tr("chat"));
tr("figtree"));
tr("widget-gallery"));
// Enable internal paths for the example menu
return result;
}
WWidget * JWtHome::figtreeExample ( )
private

Definition at line 139 of file JWtHome.C.

{
WText *text = new WText(tr("home.examples.figtree"), result);
return result;
}
virtual std::string JWtHome::filePrefix ( ) const
inlineprotectedvirtual

Implements Home.

Definition at line 25 of file JWtHome.h.

{ return "jwt-"; }
WWidget * JWtHome::helloWorldExample ( )
private

Definition at line 114 of file JWtHome.C.

{
return example("home.examples.hello", "hello");
}
WWidget * JWtHome::sourceViewer ( const std::string &  deployPath)
protectedvirtual

Implements Home.

Definition at line 101 of file JWtHome.C.

{
return new ExampleSourceViewer(deployPath, jwtExamplePath_ + "/", "JAVA");
}
WWidget * JWtHome::treeviewExample ( )
private

Definition at line 124 of file JWtHome.C.

{
return example("home.examples.treeview", "treeviewdragdrop");
}
WWidget * JWtHome::widgetGalleryExample ( )
private

Definition at line 147 of file JWtHome.C.

{
return example("home.examples.widgetgallery", "widgetgallery");
}
WWidget * JWtHome::wrapView ( WWidget *(JWtHome::*)()  createFunction)
protected

Definition at line 152 of file JWtHome.C.

{
return makeStaticModel(boost::bind(createWidget, this));
}

Member Data Documentation

std::string JWtHome::jwtExamplePath_
private

Definition at line 40 of file JWtHome.h.


The documentation for this class was generated from the following files:

Generated on Sat Oct 18 2014 for the C++ Web Toolkit (Wt) by doxygen 1.8.1.2