}
}
if(widget instanceof Switch) {
Switch switchWidget = (Switch) widget;
for(Mapping mapping : switchWidget.getMappings()) {
MappingBean mappingBean = new MappingBean();
// Remove quotes - if they exist
if(mapping.getCmd() != null) {
if(mapping.getCmd().startsWith("\"") && mapping.getCmd().endsWith("\"")) {
mappingBean.command = mapping.getCmd().substring(1, mapping.getCmd().length()-1);
}
else {
mappingBean.command = mapping.getCmd();
}
}
else {
mappingBean.command = mapping.getCmd();
}
mappingBean.label = mapping.getLabel();
bean.mappings.add(mappingBean);
}
}
if (widget instanceof Selection) {
Selection selectionWidget = (Selection) widget;
for (Mapping mapping : selectionWidget.getMappings()) {
MappingBean mappingBean = new MappingBean();
// Remove quotes - if they exist
if(mapping.getCmd() != null) {
if(mapping.getCmd().startsWith("\"") && mapping.getCmd().endsWith("\"")) {
mappingBean.command = mapping.getCmd().substring(1, mapping.getCmd().length()-1);
}