if (selectedNode != null && selectedNode.isLeaf()) {
BufferedValueModel bufferedOrderLines = presentationModel
.getBufferedModel(ICostableModel.PROPERTY_ORDER_LINE_ARRAY_LIST_MODEL);
OrderLineAttribute attribute = (OrderLineAttribute) selectedNode
.getObject();
OrderLine orderLine = attribute.getOrderLine();
orderLine.setHasArticle(null);
orderLine.setAttributeInfo(null);
orderLine.removeAllOrderLineAttributeInfo();
orderLine.setIsDefault(null);
String attributeValue;
if (attribute.isYesNo()) {
attributeValue = (String) JOptionPane.showInputDialog(window
.getComponent(), "Gi ny verdi", "Endre verdi",
JOptionPane.QUESTION_MESSAGE, null, new Object[] {
"Ja", "Nei" }, attribute.getAttributeValue());
} else if (attribute.getChoices() != null
&& attribute.getChoices().size() != 0) {
attributeValue = (String) JOptionPane.showInputDialog(window
.getComponent(), "Gi ny verdi", "Endre verdi",
JOptionPane.QUESTION_MESSAGE, null, attribute
.getChoices().toArray(), attribute
.getAttributeValue());
} else {
attributeValue = JOptionPane.showInputDialog(window
.getComponent(), "Gi ny verdi", attribute
.getAttributeValue());
}
if (attributeValue != null && attributeValue.length() != 0) {
if (!StringUtils.isEmpty(attribute.getAttributeDataType())
&& !AttributeDataType.valueOf(
StringUtils.upperCase(attribute
.getAttributeDataType())).isValid(
attributeValue)) {
Util.showErrorDialog(window, "Feil datatype",
"Attributt har feil datatype");
} else {
attribute.setAttributeValue(attributeValue);
OrderWrapper<T, E> orderWrapper = (OrderWrapper<T, E>) ((OrderLineTreeNode) orderLineTreeTableModel
.getRoot()).getObject();
calculateAttributes(orderWrapper.getOrderLines());
bufferedOrderLines.setValue(new ArrayListModel(orderWrapper