com.xpn.xwiki.gwt.api.client.app
Class XWikiGWTDefaultApp

java.lang.Object
  extended by com.xpn.xwiki.gwt.api.client.app.XWikiGWTDefaultApp
All Implemented Interfaces:
XWikiGWTApp

public class XWikiGWTDefaultApp
extends java.lang.Object
implements XWikiGWTApp

See the NOTICE file distributed with this work for additional information regarding copyright ownership.

This is free software;you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation;either version2.1of the License,or(at your option)any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this software;if not,write to the Free Software Foundation,Inc.,51 Franklin St,Fifth Floor,Boston,MA 02110-1301 USA,or see the FSF site:http://www.fsf.org.

Author:
ldubost

Field Summary
protected  LoadingDialog loadingDialog
           
protected  java.lang.String name
           
protected  XWikiServiceAsync serviceInstance
           
protected  Translator translator
           
 
Constructor Summary
XWikiGWTDefaultApp()
           
 
Method Summary
 void checkTranslator(com.google.gwt.user.client.rpc.AsyncCallback cback)
          Check if translator is loaded.
 void finishLoading()
          Closes the loading box if the number of calls to finish are equal to the number of call to startLoading
static int getAbsoluteTop(com.google.gwt.user.client.ui.Widget widget)
           
 java.lang.String getCSSPrefix()
          Returns the css prefix of the app
 java.lang.String getLocale()
          Returns the locale of the app
 java.lang.String getName()
          Returns the name of the app
 java.lang.String getParam(java.lang.String key)
           
 java.lang.String getParam(java.lang.String key, java.lang.String defaultValue)
           
 int getParamAsInt(java.lang.String key)
           
 int getParamAsInt(java.lang.String key, int defaultValue)
           
static java.lang.String getProperty(java.lang.String name)
          Native method in JavaScript to access gwt:property
 java.lang.String getSkin()
          Allows to acces the name of the skin provided in gwt params
 java.lang.String getSkinBaseURL()
          Allows to access the skin base url provided in gwt params
 java.lang.String getSkinFile(java.lang.String file)
          Constructs a skin file URL
 java.lang.String getTranslation(java.lang.String key)
          Provides a translated string
 java.lang.String getTranslation(java.lang.String key, java.lang.String[] args)
          Provides a translated string
 java.lang.String getTranslationPage()
          Allows to access the name of the translations page provided in gwt parameters
static java.lang.String getUserAgent()
           
 XWikiServiceAsync getXWikiServiceInstance()
          Creates an instance of an XWiki Service
static boolean isGecki()
           
static boolean isMSIE()
           
static boolean isSafari()
           
 boolean isTranslatorLoaded()
           
 void onModuleLoad()
           
static void setMaxHeight(com.google.gwt.user.client.ui.Widget widget)
           
 void setName(java.lang.String name)
           
 void showDialog(java.lang.String message)
           
 void showDialog(java.lang.String title, java.lang.String message)
           
 void showError(java.lang.String text)
           
 void showError(java.lang.String code, java.lang.String text)
           
 void showError(java.lang.Throwable caught)
           
 void startLoading()
          Launches the loading box
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

translator

protected Translator translator

loadingDialog

protected LoadingDialog loadingDialog

serviceInstance

protected XWikiServiceAsync serviceInstance

name

protected java.lang.String name
Constructor Detail

XWikiGWTDefaultApp

public XWikiGWTDefaultApp()
Method Detail

onModuleLoad

public void onModuleLoad()

getName

public java.lang.String getName()
Description copied from interface: XWikiGWTApp
Returns the name of the app

Specified by:
getName in interface XWikiGWTApp

setName

public void setName(java.lang.String name)

getProperty

public static java.lang.String getProperty(java.lang.String name)
Native method in JavaScript to access gwt:property


getParam

public java.lang.String getParam(java.lang.String key)

getParam

public java.lang.String getParam(java.lang.String key,
                                 java.lang.String defaultValue)

getParamAsInt

public int getParamAsInt(java.lang.String key)

getParamAsInt

public int getParamAsInt(java.lang.String key,
                         int defaultValue)

getTranslationPage

public java.lang.String getTranslationPage()
Allows to access the name of the translations page provided in gwt parameters

Specified by:
getTranslationPage in interface XWikiGWTApp
Returns:

getSkinBaseURL

public java.lang.String getSkinBaseURL()
Allows to access the skin base url provided in gwt params

Returns:

getSkin

public java.lang.String getSkin()
Allows to acces the name of the skin provided in gwt params

Returns:

getTranslation

public java.lang.String getTranslation(java.lang.String key)
Provides a translated string

Specified by:
getTranslation in interface XWikiGWTApp
Parameters:
key -
Returns:

getTranslation

public java.lang.String getTranslation(java.lang.String key,
                                       java.lang.String[] args)
Provides a translated string

Specified by:
getTranslation in interface XWikiGWTApp
Parameters:
key -
Returns:

getXWikiServiceInstance

public XWikiServiceAsync getXWikiServiceInstance()
Creates an instance of an XWiki Service

Specified by:
getXWikiServiceInstance in interface XWikiGWTApp
Returns:

getSkinFile

public java.lang.String getSkinFile(java.lang.String file)
Constructs a skin file URL

Specified by:
getSkinFile in interface XWikiGWTApp
Parameters:
file -
Returns:

startLoading

public void startLoading()
Launches the loading box

Specified by:
startLoading in interface XWikiGWTApp

finishLoading

public void finishLoading()
Closes the loading box if the number of calls to finish are equal to the number of call to startLoading

Specified by:
finishLoading in interface XWikiGWTApp

isTranslatorLoaded

public boolean isTranslatorLoaded()
Specified by:
isTranslatorLoaded in interface XWikiGWTApp

checkTranslator

public void checkTranslator(com.google.gwt.user.client.rpc.AsyncCallback cback)
Check if translator is loaded. This needs to be called.

Parameters:
cback - Where to call previousStep after the translator is loaded.

showDialog

public void showDialog(java.lang.String title,
                       java.lang.String message)
Specified by:
showDialog in interface XWikiGWTApp
Parameters:
title -
message -

showDialog

public void showDialog(java.lang.String message)
Specified by:
showDialog in interface XWikiGWTApp
Parameters:
message -

showError

public void showError(java.lang.Throwable caught)
Specified by:
showError in interface XWikiGWTApp

showError

public void showError(java.lang.String text)
Specified by:
showError in interface XWikiGWTApp

showError

public void showError(java.lang.String code,
                      java.lang.String text)
Specified by:
showError in interface XWikiGWTApp

getCSSPrefix

public java.lang.String getCSSPrefix()
Description copied from interface: XWikiGWTApp
Returns the css prefix of the app

Specified by:
getCSSPrefix in interface XWikiGWTApp
Returns:

getUserAgent

public static java.lang.String getUserAgent()

isMSIE

public static boolean isMSIE()

isGecki

public static boolean isGecki()

isSafari

public static boolean isSafari()

getAbsoluteTop

public static int getAbsoluteTop(com.google.gwt.user.client.ui.Widget widget)

setMaxHeight

public static void setMaxHeight(com.google.gwt.user.client.ui.Widget widget)

getLocale

public java.lang.String getLocale()
Description copied from interface: XWikiGWTApp
Returns the locale of the app

Specified by:
getLocale in interface XWikiGWTApp
Returns:


Copyright © 2004-2008 XWiki. All Rights Reserved.