Search in sources :

Example 1 with SearchPanel

use of org.gradle.gradleplugin.userinterface.swing.common.SearchPanel in project gradle by gradle.

the class OutputPanel method createSearchPanel.

private Component createSearchPanel() {
    StyleContext styleContent = StyleContext.getDefaultStyleContext();
    AttributeSet highlightStyle = gradleOutputTextPane.getDefaultStyle().copyAttributes();
    highlightStyle = styleContent.addAttribute(highlightStyle, StyleConstants.Foreground, Color.white);
    highlightStyle = styleContent.addAttribute(highlightStyle, StyleConstants.Background, Color.orange);
    highlightStyle = styleContent.addAttribute(highlightStyle, StyleConstants.Underline, true);
    AttributeSet emphasizedHighlightStyle = highlightStyle.copyAttributes();
    emphasizedHighlightStyle = styleContent.addAttribute(emphasizedHighlightStyle, StyleConstants.Foreground, Color.black);
    emphasizedHighlightStyle = styleContent.addAttribute(emphasizedHighlightStyle, StyleConstants.Background, Color.yellow);
    searchPanel = new SearchPanel(new OutputPanelSearchInteraction(gradleOutputTextPane.getTextComponent(), gradleOutputTextPane.getDefaultStyle(), highlightStyle, emphasizedHighlightStyle));
    searchPanel.hide();
    return searchPanel.getComponent();
}
Also used : AttributeSet(javax.swing.text.AttributeSet) SearchPanel(org.gradle.gradleplugin.userinterface.swing.common.SearchPanel) StyleContext(javax.swing.text.StyleContext)

Aggregations

AttributeSet (javax.swing.text.AttributeSet)1 StyleContext (javax.swing.text.StyleContext)1 SearchPanel (org.gradle.gradleplugin.userinterface.swing.common.SearchPanel)1