use of com.intellij.psi.codeStyle.presentation.CodeStyleBoundedIntegerSettingPresentation in project intellij-community by JetBrains.
the class WrappingAndBracesPanel method initTables.
@Override
protected void initTables() {
for (Map.Entry<CodeStyleSettingPresentation.SettingsGroup, List<CodeStyleSettingPresentation>> entry : CodeStyleSettingPresentation.getStandardSettings(getSettingsType()).entrySet()) {
CodeStyleSettingPresentation.SettingsGroup group = entry.getKey();
for (CodeStyleSettingPresentation setting : entry.getValue()) {
//TODO this is ugly, but is the fastest way to make Options UI API and settings representation API connect
String fieldName = setting.getFieldName();
String uiName = setting.getUiName();
if (setting instanceof CodeStyleBoundedIntegerSettingPresentation) {
CodeStyleBoundedIntegerSettingPresentation intSetting = (CodeStyleBoundedIntegerSettingPresentation) setting;
int defaultValue = intSetting.getDefaultValue();
addOption(fieldName, uiName, group.name, intSetting.getLowerBound(), intSetting.getUpperBound(), defaultValue, intSetting.getValueUiName(defaultValue));
} else if (setting instanceof CodeStyleSelectSettingPresentation) {
CodeStyleSelectSettingPresentation selectSetting = (CodeStyleSelectSettingPresentation) setting;
addOption(fieldName, uiName, group.name, selectSetting.getOptions(), selectSetting.getValues());
} else {
addOption(fieldName, uiName, group.name);
}
}
}
}
Aggregations