public abstract class UIHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UIHelper.LayoutCreator
Helper to create a layout (Horizontal, Vertical, Form, ...) with none, one or
multiple components and allow basic configuration of the layout using
fluent API.
|
Constructor and Description |
---|
UIHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
closeSilently(Closeable closeable)
Closes the given Closeable silently.
|
static com.vaadin.ui.Button |
createButton(String buttonCaption,
String iconName) |
static com.vaadin.ui.Button |
createButton(String buttonCaption,
String iconName,
com.vaadin.ui.Button.ClickListener clickListener) |
static int |
enableTabs(com.vaadin.ui.TabSheet tabSheet,
ViewStateChangedEvent event,
int oldSelectedTabPosition)
This method enables or disables all tabs in a tabSheet.
|
static String |
loadContentFromFile(Class<?> clazz,
String resourceName)
Loads the
resourceName from the classpath using the given
clazz . |
static void |
showValidationError(String errorMessage)
Shows a validation error to the user.
|
public static com.vaadin.ui.Button createButton(String buttonCaption, String iconName, com.vaadin.ui.Button.ClickListener clickListener)
public static int enableTabs(com.vaadin.ui.TabSheet tabSheet, ViewStateChangedEvent event, int oldSelectedTabPosition)
ViewStatechangedEvent
is used. If the new view state is Edit
the method returns the last selected tab position. If the new view state
is not Edit the " oldSelectedTabPosition
" is selected in the
given tabSheet
.tabSheet
- the tabsheet to enable or disable all tabs inevent
- oldSelectedTabPosition
- which tab was selected before view state was Editpublic static void closeSilently(Closeable closeable)
Closeable.close()
occurs, the IOException is catched and logged.
No further information is forwarded.public static String loadContentFromFile(Class<?> clazz, String resourceName)
resourceName
from the classpath using the given
clazz
. If the resource couldn't be loaded an empty string is
returned.clazz
- The class to use for loading the resource.resourceName
- The name of the resource to be loaded (e.g.
/folder/filename.txt)public static void showValidationError(String errorMessage)
errorMessage
- the error message.Copyright © 2015. All rights reserved.