Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.fife.ui.autocomplete.AutoCompletion;
import org.fife.ui.autocomplete.CompletionProvider;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rtextarea.RTextScrollPane;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
import org.fife.ui.rtextarea.SearchEngine;
import org.fife.ui.rtextarea.SearchResult;
Expand All @@ -38,7 +39,6 @@
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.KeyStroke;
import javax.swing.SwingWorker;
Expand Down Expand Up @@ -85,19 +85,21 @@ public class MainFrame extends JFrame implements SearchListener {
private @Outlet JMenuItem exitItem = null;
private @Outlet JMenuItem aboutItem = null;
private @Outlet JSplitPane splitPane = null;
private @Outlet JScrollPane editorScrollPane = null;
private @Outlet JPanel previewPanel = null;
private @Outlet JLabel statusBar = null;
private @Outlet JLabel filePathLabel = null; // The <label> for the file path
private @Outlet JLabel filePathLabel = null;


// --- Manually Created Components ---
private FindDialog findDialog = null;
private ReplaceDialog replaceDialog = null;
private RSyntaxTextArea editorPane = null;
private RTextScrollPane editorScrollPane = null;


public MainFrame() {
super("Sierra UI Previewer");

Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Trailing whitespace should be removed for consistency with the rest of the codebase.

Suggested change

Copilot uses AI. Check for mistakes.
renderingEngine = new RenderingEngine();
recentFilesManager = new RecentFilesManager(MainFrame.class);

Expand Down Expand Up @@ -245,7 +247,6 @@ private void setupCustomEditor() {
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
editorPane.setCodeFoldingEnabled(true);
editorPane.setAntiAliasingEnabled(true);
editorPane.setEditable(true); // Ensure it's editable

var provider = createCompletionProvider();

Expand All @@ -258,8 +259,11 @@ private void setupCustomEditor() {
if (provider != null) {
ac.install(editorPane);
}
editorScrollPane = new RTextScrollPane(editorPane);
editorScrollPane.setLineNumbersEnabled(true);
editorScrollPane.setFoldIndicatorEnabled(true);
splitPane.setLeftComponent(editorScrollPane);

editorScrollPane.setViewportView(editorPane);
}

// -- Extra search/replace functionality
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</menu-bar>

<split-pane name="splitPane" resizeWeight="0.5" weight="1">
<scroll-pane name="editorScrollPane" weight="1"/>
<label text="Code editor will replace this at runtime"/>
<column-panel name="previewPanel" padding="5, 5, 5, 5" weight="1"/>
</split-pane>

Expand Down