decimalFormat.setParseIntegerOnly(true);
if (article != null) {
articleName = article.getArticleName();
//BeanAdapter beanAdapterArticle = new BeanAdapter(article);
BeanAdapter beanAdapterArticle = new BeanAdapter(new IArticleModel(article));
textFieldNumberOf = BasicComponentFactory.createFormattedTextField(
//beanAdapterArticle.getValueModel("numberOfItemsLong"),
beanAdapterArticle.getValueModel(IArticleModel.PROPERTY_NUMBER_OF_ITEMS_LONG),
decimalFormat);
textFieldOrder = BasicComponentFactory
.createIntegerField(beanAdapterArticle
.getValueModel("dialogOrder"));
}
if (attributes != null && attributes.size() != 0) {
textFields = new LinkedHashMap<String, JTextField>();
textFieldDialogOrders = new LinkedHashMap<String, JTextField>();
checkBoxes = new LinkedHashMap<String, JCheckBox>();
comboBoxes = new LinkedHashMap<String, JComboBox>();
// g�r gjennom alle attributter og lager et tekstfelt, checkboks
// eller comboboks for hver
for (IArticleAttribute attribute : attributes) {
BeanAdapter beanAdapter = new BeanAdapter(new IArticleAttributeModel(attribute), true);
beans.add(beanAdapter);
if (attribute.isYesNo()) {
checkBoxes.put(attribute.getAttributeName(),
BasicComponentFactory.createCheckBox(beanAdapter
//.getValueModel("attributeValueBool"), ""));
.getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE_BOOL), ""));
//beanAdapter.setValue("attributeValueBool", Boolean.FALSE);
beanAdapter.setValue(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE_BOOL, Boolean.FALSE);
} else if (attribute.getChoices() != null
&& attribute.getChoices().size() != 0) {
comboBoxes.put(attribute.getAttributeName(),
new JComboBox(new ComboBoxAdapter(attribute
.getChoices(), beanAdapter
//.getValueModel("attributeValue"))));
.getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE))));
} else {
textFields.put(attribute.getAttributeName(),
BasicComponentFactory.createTextField(beanAdapter
//.getValueModel("attributeValue")));
.getValueModel(IArticleAttributeModel.PROPERTY_ATTRIBUTE_VALUE)));
}
textFieldDialogOrders
.put(
attribute.getAttributeName(),
BasicComponentFactory
.createIntegerField(beanAdapter
//.getValueModel("dialogOrderAttribute")));
.getValueModel(IArticleAttributeModel.PROPERTY_DIALOG_ORDER_ATTRIBUTE)));
}