Package com.storedobject.vaadin
Interface ApplicationEnvironment
- All Known Implementing Classes:
SOEnvironment
public interface ApplicationEnvironment
Application can set up an environment that controls certain behaviours of the application.- Author:
- Syam
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringcreateLabel(Class<?> aClass) Create a label for displaying a particular class name.default StringcreateLabel(String attributeName) Create a label for the attribute name passed.default ApplicationMenuItemcreateMenuItem(ExecutableView view, String menuLabel, Runnable menuAction) Create a menu item for the View.default ApplicationMenuItemcreateMenuItem(String menuLabel, String icon, Runnable menuAction) Create a menu item.default ApplicationMenuItemGroupcreateMenuItemGroup(String menuLabel) Create a menu item.static ApplicationEnvironmentget()Create a default implementation.default StringGet the menu icon to be used for active (running)Views.default StringgetIconName(String label) This method is used to determine the name of the icon to be displayed on aButtonfrom its label.default ObjectColumnCreator<?> Create a "column creator" for the application when anObjectis viewed in aGrid.default ObjectFieldCreator<?> Create the "field creator" for the application when anObjectis edited or viewed in a "data entry form".default StringConverts an object into a displayable form (String).default StringConverts an object into a displayable form (String).
-
Method Details
-
getObjectFieldCreator
Create the "field creator" for the application when anObjectis edited or viewed in a "data entry form".- Returns:
- Field creator.
-
getObjectColumnCreator
Create a "column creator" for the application when anObjectis viewed in aGrid.- Returns:
- Column creator.
-
toString
Converts an object into a displayable form (String). The default implementation converts it by invokingObject.toString().- Parameters:
any- Object to convert- Returns:
- Converted string.
-
toDisplay
Converts an object into a displayable form (String). The default implementation convertsExceptionto its message and rest of the types totoString(Object).- Parameters:
any- Object to convert- Returns:
- Converted string.
-
createLabel
Create a label for the attribute name passed. This is typically used for creating labels for field names. The default implementation converts the name to camel case words. For example, "firstName" will be converted to "First Name".- Parameters:
attributeName- Attribute name- Returns:
- Label.
-
createLabel
Create a label for displaying a particular class name. (A class's name may have to be displayed in some part of the application and this method is invoked for that). The default implementation strips of the "package" portion and invokescreateLabel(String)with the rest of the class name.- Parameters:
aClass- Class to be displayed- Returns:
- Label.
-
getIconName
This method is used to determine the name of the icon to be displayed on aButtonfrom its label. The default implementation returns certain basic names. For example, for labels like "save", "ok", "yes" etc., it returns "check".- Parameters:
label- Label on the button- Returns:
- Name of the icon (Icons are created using
Iconclass).
-
createMenuItem
Create a menu item.- Parameters:
menuLabel- Menu labelicon- IconmenuAction- Action associated with the menu item- Returns:
- Menu item created.
-
createMenuItem
default ApplicationMenuItem createMenuItem(ExecutableView view, String menuLabel, Runnable menuAction) Create a menu item for the View.- Parameters:
view- View for which menu item needs to be createdmenuLabel- Menu labelmenuAction- Action associated with the menu item- Returns:
- Menu item created.
-
createMenuItemGroup
Create a menu item.- Parameters:
menuLabel- Menu label- Returns:
- Menu item created.
-
getActiveMenuIconName
-
get
Create a default implementation.- Returns:
- A default implementation of the "application environment".
-