/** {@inheritDoc} */ @Override public void revertChanges() { for (PropertyWidget widget : widgets) { String propertyId = widget.getOptionId().toString(); String previousValue = preferencesManager.getValue(propertyId); if (!widget.getSelectedValue().equals(previousValue)) { widget.selectPropertyValue(previousValue); } } }
/** {@inheritDoc} */ @Override public void storeChanges() { for (PropertyWidget widget : widgets) { String propertyName = widget.getOptionId().toString(); String selectedValue = widget.getSelectedValue(); if (!selectedValue.equals(preferencesManager.getValue(propertyName))) { preferencesManager.setValue(propertyName, selectedValue); } } }
/** {@inheritDoc} */ @Override public boolean isDirty() { for (PropertyWidget widget : widgets) { String propertyName = widget.getOptionId().toString(); String changedValue = widget.getSelectedValue(); if (!changedValue.equals(preferencesManager.getValue(propertyName))) { return true; } } return false; }
private void createAndAddWidget(@NotNull ErrorWarningsOptions option) { PropertyWidget widget = propertyFactory.create(option); String value = preferencesManager.getValue(option.toString()); widget.selectPropertyValue(value); widget.setDelegate(JavaCompilerPreferencePresenter.this); widgets.add(widget); view.addProperty(widget); }