Search in sources :

Example 1 with FieldEditorFocusListener

use of org.jabref.gui.fieldeditors.FieldEditorFocusListener in project jabref by JabRef.

the class EntryEditor method setupSourcePanel.

private void setupSourcePanel() {
    source = new JTextAreaWithHighlighting();
    addSearchListener((SearchQueryHighlightListener) source);
    source.setEditable(true);
    source.setLineWrap(true);
    source.addFocusListener(new FieldEditorFocusListener());
    // Add the global focus listener, so a menu item can see if this field was focused when an action was called.
    source.addFocusListener(Globals.getFocusListener());
    source.setFont(new Font("Monospaced", Font.PLAIN, Globals.prefs.getInt(JabRefPreferences.FONT_SIZE)));
    setupJTextComponent(source);
    updateSource();
    JScrollPane scrollPane = new JScrollPane(source, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    srcPanel.setLayout(new BorderLayout());
    srcPanel.add(scrollPane, BorderLayout.CENTER);
}
Also used : JScrollPane(javax.swing.JScrollPane) BorderLayout(java.awt.BorderLayout) FieldEditorFocusListener(org.jabref.gui.fieldeditors.FieldEditorFocusListener) JTextAreaWithHighlighting(org.jabref.gui.fieldeditors.JTextAreaWithHighlighting) Font(java.awt.Font)

Aggregations

BorderLayout (java.awt.BorderLayout)1 Font (java.awt.Font)1 JScrollPane (javax.swing.JScrollPane)1 FieldEditorFocusListener (org.jabref.gui.fieldeditors.FieldEditorFocusListener)1 JTextAreaWithHighlighting (org.jabref.gui.fieldeditors.JTextAreaWithHighlighting)1