JOptionPane.PLAIN_MESSAGE, null,
new Object[] { "Ja", "Nei" }, null);
}
if (selectedNode != null && selectedNode.isLeaf()) {
BufferedValueModel bufferedArticles = presentationModel
.getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);
ConstructionTypeArticleAttribute attribute = (ConstructionTypeArticleAttribute) selectedNode
.getObject();
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
.getConstructionTypeArticleValue());
} else if (attribute.getChoices() != null
&& attribute.getChoices().size() != 0) {
attributeValue = (String) Util.showOptionsDialogCombo(window,
attribute.getChoices(), "Endre verdi", true, attribute
.getConstructionTypeArticleValue());
} else {
attributeValue = JOptionPane.showInputDialog(window
.getComponent(), "Gi ny verdi", attribute
.getConstructionTypeArticleValue());
}
if (attributeValue != null) {
String orderValue = JOptionPane.showInputDialog(window
.getComponent(), "Rekkef�lge", attribute
.getDialogOrder());
if (attributeValue.length() != 0) {
attribute.setConstructionTypeArticleValue(attributeValue);
}
if (orderValue != null && orderValue.length() != 0) {
attribute.setDialogOrder(Integer.valueOf(orderValue));
} else {
attribute.setDialogOrder(null);
}
if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
universalChangedArticleAttributes.add(attribute);
}
ConstructionType constructiontype = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
.getRoot()).getObject();
bufferedArticles.setValue(new ArrayListModel(constructiontype
.getConstructionTypeArticles()));
}
} else if (selectedNode != null) {
DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setDecimalSeparatorAlwaysShown(false);
decimalFormat.setParseIntegerOnly(true);
BufferedValueModel bufferedArticles = presentationModel
.getBufferedModel(ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ARTICLES);
ConstructionTypeArticle article = (ConstructionTypeArticle) selectedNode
.getObject();
String numberOfValue = null;
if (article.getNumberOfItems() != null) {
numberOfValue = decimalFormat
.format(article.getNumberOfItems());
}
numberOfValue = JOptionPane.showInputDialog(window.getComponent(),
"Gi antall", numberOfValue);
String orderValue = JOptionPane.showInputDialog(window
.getComponent(), "Rekkef�lge", article.getDialogOrder());
if (numberOfValue != null && numberOfValue.length() != 0) {
article.setNumberOfItems(Integer.valueOf(numberOfValue.replace(
',', '.')));
}
if (orderValue != null) {
if (orderValue.length() != 0) {
article.setDialogOrder(Integer.valueOf(orderValue));
} else {
article.setDialogOrder(null);
}
}
if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
universalChangedArticles.add(article);
}
ConstructionType constructiontype = (ConstructionType) ((ConstructionTreeNode) constructionTreeTableModel
.getRoot()).getObject();
bufferedArticles.setValue(new ArrayListModel(constructiontype
.getConstructionTypeArticles()));
}
}