* @param window
* @param presentationModel
*/
void doEditAttribute(WindowInterface window,
PresentationModel presentationModel) {
ConstructionTypeAttribute attribute = (ConstructionTypeAttribute) attributeSelection
.getSelection();
if (attribute != null) {
String useAsUniversal = "";
if (masterDialog) {
useAsUniversal = (String) JOptionPane.showInputDialog(window
.getComponent(),
"Skal endring gjelde alle gjeldende garasjetyper",
"Skal gjelde alle gjelende grasjetype",
JOptionPane.PLAIN_MESSAGE, null, new Object[] { "Ja",
"Nei" }, 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) Util.showOptionsDialogCombo(window,
attribute.getChoices(), "Endre verdi", true, attribute
.getAttributeValue());
} else {
attributeValue = JOptionPane.showInputDialog(window
.getComponent(), "Gi ny verdi", attribute
.getAttributeValue());
}
if (attributeValue != null) {
String orderValue = JOptionPane.showInputDialog(window
.getComponent(), "Rekkef�lge", attribute
.getDialogOrder());
if (attributeValue.length() != 0) {
attribute.setAttributeValue(attributeValue);
}
if (orderValue != null && orderValue.length() != 0) {
attribute.setDialogOrder(Integer.valueOf(orderValue));
} else {
attribute.setDialogOrder(null);
}
if (masterDialog && useAsUniversal != null
&& useAsUniversal.equalsIgnoreCase("Ja")) {
universalChangedAttributes.add(attribute);