valueView.removeFromParent();
m_attributeValueViews.remove(valueView);
AttributeValueView valueWidget = null;
if (isChoiceHandler()) {
I_Entity value = m_entity.getAttribute(m_attributeName).getComplexValues().get(currentPosition);
m_entity.removeAttributeValue(m_attributeName, currentPosition);
m_entity.insertAttributeValue(m_attributeName, value, targetPosition);
String attributeChoice = getChoiceName(targetPosition);
I_Type optionType = getAttributeType().getAttributeType(attributeChoice);
valueWidget = new AttributeValueView(
this,
m_widgetService.getAttributeLabel(attributeChoice),
m_widgetService.getAttributeHelp(attributeChoice));
parent.insert(valueWidget, targetPosition);
if (optionType.isSimpleType()) {
valueWidget.setValueWidget(
m_widgetService.getAttributeFormWidget(attributeChoice),
value.getAttribute(attributeChoice).getSimpleValue(),
true);
} else {
valueWidget.setValueEntity(
m_widgetService.getRendererForAttribute(attributeChoice, getAttributeType()),
value.getAttribute(attributeChoice).getComplexValue());
}
for (String choiceName : getAttributeType().getAttributeNames()) {
valueWidget.addChoice(
m_widgetService.getAttributeLabel(choiceName),
m_widgetService.getAttributeHelp(choiceName),
choiceName);
}
} else if (getAttributeType().isSimpleType()) {
String value = m_entity.getAttribute(m_attributeName).getSimpleValues().get(currentPosition);
m_entity.removeAttributeValue(m_attributeName, currentPosition);
m_entity.insertAttributeValue(m_attributeName, value, targetPosition);
valueWidget = new AttributeValueView(
this,
m_widgetService.getAttributeLabel(m_attributeName),
m_widgetService.getAttributeHelp(m_attributeName));
parent.insert(valueWidget, targetPosition);
valueWidget.setValueWidget(m_widgetService.getAttributeFormWidget(m_attributeName), value, true);
} else {
I_Entity value = m_entity.getAttribute(m_attributeName).getComplexValues().get(currentPosition);
m_entity.removeAttributeValue(m_attributeName, currentPosition);
m_entity.insertAttributeValue(m_attributeName, value, targetPosition);
valueWidget = new AttributeValueView(
this,
m_widgetService.getAttributeLabel(m_attributeName),