Package com.contentful.java.cma.model
Class CMAEditorInterface.Control
- java.lang.Object
-
- com.contentful.java.cma.model.CMAEditorInterface.Control
-
- Enclosing class:
- CMAEditorInterface
public static class CMAEditorInterface.Control extends java.lang.ObjectThis class represents one control of the editor interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCMAEditorInterface.Control.BuildInWidgetIdEnum holding the build in values of a widget id.
-
Constructor Summary
Constructors Constructor Description Control()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMAEditorInterface.ControladdHelpText(java.lang.String helpText)Adds a new custom help text to the settings.CMAEditorInterface.ControladdSetting(java.lang.String key, java.lang.String value)Adds a new custom setting to the settings.CMAEditorInterface.Control.BuildInWidgetIdgetBuildInWidgetId()java.lang.StringgetFieldId()java.lang.StringgetHelpText()java.util.Map<java.lang.String,java.lang.String>getSettings()java.lang.StringgetWidgetId()CMAEditorInterface.ControlsetBuildInWidgetId(CMAEditorInterface.Control.BuildInWidgetId buildInWidgetId)Use a build in widget.CMAEditorInterface.ControlsetFieldId(java.lang.String fieldId)Change the id of the field for this control.CMAEditorInterface.ControlsetWidgetId(java.lang.String widgetId)Set the id of the widget.java.lang.StringtoString()
-
-
-
Method Detail
-
getFieldId
public java.lang.String getFieldId()
- Returns:
- the field id this control applies to.
-
setFieldId
public CMAEditorInterface.Control setFieldId(java.lang.String fieldId)
Change the id of the field for this control.- Parameters:
fieldId- new id to be set.- Returns:
- this instance for chaining.
-
getBuildInWidgetId
public CMAEditorInterface.Control.BuildInWidgetId getBuildInWidgetId()
- Returns:
- the current set build in widget or null if a custom ui extension is used.
-
setBuildInWidgetId
public CMAEditorInterface.Control setBuildInWidgetId(CMAEditorInterface.Control.BuildInWidgetId buildInWidgetId)
Use a build in widget.For custom ids, as in for using a custom ui extension widgets, please take a look at
setWidgetId(String).- Parameters:
buildInWidgetId- an id pointing to a build in widget.- Returns:
- this instance for chaining.
-
getWidgetId
public java.lang.String getWidgetId()
- Returns:
- the current widget id as a string.
- See Also:
CMAEditorInterface.Control.BuildInWidgetId,setBuildInWidgetId(BuildInWidgetId)
-
setWidgetId
public CMAEditorInterface.Control setWidgetId(java.lang.String widgetId)
Set the id of the widget.Use this setter if you want to use a custom ui extension widget, and take a look at
setBuildInWidgetId(BuildInWidgetId)if you want to select a build in editor widget.- Parameters:
widgetId- the new widget id- Returns:
- this instance for chaining.
- See Also:
CMAEditorInterface.Control.BuildInWidgetId,setBuildInWidgetId(BuildInWidgetId)
-
addSetting
public CMAEditorInterface.Control addSetting(java.lang.String key, java.lang.String value)
Adds a new custom setting to the settings.Side effect: might create a new map, if no map was created before.
- Parameters:
key- the settings key to be added.value- the value of the key to be added.- Returns:
- this instance for chaining.
-
addHelpText
public CMAEditorInterface.Control addHelpText(java.lang.String helpText)
Adds a new custom help text to the settings.Side effect: might create a new map, if no map was created before.
- Parameters:
helpText- display this text to the user.- Returns:
- this instance for chaining.
-
getHelpText
public java.lang.String getHelpText()
- Returns:
- the set help text or null if none is set.
-
getSettings
public java.util.Map<java.lang.String,java.lang.String> getSettings()
- Returns:
- a list of currently set settings, or null if none is set.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable string, representing the object.
-
-