Source:
<code>public void setState(State dialogState) { if (txtSearchPattern_.getText().isEmpty()) txtSearchPattern_.setText(dialogState.getQuery()); checkboxCaseSensitive_.setValue(dialogState.isCaseSensitive()); checkboxRegex_.setValue(dialogState.isRegex()); dirChooser_.setText(dialogState.getPath()); String includeFilePatterns = StringUtil.join( Arrays.asList(dialogState.getFilePatterns()), ", "); if (includeFilePatterns == <START> listPresetFilePatterns_.getValue(Include.AllFiles.ordinal())) <END> listPresetFilePatterns_.setSelectedIndex(Include.AllFiles.ordinal()); else if (includeFilePatterns == listPresetFilePatterns_.getValue(Include.CommonRSourceFiles.ordinal())) listPresetFilePatterns_.setSelectedIndex(Include.CommonRSourceFiles.ordinal()); else if (includeFilePatterns == listPresetFilePatterns_.getValue(Include.RScripts.ordinal())) listPresetFilePatterns_.setSelectedIndex(Include.RScripts.ordinal()); else if (includeFilePatterns == listPresetFilePatterns_.getValue(Include.Package.ordinal())) { listPresetFilePatterns_.setSelectedIndex(Include.Package.ordinal()); packageStatus_ = true; } else listPresetFilePatterns_.setSelectedIndex(Include.CustomFilter.ordinal()); txtFilePattern_.setText(includeFilePatterns); manageFilePattern(); String excludeFilePatterns = StringUtil.join( Arrays.asList(dialogState.getExcludeFilePatterns()), ","); if (excludeFilePatterns == listPresetExcludeFilePatterns_.getValue(Exclude.None.ordinal())) listPresetExcludeFilePatterns_.setSelectedIndex(Exclude.None.ordinal()); else if (excludeFilePatterns == listPresetExcludeFilePatterns_.getValue(Exclude.StandardGit.ordinal())) { listPresetExcludeFilePatterns_.setSelectedIndex(Exclude.StandardGit.ordinal()); gitStatus_ = true; } else listPresetExcludeFilePatterns_.setSelectedIndex(Exclude.CustomFilter.ordinal()); txtExcludeFilePattern_.setText(excludeFilePatterns); manageExcludeFilePattern(); }</code><technical_language>This is verbose. I needed simplify this is a method select index value. I feel this (and if pretty easy add!)</technical_language>

Target:
public void setState(State dialogState) { if (txtSearchPattern_.getText().isEmpty()) txtSearchPattern_.setText(dialogState.getQuery()); checkboxCaseSensitive_.setValue(dialogState.isCaseSensitive()); checkboxRegex_.setValue(dialogState.isRegex()); dirChooser_.setText(dialogState.getPath()); String includeFilePatterns = StringUtil.join( Arrays.asList(dialogState.getFilePatterns()), ", "); int index = listPresetFilePatterns_.getIndexFromValue(includeFilePatterns); if (index >= 0) listPresetFilePatterns_.setSelectedIndex(index); else listPresetFilePatterns_.setSelectedIndex(Include.CustomFilter.ordinal()); if (index == Include.Package.ordinal()) packageStatus_ = true; txtFilePattern_.setText(includeFilePatterns); manageFilePattern(); String excludeFilePatterns = StringUtil.join( Arrays.asList(dialogState.getExcludeFilePatterns()), ","); index = listPresetExcludeFilePatterns_.getIndexFromValue(excludeFilePatterns); if (index >= 0) listPresetExcludeFilePatterns_.setSelectedIndex(index); else listPresetExcludeFilePatterns_.setSelectedIndex(Exclude.CustomFilter.ordinal()); if (index == Exclude.StandardGit.ordinal()) gitStatus_ = true; txtExcludeFilePattern_.setText(excludeFilePatterns); manageExcludeFilePattern(); }