Package de.xima.fc.form.common.models
Class XButtonDescriptor
- java.lang.Object
-
- de.xima.fc.form.common.models.XButtonDescriptor
-
- All Implemented Interfaces:
Serializable
public final class XButtonDescriptor extends Object implements Serializable
Encapsulates the JSON object of a button of aXButtonList
and provides access to the button's properties.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XButtonDescriptor(XItem buttonList, com.alibaba.fastjson.JSONObject jsonObject)
Creates a new button descriptor for aXButtonList
item and a given JSON object with the data of one the buttons of that button list item.XButtonDescriptor(XItemRenderData renderData, com.alibaba.fastjson.JSONObject jsonObject)
Creates a new button descriptor for aXButtonList
item and a given JSON object with the data of one the buttons of that button list item.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Iterable<XButtonDescriptor>
eachButton(XItem buttonList)
XButtonActionDescriptor
getAction()
String
getButtonListId()
String
getButtonListName()
String
getI18nTitle(IXFormRenderConfig config)
String
getI18nValue(IXFormRenderConfig config)
String
getName()
String
getTitle()
String
getValue()
String
toString()
-
-
-
Constructor Detail
-
XButtonDescriptor
public XButtonDescriptor(XItem buttonList, com.alibaba.fastjson.JSONObject jsonObject)
Creates a new button descriptor for aXButtonList
item and a given JSON object with the data of one the buttons of that button list item.- Parameters:
buttonList
- TheXButtonList
item that contains the button.jsonObject
- The data of the button, seeXPropertyEnum.buttons
.
-
XButtonDescriptor
public XButtonDescriptor(XItemRenderData renderData, com.alibaba.fastjson.JSONObject jsonObject)
Creates a new button descriptor for aXButtonList
item and a given JSON object with the data of one the buttons of that button list item.- Parameters:
renderData
- Properties of theXButtonList
item that contains the button.jsonObject
- The data of the button, seeXPropertyEnum.buttons
.
-
-
Method Detail
-
getAction
public XButtonActionDescriptor getAction()
- Returns:
- The action that is executed when the button is pressed.
-
getButtonListId
public String getButtonListId()
- Returns:
- The
ID
of theXButtonList
element that contains this button.
-
getButtonListName
public String getButtonListName()
- Returns:
- The
name
of theXButtonList
element that contains this button.
-
getI18nTitle
public String getI18nTitle(IXFormRenderConfig config)
- Parameters:
config
- Render config to use for replacing placeholders.- Returns:
- The localized value for
getTitle()
, depending on the currently requested language, with all placeholders replaced.
-
getI18nValue
public String getI18nValue(IXFormRenderConfig config)
- Parameters:
config
- Render config to use for replacing placeholders.- Returns:
- The localized value for
getValue()
, depending on the currently requested language, with all placeholders replaced.
-
getName
public String getName()
- Returns:
- The technical name of the button, such as
btnSubmit
.
-
getTitle
public String getTitle()
- Returns:
- The title of the button, i.e. the tooltip that is shown when the user hovers over the button with the mouse.
-
getValue
public String getValue()
- Returns:
- The display name of the button.
-
eachButton
public static Iterable<XButtonDescriptor> eachButton(XItem buttonList)
- Parameters:
buttonList
- A form item of typeXButtonList
.- Returns:
- All buttons of the given button list.
-
-