Skip to content

Conversation

@gk-brown
Copy link
Contributor

No description provided.

@gk-brown gk-brown changed the base branch from master to v3.5 November 15, 2025 15:37

@Outlet
private JMenuItem saveItem;
// --- UI Components (Injected by Sierra) ---
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Current convention is to declare outlets as follows, although obviously either will work.

Initializing the value to null avoids a warning in Intellij.

@Outlet
private JSplitPane splitPane;

@Outlet
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This outlet is not needed when the editor pane is declared in markup - see below.

* business logic.
*/
public class MainFrame extends JFrame {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless you plan to serialize the frame instance, this declaration isn't strictly necessary.

private JLabel filePathLabel; // The <label> for the file path

// --- Manually Created Components ---
private RSyntaxTextArea editorPane;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to markup.

private RSyntaxTextArea editorPane;

public MainFrame() {
super("Sierra UI Previewer");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Minor - this is not needed.

public class SierraPreviewerApp {

public static void main(String[] args) {
FlatLightLaf.setup();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the recommended way to initialize FlatLaf.

// --- Manually Created Components ---
private RSyntaxTextArea editorPane;
@Outlet
private RSyntaxTextArea editorPane;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Existing Sierra code uses spaces rather than tabs.

setAutoActivationRules(true, "< ");
}

private void loadTags() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Minor simplification that avoids unnecessary local declarations.

<label name="filePathLabel" text="" padding="4, 6, 4, 6"/>
<split-pane name="splitPane" resizeWeight="0.5" weight="1">
<scroll-pane weight="1">
<syntax-text-area name="editorPane" columns="80" rows="25"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Declare editor in markup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized that this will make it seem like "syntax-text-area" is part of the standard distribution, which it is not. So maybe this is not a good idea after all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah agree - only valid widgets should be in the xml - even if they are placeholders to be replaced at runtime

codeFoldingEnabled="true"
antiAliasingEnabled="true"/>
</scroll-pane>
<column-panel name="previewPanel" padding="5, 5, 5, 5" weight="1"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Drop placeholder label that didn't seem to be visible in UI.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah at one point I had it showing and then somehow messed it up

// Map to store the final resolved attributes for each tag
// TagName -> {AttributeName -> Description/ValueDefinitionString}
private final Map<String, Map<String, String>> elementAttributeDefinitions = new HashMap<>();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trailing whitespace is trimmed.

Copy link
Contributor

@lawson89 lawson89 left a comment

Choose a reason for hiding this comment

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

Greg - I am good with all these changes!

@gk-brown gk-brown closed this Nov 16, 2025
@gk-brown gk-brown deleted the v3.5-discussion branch November 16, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants