Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
292,500
Editor () { return myEditor; }
getEditor
292,501
void (@NotNull DocumentEvent event) { if (myAlarm.isDisposed()) return; myAlarm.cancelRequest(runnable); myAlarm.addRequest(runnable, 100); }
documentChanged
292,502
void (@NotNull FileEditorManagerEvent event) { if (myAlarm.isDisposed()) return; myAlarm.cancelRequest(runnable); myNewEditor = event.getNewEditor(); myAlarm.addRequest(runnable, 100); }
selectionChanged
292,503
void (@NotNull IdeaPluginDescriptor pluginDescriptor, boolean isUpdate) { close(CANCEL_EXIT_CODE); }
beforePluginUnload
292,504
void () { close(CANCEL_EXIT_CODE); }
appClosing
292,505
void (@NotNull Project project) { if (project == myProject) { close(CANCEL_EXIT_CODE); } }
projectClosing
292,506
void () { if (myEditor != null) { myEditor.getDocument().addDocumentListener(myRestartHighlightingListener); } }
addRestartHighlightingListenerToCurrentEditor
292,507
void () { if (myEditor != null) { myEditor.getDocument().removeDocumentListener(myRestartHighlightingListener); } }
removeRestartHighlightingListenerFromCurrentEditor
292,508
EditorTextField (boolean replace) { final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); assert profile != null; final Document document = UIUtil.createDocument(myProject, myFileType, myDialect, myPatternContext, "", profile); document.addDocumentListener(this, myDisposable); document.putUserData(STRUCTURAL_SEARCH_PATTERN_CONTEXT_ID, (myPatternContext == null) ? "" : myPatternContext.getId()); final EditorTextField textField = new MyEditorTextField(document, replace); textField.setFont(EditorFontType.getGlobalPlainFont().deriveFont( UISettingsUtils.getInstance().getScaledEditorFontSize() )); textField.setPreferredSize(new Dimension(550, 150)); textField.setMinimumSize(new Dimension(200, 50)); myComponentsWithEditorBackground.add(textField); return textField; }
createEditor
292,509
void (@NotNull final DocumentEvent event) { initValidation(); if (!myChangedConfiguration) { myExistingTemplatesComponent.templateChanged(); } }
documentChanged
292,510
void (@Nullable CompiledPattern compiledPattern) { final MatchOptions matchOptions = getConfiguration().getMatchOptions(); final CompiledPattern finalCompiledPattern = compiledPattern == null ? PatternCompiler.compilePattern(myProject, matchOptions, false, false) : compiledPattern; if (finalCompiledPattern == null) return; ApplicationManager.getApplication().invokeLater(() -> { SubstitutionShortInfoHandler.updateEditorInlays(mySearchCriteriaEdit.getEditor()); if (myReplace) SubstitutionShortInfoHandler.updateEditorInlays(myReplaceCriteriaEdit.getEditor()); myFilterPanel.setCompiledPattern(finalCompiledPattern); if (myFilterPanel.getVariable() == null) { myFilterPanel.initFilters(UIUtil.getOrAddVariableConstraint(Configuration.CONTEXT_VAR_NAME, myConfiguration)); } }, ModalityState.stateForComponent(myFilterPanel.getComponent())); }
initializeFilterPanel
292,511
ReplaceConfiguration (Configuration template) { final ReplaceConfiguration result = template == null ? new ReplaceConfiguration(SSRBundle.message("new.template.defaultname"), SSRBundle.message("user.defined.category")) : new ReplaceConfiguration(template); if (!myEditConfigOnly) { final MatchOptions matchOptions = result.getMatchOptions(); matchOptions.setSearchInjectedCode(myInjected.isSelected()); matchOptions.setCaseSensitiveMatch(myMatchCase.isSelected()); final ReplaceOptions replaceOptions = result.getReplaceOptions(); replaceOptions.setToShortenFQN(myShortenFqn.isSelected()); replaceOptions.setToUseStaticImport(myStaticImport.isSelected()); replaceOptions.setToReformatAccordingToStyle(myReformat.isSelected()); } return result; }
createConfiguration
292,512
void () { final Editor editor = myEditor; if (editor != null) { final SelectionModel selectionModel = editor.getSelectionModel(); final String selectedText = selectionModel.getSelectedText(); if (selectedText != null) { if (loadConfiguration(selectedText)) { return; } final String text = selectedText.trim(); setTextForEditor(text.trim(), mySearchCriteriaEdit); setTextForEditor(text, myReplaceCriteriaEdit); myScopePanel.setScopesFromContext(null); final Document document = editor.getDocument(); final PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(document); if (file != null) { final PsiElement start = file.findElementAt(selectionModel.getSelectionStart()); final PsiElement end = file.findElementAt(selectionModel.getSelectionEnd() - 1); final PsiElement element = (start == null || end == null || start.getContainingFile() != end.getContainingFile()) ? null : PsiTreeUtil.findCommonParent(start, end); final Language language = (element == null) ? file.getLanguage() : element.getLanguage(); myFileTypeChooser.setSelectedItem(language.getAssociatedFileType(), language, null); if (language != file.getLanguage() && !myInjected.isSelected()) { myInjected.doClick(); } } ApplicationManager.getApplication().invokeLater(() -> startTemplate()); return; } } final Configuration previousConfiguration = myProject.getUserData(STRUCTURAL_SEARCH_PREVIOUS_CONFIGURATION); if (previousConfiguration != null) { loadConfiguration(previousConfiguration); } else { final Configuration configuration = ConfigurationManager.getInstance(myProject).getMostRecentConfiguration(); if (configuration != null) { loadConfiguration(configuration); } } }
setTextFromContext
292,513
void (String text, EditorTextField editor) { editor.setText(text); editor.selectAll(); final Document document = editor.getDocument(); final PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject); documentManager.commitDocument(document); final PsiFile file = documentManager.getPsiFile(document); if (file == null) return; WriteCommandAction.runWriteCommandAction(myProject, SSRBundle.message("command.name.adjust.line.indent"), "Structural Search", () -> CodeStyleManager.getInstance(myProject) .adjustLineIndent(file, new TextRange(0, document.getTextLength())), file); }
setTextForEditor
292,514
void () { if (myReplace) { new ReplaceCommand(getConfiguration(), mySearchContext).startSearching(); } else { new SearchCommand(getConfiguration(), mySearchContext).startSearching(); } }
startSearching
292,515
String () { return myReplace ? SSRBundle.message("structural.replace.title") : SSRBundle.message("structural.search.title"); }
getDefaultTitle
292,516
DialogStyle () { return DialogStyle.COMPACT; }
getStyle
292,517
JComponent () { final var searchPanel = createSearchPanel(); myReplacePanel = createReplacePanel(); myReplacePanel.setVisible(myReplace); myScopePanel = new ScopePanel(myProject, myDisposable); if (!myEditConfigOnly) { myScopePanel.setRecentDirectories(FindInProjectSettings.getInstance(myProject).getRecentDirectories()); myScopePanel.setScopeConsumer(scope -> { if (myConfiguration != null) { myConfiguration.getMatchOptions().setScope(scope); initValidation(); } }); } else { myScopePanel.setVisible(false); } final var centerConstraint = new GridBag() .setDefaultFill(BOTH) .setDefaultWeightX(1.0) .setDefaultWeightY(1.0); final JPanel centerPanel = new JPanel(new GridBagLayout()); centerPanel.add(searchPanel, centerConstraint.nextLine()); centerPanel.add(myReplacePanel, centerConstraint.nextLine()); centerPanel.add(myScopePanel, centerConstraint.nextLine().weighty(0.0)); myExistingTemplatesComponent = new ExistingTemplatesComponent(myProject, getContentPanel(), new ImportConfigurationAction(), new ExportConfigurationAction()); myExistingTemplatesComponent.onConfigurationSelected(this::loadConfiguration); myExistingTemplatesComponent.setConfigurationProducer(() -> getConfiguration()); myMainSplitter = new OnePixelSplitter(false, 0.2f); myMainSplitter.setFirstComponent(myExistingTemplatesComponent.getTemplatesPanel()); myMainSplitter.setSecondComponent(centerPanel); updateColors(); updateOptions(); return myMainSplitter; }
createCenterPanel
292,518
JPanel () { // 'Search template:' label final JBLabel searchTemplateLabel = new JBLabel(SSRBundle.message("search.template")); // File type chooser myFileType = UIUtil.detectFileType(mySearchContext); myDialect = myFileType.getLanguage(); final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); if (profile != null) { final List<PatternContext> contexts = profile.getPatternContexts(); if (!contexts.isEmpty()) { myPatternContext = contexts.get(0); } } myFileTypeChooser.setSelectedItem(myFileType, myDialect, myPatternContext); myFileTypeChooser.setFileTypeInfoConsumer(info -> { myFileType = info.getFileType(); myDialect = info.getDialect(); myPatternContext = info.getContext(); final MatchOptions matchOptions = myConfiguration.getMatchOptions(); matchOptions.setFileType(myFileType); matchOptions.setDialect(myDialect); matchOptions.setPatternContext(myPatternContext); myOptionsToolbar.updateActionsImmediately(); myFilterPanel.setFileType(myFileType); final String contextId = (myPatternContext == null) ? "" : myPatternContext.getId(); final StructuralSearchProfile profile1 = StructuralSearchUtil.getProfileByFileType(myFileType); final Document searchDocument = UIUtil.createDocument(myProject, myFileType, myDialect, myPatternContext, mySearchCriteriaEdit.getText(), profile1); searchDocument.addDocumentListener(this, myDisposable); mySearchCriteriaEdit.setNewDocumentAndFileType((myFileType == null) ? PlainTextFileType.INSTANCE : myFileType, searchDocument); searchDocument.putUserData(STRUCTURAL_SEARCH_PATTERN_CONTEXT_ID, contextId); final Document replaceDocument = UIUtil.createDocument(myProject, myFileType, myDialect, myPatternContext, myReplaceCriteriaEdit.getText(), profile1); replaceDocument.addDocumentListener(this, myDisposable); myReplaceCriteriaEdit.setNewDocumentAndFileType((myFileType == null) ? PlainTextFileType.INSTANCE : myFileType, replaceDocument); replaceDocument.putUserData(STRUCTURAL_SEARCH_PATTERN_CONTEXT_ID, contextId); updateOptions(); initValidation(); }); myFileTypeChooser.setUserActionFileTypeInfoConsumer(info -> { myExistingTemplatesComponent.selectFileType(info.getFileType()); }); // Existing templates action final AnAction showTemplatesAction = new DumbAwareToggleAction(SSRBundle.message("templates.button"), SSRBundle.message("templates.button.description"), AllIcons.Actions.PreviewDetails) { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public boolean isSelected(@NotNull AnActionEvent e) { return isExistingTemplatesPanelVisible(); } @Override public void setSelected(@NotNull AnActionEvent e, boolean state) { setExistingTemplatesPanelVisible(state); } }; // Filter action final BadgeIconSupplier filterIcon = new BadgeIconSupplier(AllIcons.General.Filter); final AnAction filterAction = new DumbAwareToggleAction(SSRBundle.message("filter.button"), SSRBundle.message("filter.button.description"), filterIcon.getLiveIndicatorIcon(true)) { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public void update(@NotNull AnActionEvent e) { super.update(e); final Presentation presentation = e.getPresentation(); presentation.setIcon(filterIcon.getLiveIndicatorIcon(myFilterPanel.hasVisibleFilter())); } @Override public boolean isSelected(@NotNull AnActionEvent e) { return isFilterPanelVisible(); } @Override public void setSelected(@NotNull AnActionEvent e, boolean state) { setFilterPanelVisible(state); } }; // Filter panel myFilterPanel = new FilterPanel(myProject, myFileType, getDisposable()); myFilterPanel.setConstraintChangedCallback(() -> initValidation()); myFilterPanel.getComponent().setMinimumSize(new Dimension(300, 50)); // Pin action final DumbAwareToggleAction pinAction = new DumbAwareToggleAction(SSRBundle.message("pin.button"), SSRBundle.message("pin.button.description"), AllIcons.General.Pin_tab) { @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; } @Override public boolean isSelected(@NotNull AnActionEvent e) { return myPinned; } @Override public void setSelected(@NotNull AnActionEvent e, boolean state) { myPinned = state; } @Override public void update(@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabledAndVisible(!myEditConfigOnly); } }; final DefaultActionGroup optionsActionGroup = new DefaultActionGroup(myFileTypeChooser, showTemplatesAction, filterAction, new Separator(), pinAction, new SwitchAction()); final ActionManager actionManager = ActionManager.getInstance(); myOptionsToolbar = (ActionToolbarImpl)actionManager.createActionToolbar("StructuralSearchDialog", optionsActionGroup, true); myOptionsToolbar.setTargetComponent(mySearchCriteriaEdit); myOptionsToolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY); myOptionsToolbar.setForceMinimumSize(true); myOptionsToolbar.setBorder(JBUI.Borders.empty(DEFAULT_VGAP, 0)); // Search editor panel, 1st splitter element final var searchEditorPanel = new JPanel(new GridBagLayout()); // Search panel options myTargetComboBox = new LinkComboBox(SSRBundle.message("complete.match.variable.name")); myTargetComboBox.setItemConsumer(item -> { final MatchOptions matchOptions = myConfiguration.getMatchOptions(); for (String name : matchOptions.getVariableConstraintNames()) { matchOptions.getVariableConstraint(name).setPartOfSearchResults(name.equals(item)); } initValidation(); }); final String text = SSRBundle.message("search.target.label"); final JLabel searchTargetLabel = new JLabel(text); myTargetComboBox.setLabel(searchTargetLabel); myInjected = new JBCheckBox(SSRBundle.message("search.in.injected.checkbox")); myInjected.setOpaque(false); myInjected.addActionListener(e -> { myConfiguration.getMatchOptions().setSearchInjectedCode(myInjected.isSelected()); initValidation(); }); myInjected.setVisible(!myEditConfigOnly); myMatchCase = new JBCheckBox(FindBundle.message("find.popup.case.sensitive")); myMatchCase.setOpaque(false); myMatchCase.addActionListener(e -> { myConfiguration.getMatchOptions().setCaseSensitiveMatch(myMatchCase.isSelected()); initValidation(); }); // Splitter mySearchEditorPanel = new OnePixelSplitter(false, 1.0f); mySearchEditorPanel.setLackOfSpaceStrategy(Splitter.LackOfSpaceStrategy.HONOR_THE_SECOND_MIN_SIZE); mySearchCriteriaEdit = createEditor(false); mySearchEditorPanel.setFirstComponent(searchEditorPanel); myComponentsWithEditorBackground.add(searchEditorPanel); // Wrapper mySearchWrapper = new JPanel(new BorderLayout()); // needed for border mySearchWrapper.add(mySearchEditorPanel, BorderLayout.CENTER); final var searchConstraint = new GridBag().setDefaultInsets(DEFAULT_VGAP, DEFAULT_HGAP, DEFAULT_VGAP, 0); searchEditorPanel.add(mySearchCriteriaEdit, searchConstraint .nextLine().fillCell().coverLine() .weightx(1.0).weighty(1.0) .emptyInsets()); searchEditorPanel.add(searchTargetLabel, searchConstraint.nextLine()); searchEditorPanel.add(myTargetComboBox, searchConstraint); searchEditorPanel.add(myInjected, searchConstraint); searchEditorPanel.add(myMatchCase, searchConstraint.anchor(WEST).insetRight(DEFAULT_HGAP)); mySearchEditorPanel.setSecondComponent(myFilterPanel.getComponent()); myComponentsWithEditorBackground.add(myFilterPanel.getTable()); final JPanel searchPanel = new JPanel(new GridBagLayout()); final var northConstraint = new GridBag().setDefaultWeightX(1.0); searchPanel.add(searchTemplateLabel, northConstraint.nextLine().weightx(0.0).insets(JBInsets.create(0, DEFAULT_HGAP))); searchPanel.add(myOptionsToolbar, northConstraint.anchor(EAST)); searchPanel.add(mySearchWrapper, northConstraint.nextLine().coverLine().fillCell().emptyInsets().weighty(1.0)); return searchPanel; }
createSearchPanel
292,519
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
292,520
boolean (@NotNull AnActionEvent e) { return isExistingTemplatesPanelVisible(); }
isSelected
292,521
void (@NotNull AnActionEvent e, boolean state) { setExistingTemplatesPanelVisible(state); }
setSelected
292,522
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
292,523
void (@NotNull AnActionEvent e) { super.update(e); final Presentation presentation = e.getPresentation(); presentation.setIcon(filterIcon.getLiveIndicatorIcon(myFilterPanel.hasVisibleFilter())); }
update
292,524
boolean (@NotNull AnActionEvent e) { return isFilterPanelVisible(); }
isSelected
292,525
void (@NotNull AnActionEvent e, boolean state) { setFilterPanelVisible(state); }
setSelected
292,526
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
292,527
boolean (@NotNull AnActionEvent e) { return myPinned; }
isSelected
292,528
void (@NotNull AnActionEvent e, boolean state) { myPinned = state; }
setSelected
292,529
void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setEnabledAndVisible(!myEditConfigOnly); }
update
292,530
JComponent () { final JBLabel replacementTemplateLabel = new JBLabel(SSRBundle.message("replacement.template.label")); myShortenFqn = new JBCheckBox(SSRBundle.message("shorten.fully.qualified.names.checkbox")); myShortenFqn.setOpaque(false); myShortenFqn.addActionListener(e -> myConfiguration.getReplaceOptions().setToShortenFQN(myShortenFqn.isSelected())); myStaticImport = new JBCheckBox(SSRBundle.message("use.static.import.checkbox")); myStaticImport.setOpaque(false); myStaticImport.addActionListener(e -> myConfiguration.getReplaceOptions().setToUseStaticImport(myStaticImport.isSelected())); myReformat = new JBCheckBox(SSRBundle.message("reformat.checkbox")); myReformat.setOpaque(false); myReformat.addActionListener(e -> myConfiguration.getReplaceOptions().setToReformatAccordingToStyle(myReformat.isSelected())); myReplaceCriteriaEdit = createEditor(true); myReplaceWrapper = new JPanel(new GridBagLayout()); myComponentsWithEditorBackground.add(myReplaceWrapper); final var wrapperConstraint = new GridBag().setDefaultInsets(10, 10, 10, 0); myReplaceWrapper.add(myReplaceCriteriaEdit, wrapperConstraint.nextLine().emptyInsets().fillCell().coverLine().weightx(1.0).weighty(1.0)); myReplaceWrapper.add(myShortenFqn, wrapperConstraint.nextLine()); myReplaceWrapper.add(myStaticImport, wrapperConstraint); myReplaceWrapper.add(myReformat, wrapperConstraint.weightx(1.0).anchor(WEST)); final JPanel replacePanel = new JPanel(new GridBagLayout()); final var replaceConstraint = new GridBag() .setDefaultWeightX(1.0); replacePanel.add(replacementTemplateLabel, replaceConstraint.nextLine().anchor(WEST).insets(16, DEFAULT_HGAP, 14, 0)); replacePanel.add(myReplaceWrapper, replaceConstraint.nextLine().fillCell().weighty(1.0)); return replacePanel; }
createReplacePanel
292,531
void () { final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); myShortenFqn.setVisible(profile != null && profile.supportsShortenFQNames()); myStaticImport.setVisible(profile != null && profile.supportsUseStaticImports()); }
updateOptions
292,532
JPanel () { if (myEditConfigOnly) return null; final JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 0)); myOpenInNewTab = new JCheckBox(SSRBundle.message("open.in.new.tab.checkbox")); myOpenInNewTab.setSelected(FindSettings.getInstance().isShowResultsInSeparateView()); panel.add(myOpenInNewTab, BorderLayout.EAST); return panel; }
createSouthAdditionalPanel
292,533
Point () { // handle dimension service manually to store dimensions correctly when switching between search/replace in the same dialog final DimensionService dimensionService = DimensionService.getInstance(); final Dimension size = dimensionService.getSize(myReplace ? REPLACE_DIMENSION_SERVICE_KEY : SEARCH_DIMENSION_SERVICE_KEY, myProject); if (size != null) { setSize(size.width, myEditConfigOnly ? size.height - myScopePanel.getPreferredSize().height : size.height); } else { pack(); // set width from replace if search not available and vice versa final Dimension otherSize = dimensionService.getSize(myReplace ? SEARCH_DIMENSION_SERVICE_KEY : REPLACE_DIMENSION_SERVICE_KEY, myProject); if (otherSize != null) { setSize(otherSize.width, getSize().height); } } if (myEditConfigOnly) return super.getInitialLocation(); final Point location = dimensionService.getLocation(SEARCH_DIMENSION_SERVICE_KEY, myProject); return (location == null) ? super.getInitialLocation() : location; }
getInitialLocation
292,534
void () { if (!myConfigurationLoaded) { setTextFromContext(); } super.show(); }
show
292,535
void () { if (!Registry.is("ssr.template.from.selection.builder")) { return; } final Document document = mySearchCriteriaEdit.getDocument(); final PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(document); assert psiFile != null; final TemplateBuilder builder = StructuralSearchTemplateBuilder.getInstance().buildTemplate(psiFile); if (builder == null) return; WriteCommandAction .runWriteCommandAction(myProject, SSRBundle.message("command.name.live.search.template.builder"), "Structural Search", () -> builder.run(Objects.requireNonNull(mySearchCriteriaEdit.getEditor()), true)); }
startTemplate
292,536
JComponent () { return mySearchCriteriaEdit; }
getPreferredFocusedComponent
292,537
void () { super.doCancelAction(); removeMatchHighlights(); }
doCancelAction
292,538
void () { if (!getOKAction().isEnabled()) return; if (!myPinned) close(OK_EXIT_CODE); removeMatchHighlights(); myAlarm.cancelAllRequests(); myConfiguration.removeUnusedVariables(); if (myEditConfigOnly) return; final SearchScope scope = myScopePanel.getScope(); if (scope instanceof GlobalSearchScopesCore.DirectoryScope directoryScope) { FindInProjectSettings.getInstance(myProject).addDirectory(directoryScope.getDirectory().getPresentableUrl()); } FindSettings.getInstance().setShowResultsInSeparateView(myOpenInNewTab.isSelected()); ConfigurationManager.getInstance(myProject).addHistoryConfiguration(getConfiguration()); startSearching(); }
doOKAction
292,539
Configuration () { saveConfiguration(); //final MatchOptions matchOptions = myConfiguration.getMatchOptions(); //assert matchOptions.isCaseSensitiveMatch() == myMatchCase.isSelected(); //assert matchOptions.isSearchInjectedCode() == myInjected.isSelected(); //final ReplaceOptions replaceOptions = myConfiguration.getReplaceOptions(); //assert replaceOptions.isToReformatAccordingToStyle() == myReformat.isSelected(); //assert replaceOptions.isToUseStaticImport() == myStaticImport.isSelected(); //assert replaceOptions.isToShortenFQN() == myShortenFqn.isSelected(); return myReplace ? new ReplaceConfiguration(myConfiguration) : new SearchConfiguration(myConfiguration); }
getConfiguration
292,540
void () { if (myEditConfigOnly || myRangeHighlighters.isEmpty()) { return; } // retrieval of editor needs to be outside invokeLater(), otherwise the editor might have already changed. final Editor editor = myEditor; if (editor == null) { return; } ApplicationManager.getApplication().invokeLater(() -> { if (myProject.isDisposed()) return; final HighlightManager highlightManager = HighlightManager.getInstance(myProject); for (RangeHighlighter highlighter : myRangeHighlighters) { highlightManager.removeSegmentHighlighter(editor, highlighter); } WindowManager.getInstance().getStatusBar(myProject).setInfo(""); myRangeHighlighters.clear(); }); }
removeMatchHighlights
292,541
void () { if (myEditConfigOnly) return; ReadAction.nonBlocking(() -> { if (DumbService.isDumb(myProject)) { // Search hits in the current editor are not shown when dumb. return null; } final Editor editor = myEditor; if (editor == null) { return null; } final Document document = editor.getDocument(); final PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(document); if (file == null) { return null; } final MatchOptions matchOptions = getConfiguration().getMatchOptions(); matchOptions.setScope(new LocalSearchScope(file, PredefinedSearchScopeProviderImpl.getCurrentFileScopeName())); final CollectingMatchResultSink sink = new CollectingMatchResultSink(); try { new Matcher(myProject, matchOptions).findMatches(sink); final List<MatchResult> matches = sink.getMatches(); removeMatchHighlights(); addMatchHighlights(matches, editor, file, SSRBundle.message("status.bar.text.results.found.in.current.file", matches.size())); } catch (MalformedPatternException | UnsupportedPatternException e) { reportMessage(e.getMessage().replace(ScriptSupport.UUID, ""), true, mySearchCriteriaEdit); removeMatchHighlights(); } return null; }) .withDocumentsCommitted(myProject) .expireWith(getDisposable()) .coalesceBy(this) .submit(AppExecutorUtil.getAppExecutorService()); }
addMatchHighlights
292,542
void (@NotNull List<? extends MatchResult> matchResults, @NotNull Editor editor, @NotNull PsiFile file, @NlsContexts.StatusBarText @Nullable String statusBarText) { ApplicationManager.getApplication().invokeLater(() -> { if (myProject.isDisposed()) { return; } if (!matchResults.isEmpty()) { for (MatchResult result : matchResults) { final PsiElement match = result.getMatch(); if (match == null || match.getContainingFile() != file) continue; int start = -1; int end = -1; if (MatchResult.MULTI_LINE_MATCH.equals(result.getName())) { for (MatchResult child : result.getChildren()) { final TextRange range = child.getMatch().getTextRange(); final int startOffset = range.getStartOffset(); if (start == -1 || start > startOffset) { start = startOffset; } final int endOffset = range.getEndOffset(); if (end < endOffset) { end = endOffset; } } } else { final TextRange range = match.getTextRange(); start = range.getStartOffset(); end = range.getEndOffset(); } final HighlightManager highlightManager = HighlightManager.getInstance(myProject); highlightManager.addRangeHighlight(editor, start, end, EditorColors.SEARCH_RESULT_ATTRIBUTES, false, myRangeHighlighters); } HighlightHandlerBase.setupFindModel(myProject); } WindowManager.getInstance().getStatusBar(myProject).setInfo(statusBarText); }); }
addMatchHighlights
292,543
boolean () { return false; }
continuousValidation
292,544
List<ValidationInfo> () { final JRootPane component = getRootPane(); if (component == null || myPerformAction) { return Collections.emptyList(); } final List<ValidationInfo> errors = new SmartList<>(); saveConfiguration(); final MatchOptions matchOptions = myConfiguration.getMatchOptions(); try { CompiledPattern compiledPattern = null; try { compiledPattern = PatternCompiler.compilePattern(myProject, matchOptions, true, !myEditConfigOnly && !myPerformAction); } catch (MalformedPatternException e) { removeMatchHighlights(); if (!StringUtil.isEmptyOrSpaces(matchOptions.getSearchPattern())) { final String message = e.getMessage(); errors.add(new ValidationInfo((message == null) ? SSRBundle.message("this.pattern.is.malformed.message") : message, mySearchCriteriaEdit)); } } catch (UnsupportedPatternException | NoMatchFoundException e) { removeMatchHighlights(); errors.add(new ValidationInfo(e.getMessage(), mySearchCriteriaEdit)); } if (myReplace) { try { Replacer.checkReplacementPattern(myProject, myConfiguration.getReplaceOptions()); } catch (UnsupportedPatternException | MalformedPatternException e) { errors.add(new ValidationInfo(e.getMessage(), myReplaceCriteriaEdit)); } } initializeFilterPanel(compiledPattern); if (compiledPattern != null) { addMatchHighlights(); } else { errors.add(new ValidationInfo("")); } ApplicationManager.getApplication().invokeLater(() -> setSearchTargets(myConfiguration.getMatchOptions()), ModalityState.stateForComponent(component)); } catch (ProcessCanceledException e) { throw e; } catch (RuntimeException e) { Logger.getInstance(StructuralSearchDialog.class).error(e); } return errors; }
doValidateAll
292,545
void (@NlsContexts.PopupContent @Nullable String message, boolean error, @NotNull JComponent component) { ApplicationManager.getApplication().invokeLater(() -> { if (isDisposed()) return; if (myBalloon != null) myBalloon.hide(); if (message == null) return; myBalloon = JBPopupFactory.getInstance() .createHtmlTextBalloonBuilder(message, error ? MessageType.ERROR : MessageType.WARNING, null) .setHideOnFrameResize(false) .createBalloon(); myBalloon.show(new RelativePoint(component, new Point(component.getWidth() / 2, component.getHeight())), Balloon.Position.below); Disposer.register(myDisposable, myBalloon); }, ModalityState.stateForComponent(component)); }
reportMessage
292,546
void () { final MatchOptions matchOptions = myConfiguration.getMatchOptions(); int scripts = 0; for (String name : matchOptions.getVariableConstraintNames()) { final MatchVariableConstraint constraint = matchOptions.getVariableConstraint(name); if (constraint.getScriptCodeConstraint().length() > 2) scripts++; } final ReplaceOptions replaceOptions = myConfiguration.getReplaceOptions(); for (ReplacementVariableDefinition variableDefinition : replaceOptions.getVariableDefinitions()) { if (variableDefinition.getScriptCodeConstraint().length() > 2) scripts++; } if (scripts > 0) { NotificationGroupManager.getInstance() .getNotificationGroup(UIUtil.SSR_NOTIFICATION_GROUP_ID) .createNotification( SSRBundle.message("import.template.script.warning.title"), SSRBundle.message("import.template.script.warning", ApplicationNamesInfo.getInstance().getFullProductName(), scripts), NotificationType.WARNING ) .notify(myProject); } }
securityCheck
292,547
void (boolean visible) { if (visible && myFilterPanel.getVariable() == null) { myFilterPanel.initFilters(UIUtil.getOrAddVariableConstraint(Configuration.CONTEXT_VAR_NAME, myConfiguration)); } if (isFilterPanelVisible() != visible) { mySearchEditorPanel.setSecondComponent(visible ? myFilterPanel.getComponent() : null); } }
setFilterPanelVisible
292,548
boolean () { return mySearchEditorPanel.getSecondComponent() != null; }
isFilterPanelVisible
292,549
void (boolean visible) { if (visible) { myMainSplitter.setFirstComponent(myExistingTemplatesComponent.getTemplatesPanel()); } else { myMainSplitter.setFirstComponent(null); } }
setExistingTemplatesPanelVisible
292,550
boolean () { return myMainSplitter.getFirstComponent() != null; }
isExistingTemplatesPanelVisible
292,551
void (MatchOptions matchOptions) { final List<String> names = new ArrayList<>(matchOptions.getUsedVariableNames()); Collections.sort(names); names.remove(Configuration.CONTEXT_VAR_NAME); names.add(SSRBundle.message("complete.match.variable.name")); myTargetComboBox.setItems(names); myTargetComboBox.setEnabled(names.size() > 1); for (@NlsSafe String name : names) { final MatchVariableConstraint constraint = matchOptions.getVariableConstraint(name); if (constraint != null && constraint.isPartOfSearchResults()) { myTargetComboBox.setSelectedItem(name); return; } } myTargetComboBox.setSelectedItem(SSRBundle.message("complete.match.variable.name")); }
setSearchTargets
292,552
boolean (String text) { if (text == null) { return false; } try { final Configuration configuration = ConfigurationUtil.fromXml(text); if (configuration == null) { return false; } if (configuration instanceof ReplaceConfiguration && !myReplace) { switchSearchReplace(); } loadConfiguration(configuration); securityCheck(); } catch (JDOMException e) { reportMessage(SSRBundle.message("import.template.script.corrupted") + '\n' + e.getMessage(), false, mySearchCriteriaEdit); } return true; }
loadConfiguration
292,553
void (Configuration configuration) { myConfigurationLoaded = true; myConfiguration = createConfiguration(configuration); final MatchOptions matchOptions = myConfiguration.getMatchOptions(); final ReplaceOptions replaceOptions = myConfiguration.getReplaceOptions(); if (myEditConfigOnly) { myMatchCase.setSelected(matchOptions.isCaseSensitiveMatch()); myInjected.setSelected(false); myReformat.setSelected(replaceOptions.isToReformatAccordingToStyle()); myStaticImport.setSelected(replaceOptions.isToUseStaticImport()); myShortenFqn.setSelected(replaceOptions.isToShortenFQN()); } setSearchTargets(matchOptions); myFileTypeChooser.setSelectedItem(matchOptions.getFileType(), matchOptions.getDialect(), matchOptions.getPatternContext()); final Editor searchEditor = mySearchCriteriaEdit.getEditor(); if (searchEditor != null) { searchEditor.putUserData(SubstitutionShortInfoHandler.CURRENT_CONFIGURATION_KEY, myConfiguration); } setEditorContent(false, matchOptions.getSearchPattern()); final Editor replaceEditor = myReplaceCriteriaEdit.getEditor(); if (replaceEditor != null) { replaceEditor.putUserData(SubstitutionShortInfoHandler.CURRENT_CONFIGURATION_KEY, myConfiguration); } setEditorContent(true, replaceOptions.getReplacement()); updateOptions(); }
loadConfiguration
292,554
void (boolean replace, String text) { myChangedConfiguration = true; UIUtil.setContent(replace ? myReplaceCriteriaEdit : mySearchCriteriaEdit, text); myChangedConfiguration = false; }
setEditorContent
292,555
void () { final MatchOptions matchOptions = myConfiguration.getMatchOptions(); if (myScopePanel.isVisible()) { final SearchScope scope = myScopePanel.getScope(); final boolean searchWithinHierarchy = IdeBundle.message("scope.class.hierarchy").equals(scope.getDisplayName()); // We need to reset search within hierarchy scope during online validation since the scope works with user participation matchOptions.setScope(searchWithinHierarchy && !myPerformAction ? GlobalSearchScope.projectScope(myProject) : scope); } else { matchOptions.setScope(null); } matchOptions.setSearchPattern(getPattern(mySearchCriteriaEdit)); matchOptions.setRecursiveSearch(!myReplace); final ReplaceOptions replaceOptions = myConfiguration.getReplaceOptions(); replaceOptions.setReplacement(getPattern(myReplaceCriteriaEdit)); }
saveConfiguration
292,556
String (EditorTextField textField) { final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); if (profile != null) { final Document document = textField.getDocument(); final String pattern = ReadAction.compute(() -> { final PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(document); assert file != null; return profile.getCodeFragmentText(file); }); return pattern.isEmpty() ? textField.getText() : pattern; } return textField.getText(); }
getPattern
292,557
void () { myProject.putUserData(STRUCTURAL_SEARCH_PREVIOUS_CONFIGURATION, myConfiguration); storeDimensions(); saveUIState(); StructuralSearchPlugin.getInstance(myProject).setDialog(null); myAlarm.cancelAllRequests(); mySearchCriteriaEdit.removeNotify(); myReplaceCriteriaEdit.removeNotify(); removeRestartHighlightingListenerFromCurrentEditor(); super.dispose(); }
dispose
292,558
void () { final UIState uiState = UIState.getInstance(); if (isFilterPanelVisible() != uiState.filtersVisible) { mySearchEditorPanel.setSecondComponent(uiState.filtersVisible ? myFilterPanel.getComponent() : null); } setExistingTemplatesPanelVisible(uiState.existingTemplatesVisible); myExistingTemplatesComponent.setTreeState(uiState.templatesTreeState); if (!myEditConfigOnly) { myPinned = uiState.pinned; myInjected.setSelected(uiState.searchInjectedCode); myMatchCase.setSelected(uiState.matchCase); if (uiState.scopeDescriptor != null && uiState.scopeType != null) { myScopePanel.setScope(Scopes.createScope(myProject, uiState.scopeDescriptor, uiState.scopeType)); } myShortenFqn.setSelected(uiState.shortenFQNames); myStaticImport.setSelected(uiState.useStaticImport); myReformat.setSelected(uiState.reformat); } }
loadUIState
292,559
void () { if (mySearchEditorPanel == null) return; final UIState uiState = UIState.getInstance(); uiState.filtersVisible = isFilterPanelVisible(); uiState.existingTemplatesVisible = isExistingTemplatesPanelVisible(); uiState.templatesTreeState = myExistingTemplatesComponent.getTreeState(); if (!myEditConfigOnly) { uiState.pinned = myPinned; if (myInjected.isVisible()) { uiState.searchInjectedCode = myInjected.isSelected(); } uiState.matchCase = myMatchCase.isSelected(); if (myScopePanel.isVisible()) { final SearchScope scope = myScopePanel.getScope(); uiState.scopeDescriptor = Scopes.getDescriptor(scope); uiState.scopeType = Scopes.getType(scope); } if (myReplace) { if (myShortenFqn.isVisible()) { uiState.shortenFQNames = myShortenFqn.isSelected(); } if (myStaticImport.isVisible()) { uiState.useStaticImport = myStaticImport.isSelected(); } uiState.reformat = myReformat.isSelected(); } } }
saveUIState
292,560
void () { if (myEditConfigOnly) return; // don't store dimensions when editing structural search inspection patterns final String key1 = myReplace ? REPLACE_DIMENSION_SERVICE_KEY : SEARCH_DIMENSION_SERVICE_KEY; final String key2 = myReplace ? SEARCH_DIMENSION_SERVICE_KEY : REPLACE_DIMENSION_SERVICE_KEY; final Point location = getLocation(); if (location.x < 0) location.x = 0; if (location.y < 0) location.y = 0; final DimensionService dimensionService = DimensionService.getInstance(); dimensionService.setLocation(SEARCH_DIMENSION_SERVICE_KEY, location, myProject); final Dimension size = getSize(); dimensionService.setSize(key1, size, myProject); final Dimension otherSize = dimensionService.getSize(key2, myProject); if (otherSize != null && otherSize.width != size.width) { otherSize.width = size.width; dimensionService.setSize(key2, otherSize, myProject); } }
storeDimensions
292,561
String () { return "find.structuredSearch"; }
getHelpId
292,562
void () { final var scheme = EditorColorsManager.getInstance().getGlobalScheme(); myComponentsWithEditorBackground.forEach(component -> { component.setBackground(scheme.getDefaultBackground()); }); final var borderTopBottom = JBUI.Borders.customLine(JBUI.CurrentTheme.Editor.BORDER_COLOR, 1, 0, 1, 0); if (myEditConfigOnly) { final var borderTopOnly = JBUI.Borders.customLine(JBUI.CurrentTheme.Editor.BORDER_COLOR, 1, 0, 0, 0); if (mySearchWrapper != null) mySearchWrapper.setBorder(myReplace ? borderTopBottom : borderTopOnly); if (myReplaceWrapper != null) myReplaceWrapper.setBorder(borderTopOnly); } else { if (mySearchWrapper != null) mySearchWrapper.setBorder(borderTopBottom); if (myReplaceWrapper != null) myReplaceWrapper.setBorder(borderTopBottom); } myExistingTemplatesComponent.updateColors(); }
updateColors
292,563
void () { String text = ConfigurationUtil.toXml(getConfiguration()); String html = "<html><body><pre><code>" + StringUtil.escapeXmlEntities(text) + "</code></pre></body></html>"; CopyPasteManager.getInstance().setContents(new TextTransferable(html, text)); }
exportToClipboard
292,564
void () { final String contents = CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor); if (!loadConfiguration(contents)) { reportMessage(SSRBundle.message("no.template.found.warning"), false, mySearchCriteriaEdit); } }
importFromClipboard
292,565
void () { storeDimensions(); myReplace = !myReplace; setTitle(getDefaultTitle()); myReplacePanel.setVisible(myReplace); loadConfiguration(myConfiguration); final Dimension size = DimensionService.getInstance().getSize(myReplace ? REPLACE_DIMENSION_SERVICE_KEY : SEARCH_DIMENSION_SERVICE_KEY, myProject); if (size != null) { setSize(size.width, size.height); } else { pack(); } }
switchSearchReplace
292,566
void (Component c, Graphics g, int x, int y, int width, int height) { final EditorTextField editorTextField = ComponentUtil.getParentOfType((Class<? extends EditorTextField>)EditorTextField.class, c); if (editorTextField == null) { return; } DarculaUIUtil.Outline object = DarculaUIUtil.getOutline(editorTextField); if (DarculaUIUtil.isWarningOrError(object)) { myErrorBorder.paintBorder(c, g, x, y, width, height); } }
paintBorder
292,567
Insets (Component c) { return myErrorBorder.getBorderInsets(c); }
getBorderInsets
292,568
boolean () { return false; }
isBorderOpaque
292,569
void (@NotNull AnActionEvent e) { switchSearchReplace(); }
actionPerformed
292,570
void (@NotNull AnActionEvent e) { e.getPresentation().setText(SSRBundle.messagePointer(myReplace ? "switch.to.search.action" : "switch.to.replace.action")); }
update
292,571
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
292,572
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!StringUtil.isEmptyOrSpaces(mySearchCriteriaEdit.getText())); }
update
292,573
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
292,574
void (@NotNull AnActionEvent e) { exportToClipboard(); }
actionPerformed
292,575
void (@NotNull AnActionEvent e) { importFromClipboard(); }
actionPerformed
292,576
EditorEx () { final EditorEx editor = super.createEditor(); editor.setHorizontalScrollbarVisible(true); editor.setVerticalScrollbarVisible(true); final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(myFileType); if (profile != null) { TemplateEditorUtil.setHighlighter(editor, UIUtil.getTemplateContextType(profile)); } SubstitutionShortInfoHandler.install(editor, myFilterPanel, variableName -> { if (variableName.endsWith(ReplaceConfiguration.REPLACEMENT_VARIABLE_SUFFIX)) { //noinspection AssignmentToLambdaParameter variableName = StringUtil.trimEnd(variableName, ReplaceConfiguration.REPLACEMENT_VARIABLE_SUFFIX); assert myReplace; myFilterPanel.initFilters(UIUtil.getOrAddReplacementVariable(variableName, myConfiguration)); } else{ myFilterPanel.initFilters(UIUtil.getOrAddVariableConstraint(variableName, myConfiguration)); } }, myDisposable, myReplace); editor.putUserData(SubstitutionShortInfoHandler.CURRENT_CONFIGURATION_KEY, myConfiguration); getDocument().putUserData(STRUCTURAL_SEARCH_ERROR_CALLBACK, () -> { if (getClientProperty("JComponent.outline") == null) initValidation(); }); TextCompletionUtil.installCompletionHint(editor); editor.putUserData(STRUCTURAL_SEARCH_DIALOG, StructuralSearchDialog.this); editor.setEmbeddedIntoDialogWrapper(true); editor.putUserData(IncrementalFindAction.SEARCH_DISABLED, Boolean.TRUE); return editor; }
createEditor
292,577
void (@NotNull EditorEx editor) { setupBorder(editor); final JScrollPane scrollPane = editor.getScrollPane(); scrollPane.setBorder(new ErrorBorder(scrollPane.getBorder())); }
updateBorder
292,578
String () { return name; }
getName
292,579
String () { final LanguageFileType type = getFileType(); final String name = type == null ? CoreBundle.message("filetype.unknown.display.name") : type.getLanguage().getDisplayName(); return isPredefined() ? SSRBundle.message("predefined.configuration.type.text", name) : SSRBundle.message("predefined.configuration.type.text.user.defined", name); }
getTypeText
292,580
String () { return category; }
getCategory
292,581
void (@NotNull String category) { this.category = category; }
setCategory
292,582
long () { return created; }
getCreated
292,583
void (long created) { if (predefined) { throw new AssertionError(); } this.created = created; }
setCreated
292,584
String () { if (uuid == null) { uuid = UUID.nameUUIDFromBytes(name.getBytes(StandardCharsets.UTF_8)).toString(); } return uuid; }
getUuid
292,585
void (@Nullable String uuid) { this.uuid = uuid; }
setUuid
292,586
void (String description) { this.description = description; }
setDescription
292,587
void (String suppressId) { this.suppressId = suppressId; }
setSuppressId
292,588
void (String problemDescriptor) { this.problemDescriptor = problemDescriptor; }
setProblemDescriptor
292,589
boolean () { return cleanup; }
isCleanup
292,590
void (boolean cleanup) { this.cleanup = cleanup; }
setCleanup
292,591
int () { return order; }
getOrder
292,592
void (int order) { if (order < 0) throw new IllegalArgumentException(); this.order = order; }
setOrder
292,593
void (Element element) { //noinspection HardCodedStringLiteral name = ObjectUtils.notNull(element.getAttributeValue(NAME_ATTRIBUTE_NAME), ""); final Attribute createdAttribute = element.getAttribute(CREATED_ATTRIBUTE_NAME); if (createdAttribute != null) { try { created = createdAttribute.getLongValue(); } catch (DataConversionException ignore) {} } final Attribute uuidAttribute = element.getAttribute(UUID_ATTRIBUTE_NAME); if (uuidAttribute != null) { try { uuid = uuidAttribute.getValue(); } catch (IllegalArgumentException ignore) {} } final Attribute descriptionAttribute = element.getAttribute(DESCRIPTION_ATTRIBUTE_NAME); if (descriptionAttribute != null) { description = descriptionAttribute.getValue(); } final Attribute suppressIdAttribute = element.getAttribute(SUPPRESS_ID_ATTRIBUTE_NAME); if (suppressIdAttribute != null) { suppressId = suppressIdAttribute.getValue(); } final Attribute problemDescriptorAttribute = element.getAttribute(PROBLEM_DESCRIPTOR_ATTRIBUTE_NAME); if (problemDescriptorAttribute != null) { problemDescriptor = problemDescriptorAttribute.getValue(); } Attribute attribute = element.getAttribute(CLEANUP_ATTRIBUTE_NAME); if (attribute != null) { try { cleanup = attribute.getBooleanValue(); } catch (DataConversionException e) { cleanup = false; } } final Attribute mainAttribute = element.getAttribute(ORDER_ATTRIBUTE_NAME); if (mainAttribute != null) { try { order = Math.max(0, mainAttribute.getIntValue()); } catch (DataConversionException ignore) {} } }
readExternal
292,594
void (Element element) { element.setAttribute(NAME_ATTRIBUTE_NAME,name); if (created > 0) { element.setAttribute(CREATED_ATTRIBUTE_NAME, String.valueOf(created)); } if (uuid != null && !uuid.equals(UUID.nameUUIDFromBytes(name.getBytes(StandardCharsets.UTF_8)).toString())) { element.setAttribute(UUID_ATTRIBUTE_NAME, uuid); } if (!StringUtil.isEmpty(description)) { element.setAttribute(DESCRIPTION_ATTRIBUTE_NAME, description); } if (!StringUtil.isEmpty(suppressId)) { element.setAttribute(SUPPRESS_ID_ATTRIBUTE_NAME, suppressId); } if (!StringUtil.isEmpty(problemDescriptor)) { element.setAttribute(PROBLEM_DESCRIPTOR_ATTRIBUTE_NAME, problemDescriptor); } if (cleanup) { element.setAttribute(CLEANUP_ATTRIBUTE_NAME, String.valueOf(cleanup)); } if (order != 0) { element.setAttribute(ORDER_ATTRIBUTE_NAME, String.valueOf(order)); } }
writeExternal
292,595
boolean () { return predefined; }
isPredefined
292,596
void (boolean predefined) { this.predefined = predefined; }
setPredefined
292,597
boolean (Object configuration) { if (!(configuration instanceof Configuration other)) return false; return Objects.equals(category, other.category) && name.equals(other.name); }
equals
292,598
int () { return 31 * name.hashCode() + (category != null ? category.hashCode() : 0); }
hashCode
292,599
Icon () { final LanguageFileType type = getFileType(); return (type == null || type.getIcon() == null) ? AllIcons.FileTypes.Unknown : type.getIcon(); }
getIcon