Add tooltip component to features

Oshani Silva 2 months ago committed by ruwin
parent bbc1643795
commit 401c4db5a2

@ -58,6 +58,13 @@ public class Feature implements Serializable {
) )
private String description; private String description;
@ApiModelProperty(
name = "tooltip",
value = "Provides a tooltip for the features.",
required = false
)
private String tooltip;
@ApiModelProperty( @ApiModelProperty(
name = "type", name = "type",
value = "Type of the feature.", value = "Type of the feature.",
@ -139,6 +146,16 @@ public class Feature implements Serializable {
this.description = description; this.description = description;
} }
@XmlElement
public String getTooltip() {
return tooltip;
}
public void setTooltip(String tooltip) {
this.tooltip = tooltip;
}
@XmlAttribute @XmlAttribute
public String getType() { public String getType() {
return type; return type;

@ -68,6 +68,9 @@ public class HTTPDeviceTypeManagerService extends DeviceTypeManagerService imple
if (feature.getCode() != null && feature.getName() != null) { if (feature.getCode() != null && feature.getName() != null) {
configFeature.setCode(feature.getCode()); configFeature.setCode(feature.getCode());
configFeature.setDescription(feature.getDescription()); configFeature.setDescription(feature.getDescription());
if (feature.getTooltip() != null) {
configFeature.setTooltip(feature.getTooltip());
}
configFeature.setName(feature.getName()); configFeature.setName(feature.getName());
if (feature.getMetadataEntries() != null && feature.getMetadataEntries().size() > 0) { if (feature.getMetadataEntries() != null && feature.getMetadataEntries().size() > 0) {
List<String> metaValues = new ArrayList<>(); List<String> metaValues = new ArrayList<>();

@ -45,6 +45,7 @@ import java.util.List;
@XmlType(name = "Feature", propOrder = { @XmlType(name = "Feature", propOrder = {
"name", "name",
"description", "description",
"tooltip",
"operation", "operation",
"metaData" "metaData"
}) })
@ -56,6 +57,9 @@ public class Feature {
@XmlElement(name = "Description", required = true) @XmlElement(name = "Description", required = true)
protected String description; protected String description;
@XmlElement(name = "Tooltip", required = false)
protected String tooltip;
@XmlElement(name = "Operation") @XmlElement(name = "Operation")
protected Operation operation; protected Operation operation;
@ -117,6 +121,31 @@ public class Feature {
this.description = value; this.description = value;
} }
/**
* Gets the value of the tooltip property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTooltip() {
return tooltip;
}
/**
* Sets the value of the tooltip property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTooltip(String value) {
this.tooltip = value;
}
/** /**
* Gets the value of the operation property. * Gets the value of the operation property.
* *

@ -60,6 +60,9 @@ public class ConfigurationBasedFeatureManager implements FeatureManager {
deviceFeature.setCode(feature.getCode()); deviceFeature.setCode(feature.getCode());
deviceFeature.setName(feature.getName()); deviceFeature.setName(feature.getName());
deviceFeature.setDescription(feature.getDescription()); deviceFeature.setDescription(feature.getDescription());
if (feature.getTooltip() != null) {
deviceFeature.setTooltip(feature.getTooltip());
}
deviceFeature.setType(feature.getType()); deviceFeature.setType(feature.getType());
Operation operation = feature.getOperation(); Operation operation = feature.getOperation();
List<Feature.MetadataEntry> metadataEntries = null; List<Feature.MetadataEntry> metadataEntries = null;

Loading…
Cancel
Save