|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractFocusable
com.vaadin.ui.Button
org.vostok.vaadin.addon.button.i18n.I18nButton
public class I18nButton
I18nButton extends com.vaadin.ui.Button
, it helps creating recurring button. With a single key passed to constructor, caption and icon are automatically set. Caption is
internationalized too..
There's over 200 defaults actions already defined and this can be easilly extended. .
Current button list http://vaadin.vostoksystem.eu/#!/i18nbuttonlist
Default language set to user locale ( UI.getCurrent().getLocale() ).
Current translation status available at : http://vaadin.vostoksystem.eu/Sample#!/i18nstate
German translation by Julie Rabier.
See sample at http://vaadin.vostoksystem.eu
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.ui.Button |
---|
com.vaadin.ui.Button.ClickEvent, com.vaadin.ui.Button.ClickListener, com.vaadin.ui.Button.ClickShortcut |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
com.vaadin.server.Sizeable.Unit |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.Button |
---|
clickShortcut |
Fields inherited from class com.vaadin.ui.AbstractComponent |
---|
DESIGN_ATTR_PLAIN_TEXT |
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
I18nButton()
backward compatibility. |
|
I18nButton(java.lang.String key)
create a new button with key key . |
|
I18nButton(java.lang.String key,
com.vaadin.ui.Button.ClickListener listener)
create a new button with key key . |
|
I18nButton(java.lang.String key,
java.lang.String style)
create a new button with key key . and add an user's style. |
|
I18nButton(java.lang.String key,
java.lang.String style,
com.vaadin.ui.Button.ClickListener listener)
create a new button with key key . and add an user's style. |
|
I18nButton(java.lang.String key,
java.lang.String style,
java.util.Locale locale,
com.vaadin.ui.Button.ClickListener listener)
Create an i18nButton for a specific locale |
Method Summary | |
---|---|
static java.lang.String |
getCaptionFor(java.lang.String key)
Return caption for key key with user's Locale. |
static java.lang.String |
getCaptionFor(java.lang.String key,
java.util.Locale locale)
Return caption for key key with locale locale . |
void |
setBorderless()
borderless icon, helper method, same as adding the valo class 'borderless' |
void |
setCaptionLess()
an helper method to create a button without caption, same as calling setCaption(null) |
void |
setHuge()
bigger icon, helper method, same as adding the valo class 'huge' |
Methods inherited from class com.vaadin.ui.Button |
---|
addClickListener, addListener, click, fireClick, fireClick, getCustomAttributes, getIconAlternateText, getState, getState, isDisableOnClick, isHtmlContentAllowed, readDesign, removeClickListener, removeClickShortcut, removeListener, setClickShortcut, setDisableOnClick, setHtmlContentAllowed, setIcon, setIconAlternateText, writeDesign |
Methods inherited from class com.vaadin.ui.AbstractFocusable |
---|
addBlurListener, addFocusListener, addListener, addListener, focus, getTabIndex, removeBlurListener, removeFocusListener, removeListener, removeListener, setTabIndex |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier |
---|
addShortcutListener, removeShortcutListener |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined |
Constructor Detail |
---|
public I18nButton()
java.lang.IllegalArgumentException
- : always.public I18nButton(java.lang.String key)
key
. If fail forkey
, return a default button.
key
- key
for button, if not found, will be used as caption.I18n
public I18nButton(java.lang.String key, com.vaadin.ui.Button.ClickListener listener)
key
. If fail forkey
, return a default button.
key
- key
for button, if not found, will be used as caption.listener
- ClickListener
to attach.I18n
public I18nButton(java.lang.String key, java.lang.String style)
key
. and add an user's style. Note this add, not replace style. If fail forkey
, return a default button.
key
- key
for button, if not found, will be used as caption.style
- user style. Can be null.I18n
public I18nButton(java.lang.String key, java.lang.String style, com.vaadin.ui.Button.ClickListener listener)
key
. and add an user's style. Note this add, not replace style. If fail forkey
, return a default button.
key
- key
for button, if not found, will be used as caption.style
- user style. Can be nulllistener
- ClickListener
to attach.I18n
public I18nButton(java.lang.String key, java.lang.String style, java.util.Locale locale, com.vaadin.ui.Button.ClickListener listener)
key
- key
for button, if not found, will be used as caption.style
- user style. Can be nulllocale
- java.util.Locale
to use. If null, default to UI.getCurrent().getLocale()listener
- ClickListener
to attach.I18n
Method Detail |
---|
public void setCaptionLess()
public void setHuge()
public void setBorderless()
public static java.lang.String getCaptionFor(java.lang.String key)
key
with user's Locale.
key
- key
for button
key
, or "unknow"
I18n
public static java.lang.String getCaptionFor(java.lang.String key, java.util.Locale locale)
key
with locale locale
.
key
- key
for buttonlocale
- Locale
to use
key
, or "unknow"
I18n
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |