|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.AbstractLayout
com.vaadin.ui.CustomLayout
eu.livotov.tpt.i18n.TranslatableCustomLayout
public class TranslatableCustomLayout
This is a wrapper for standard CustomLayout class, that will use the internationalized layout file, based on a current application locale. Use it as normal CustomLayout class, however you must prepare the following structure in your theme-name/layouts folder for all of your supported languages:
+ ITMILLOnce you call new TranslatableLayout("my_layout"), it will adjust the actual layout name according to the current application locale, for instance, for Russian locale, it will load the following actual layout file: layouts/ru/my_layout.html
In case no layout file for current locale is found, TranslatableLayout will try to find layout file for the default language and then (in case of no success) fallback to the normal CustomLayout behaviour and load layout file from base layouts folder, e.g. theme-name/layouts/my_layout.html
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent |
---|
com.vaadin.ui.AbstractComponent.ComponentErrorEvent, com.vaadin.ui.AbstractComponent.ComponentErrorHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.Layout |
---|
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.MarginInfo, com.vaadin.ui.Layout.SpacingHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer |
---|
com.vaadin.ui.ComponentContainer.ComponentAttachEvent, com.vaadin.ui.ComponentContainer.ComponentAttachListener, com.vaadin.ui.ComponentContainer.ComponentDetachEvent, com.vaadin.ui.ComponentContainer.ComponentDetachListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.ErrorListener, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.terminal.Paintable |
---|
com.vaadin.terminal.Paintable.RepaintRequestEvent, com.vaadin.terminal.Paintable.RepaintRequestListener |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractLayout |
---|
margins |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
TranslatableCustomLayout(com.vaadin.Application app,
java.lang.String layoutName)
Creates a CustomLayout, trying to load the appropriate layout file for the given application locale. |
|
TranslatableCustomLayout(java.io.InputStream inputStream)
This constructor cannot be interbationalized because the pre-open input stream is provided. |
|
TranslatableCustomLayout(java.lang.String layoutName)
Creates a CustomLayout, trying to load the appropriate layout file for the current application locale. |
Method Summary | |
---|---|
protected boolean |
isLayoutTemplateExists(com.vaadin.Application app,
java.lang.String templateName)
|
protected java.lang.String |
resolveTemplateNameForTheApplicationLocale(java.util.Locale locale,
java.lang.String templateName)
|
Methods inherited from class com.vaadin.ui.CustomLayout |
---|
addComponent, addComponent, getComponent, getComponentIterator, getTemplateContents, getTemplateName, initTemplateContentsFromInputStream, paintContent, removeComponent, removeComponent, replaceComponent, setMargin, setMargin, setStyle, setTemplateContents, setTemplateName |
Methods inherited from class com.vaadin.ui.AbstractLayout |
---|
getMargin, setMargin |
Methods inherited from class com.vaadin.ui.AbstractComponentContainer |
---|
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addListener, addListener, addListener, addListener, addListener, addStyleName, changeVariables, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getLocale, getParent, getStyle, getStyleName, getTag, getWidth, getWidthUnits, getWindow, handleError, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUnits |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.ComponentContainer |
---|
addListener, addListener, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setParent, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId |
Methods inherited from interface com.vaadin.terminal.VariableOwner |
---|
changeVariables, isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits |
Constructor Detail |
---|
public TranslatableCustomLayout(java.lang.String layoutName)
layoutName
- layout template name, without any language prefixes, just like you use it
in plain CustomLayout class.public TranslatableCustomLayout(com.vaadin.Application app, java.lang.String layoutName)
layoutName
- layout template name, without any language prefixes, just like you use it
in plain CustomLayout class.public TranslatableCustomLayout(java.io.InputStream inputStream) throws java.io.IOException
inputStream
-
java.io.IOException
Method Detail |
---|
protected java.lang.String resolveTemplateNameForTheApplicationLocale(java.util.Locale locale, java.lang.String templateName)
protected boolean isLayoutTemplateExists(com.vaadin.Application app, java.lang.String templateName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |