mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-05 04:38:10 +08:00
PL-6951 Implement line numbers for DesktopSourceCodeEditor
This commit is contained in:
parent
f63439105d
commit
6e8d14bfe3
@ -23,6 +23,7 @@ import com.haulmont.cuba.gui.components.autocomplete.Suggester;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxDocument;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
|
||||
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
|
||||
import org.fife.ui.rtextarea.RTextScrollPane;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.Document;
|
||||
@ -50,7 +51,10 @@ public class DesktopSourceCodeEditor extends DesktopAbstractTextField<RSyntaxTex
|
||||
int height = (int) impl.getPreferredSize().getHeight();
|
||||
impl.setMinimumSize(new Dimension(0, height));
|
||||
|
||||
composition = new JScrollPane(impl);
|
||||
RTextScrollPane scrollPane = new RTextScrollPane(impl);
|
||||
scrollPane.setLineNumbersEnabled(showGutter);
|
||||
|
||||
composition = scrollPane;
|
||||
composition.setPreferredSize(new Dimension(150, height));
|
||||
composition.setMinimumSize(new Dimension(0, height));
|
||||
|
||||
@ -151,6 +155,7 @@ public class DesktopSourceCodeEditor extends DesktopAbstractTextField<RSyntaxTex
|
||||
@Override
|
||||
public void setShowGutter(boolean showGutter) {
|
||||
this.showGutter = showGutter;
|
||||
((RTextScrollPane)composition).setLineNumbersEnabled(showGutter);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user