SliceAnalysisParams (@NotNull PsiElement element, @NotNull SliceManager.StoredSettingsBean storedSettingsBean, @NotNull String dialogTitle) { AnalysisScope analysisScope = new AnalysisScope(element.getContainingFile()); Module module = ModuleUtilCore.findModuleForPsiElement(element); Project myProject = element.getProject(); AnalysisUIOptions analysisUIOptions = new AnalysisUIOptions(); analysisUIOptions.loadState(storedSettingsBean.analysisUIOptions); List<ModelScopeItem> items = BaseAnalysisActionDialog.standardItems(myProject, analysisScope, module, element); SliceLanguageSupportProvider provider = LanguageSlicing.getProvider(element); boolean supportFilter = provider.supportValueFilters(element); final class BackwardHandlerDialog extends BaseAnalysisActionDialog { private SliceBackwardAdditionalUi myUi; private BackwardHandlerDialog() { super(dialogTitle, LangBundle.message("separator.analyze.scope"), myProject, items, analysisUIOptions, true); } @Override protected @Nullable JComponent getAdditionalActionSettings(@NotNull Project project) { if (!supportFilter) return null; myUi = new SliceBackwardAdditionalUi(); final JTextField field = myUi.getField(); field.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { try { getFilter(); setErrorText(null, field); } catch (SliceFilterParseException exception) { setErrorText(exception.getMessage(), field); } } }); return myUi.getPanel(); } private @Nullable SliceValueFilter getFilter() throws SliceFilterParseException { if (myUi == null) return null; final JTextField field = myUi.getField(); String text = field.getText().trim(); if (!text.isEmpty()) { return provider.parseFilter(element, text); } return null; } } BackwardHandlerDialog dialog = new BackwardHandlerDialog(); if (!dialog.showAndGet()) { return null; } AnalysisScope scope = dialog.getScope(analysisScope); storedSettingsBean.analysisUIOptions.loadState(analysisUIOptions); SliceAnalysisParams params = new SliceAnalysisParams(); params.scope = scope; params.dataFlowToThis = myDataFlowToThis; try { params.valueFilter = dialog.getFilter(); } catch (SliceFilterParseException ignored) { } return params; }