Search in sources :

Example 1 with RTextArea

use of org.fife.ui.rtextarea.RTextArea in project RSyntaxTextArea by bobbylight.

the class TipUtilTest method testToolTipBorder_oneArg_whiteBackground.

/**
 * If the text area uses a white background (typical for "light"
 * application themes), the Look and Feel's default tool tip
 * border should be returned.
 */
@Test
void testToolTipBorder_oneArg_whiteBackground() {
    RTextArea textArea = new RTextArea();
    textArea.setBackground(Color.WHITE);
    Assertions.assertNotNull(TipUtil.getToolTipBackground(textArea));
}
Also used : RTextArea(org.fife.ui.rtextarea.RTextArea) Test(org.junit.jupiter.api.Test)

Example 2 with RTextArea

use of org.fife.ui.rtextarea.RTextArea in project RSyntaxTextArea by bobbylight.

the class TipUtilTest method testToolTipBackground_oneArg_whiteBackground.

/**
 * If the text area uses a white background (typical for "light"
 * application themes), the Look and Feel's default tool tip
 * color should be returned.
 */
@Test
void testToolTipBackground_oneArg_whiteBackground() {
    Color defaultTipBG = TipUtil.getToolTipBackground();
    RTextArea textArea = new RTextArea();
    textArea.setBackground(Color.WHITE);
    Assertions.assertEquals(defaultTipBG, TipUtil.getToolTipBackground(textArea));
}
Also used : RTextArea(org.fife.ui.rtextarea.RTextArea) Test(org.junit.jupiter.api.Test)

Example 3 with RTextArea

use of org.fife.ui.rtextarea.RTextArea in project RSyntaxTextArea by bobbylight.

the class TipUtilTest method testToolTipBorder_oneArg_nonWhiteBackground.

/**
 * If the text area uses some oddball background color, the border
 * returned should coordinate since that's what the tool tip's
 * background color will be.
 */
@Test
void testToolTipBorder_oneArg_nonWhiteBackground() {
    RTextArea textArea = new RTextArea();
    textArea.setBackground(Color.RED);
    Border actual = TipUtil.getToolTipBorder(textArea);
    Assertions.assertTrue(actual instanceof LineBorder);
    Border expected = BorderFactory.createLineBorder(Color.RED.brighter());
    Assertions.assertEquals(Color.RED.brighter(), ((LineBorder) actual).getLineColor());
}
Also used : RTextArea(org.fife.ui.rtextarea.RTextArea) LineBorder(javax.swing.border.LineBorder) LineBorder(javax.swing.border.LineBorder) Border(javax.swing.border.Border) Test(org.junit.jupiter.api.Test)

Example 4 with RTextArea

use of org.fife.ui.rtextarea.RTextArea in project omegaide by omegaui.

the class RSyntaxTextAreaUI method create.

/**
 * Creates the view for an element.
 *
 * @param elem The element.
 * @return The view.
 */
@Override
public View create(Element elem) {
    RTextArea c = getRTextArea();
    if (c instanceof RSyntaxTextArea) {
        RSyntaxTextArea area = (RSyntaxTextArea) c;
        View v;
        if (area.getLineWrap()) {
            v = new WrappedSyntaxView(elem);
        } else {
            v = new SyntaxView(elem);
        }
        return v;
    }
    return null;
}
Also used : RTextArea(org.fife.ui.rtextarea.RTextArea) View(javax.swing.text.View)

Example 5 with RTextArea

use of org.fife.ui.rtextarea.RTextArea in project lara-framework by specs-feup.

the class EditorToolBar method addSearchButtons.

private void addSearchButtons() {
    addNewItem("Find", "find", 0, StrokesAndActions.CTRL_F, a -> editor.getSearchPanel().getFocus());
    addNewItem("Clear Markup", "mark", 0, StrokesAndActions.CTRL_SHIFT_M, a -> {
        RTextArea textArea = getCurrentTab().getTextArea();
        SearchEngine.find(textArea, new SearchContext());
    });
}
Also used : RTextArea(org.fife.ui.rtextarea.RTextArea) SearchContext(org.fife.ui.rtextarea.SearchContext)

Aggregations

RTextArea (org.fife.ui.rtextarea.RTextArea)9 Test (org.junit.jupiter.api.Test)4 View (javax.swing.text.View)3 SearchContext (org.fife.ui.rtextarea.SearchContext)2 Border (javax.swing.border.Border)1 LineBorder (javax.swing.border.LineBorder)1