StyleValue newValue = newPropertyValue.getValue();
if (newValue instanceof StylePair) {
StylePair pairValue = (StylePair) newValue;
updateEditorValue(first, pairValue.getFirst());
updateEditorValue(second, pairValue.getSecond());
Priority priority = newPropertyValue.getPriority();
boolean important = priority == Priority.IMPORTANT;
importantCheckbox.setSelection(important);
handled = true;
} else if (newValue instanceof StyleFraction) {
StyleFraction fractionValue = (StyleFraction) newValue;
updateEditorValue(first, fractionValue.getNumerator());
updateEditorValue(second, fractionValue.getDenominator());
second.setEnabled(true);
Priority priority = newPropertyValue.getPriority();
boolean important = priority == Priority.IMPORTANT;
importantCheckbox.setSelection(important);
handled = true;
} else if (newValue instanceof StyleKeyword ||
newValue instanceof StyleInherit) {
updateEditorValue(first, newValue);
// The second value should not be enabled in this case.
updateEditorValue(second, null);
second.setEnabled(false);
Priority priority = newPropertyValue.getPriority();
boolean important = priority == Priority.IMPORTANT;
importantCheckbox.setSelection(important);
handled = true;
}
}