-
Notifications
You must be signed in to change notification settings - Fork 43
Enhanced map variable viewer #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enhance the map variable viewer to support JSON/XML formatting, exporting to disk, and improved search and UI capabilities.
- Replace the NetBeans-generated
.formUI with a programmatic RSyntaxTextArea dialog - Add JSON/XML formatting and export features via a new
ContentFormatter - Introduce a standalone search dialog and context‐menu enhancements
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| client/src/com/mirth/connect/client/ui/ViewContentDialog.java | Revamped UI, added formatting, export, search, and context menus |
| client/src/com/mirth/connect/client/ui/ViewContentDialog.form | Removed legacy NetBeans form file |
Comments suppressed due to low confidence (2)
client/src/com/mirth/connect/client/ui/ViewContentDialog.java:1
- The license header was removed at the top of this file. Please re-add the appropriate license block to comply with project guidelines.
package com.mirth.connect.client.ui;
client/src/com/mirth/connect/client/ui/ViewContentDialog.java:410
- The new
ContentFormatterclass lacks unit tests for JSON, XML, and binary detection branches. Please add test coverage to verify formatting and error cases.
class ContentFormatter {
| // @formatter:off | ||
| package com.mirth.connect.client.ui; | ||
|
|
||
| import java.awt.*; |
Copilot
AI
Jun 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid wildcard imports; explicitly import only the AWT classes you need to improve readability and prevent namespace clashes.
| import java.awt.*; | |
| import java.awt.Frame; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import java.awt.event.KeyEvent; | |
| import java.awt.event.KeyListener; | |
| import java.awt.BorderLayout; | |
| import java.awt.Dimension; | |
| import java.awt.GridBagConstraints; | |
| import java.awt.GridBagLayout; | |
| import java.awt.Insets; | |
| import java.awt.Point; | |
| import java.awt.Toolkit; |
| package com.mirth.connect.client.ui; | ||
|
|
||
| import java.awt.*; | ||
| import java.awt.event.*; |
Copilot
AI
Jun 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid wildcard imports; explicitly import only the event classes you need.
| import java.awt.event.*; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import java.awt.event.KeyEvent; | |
| import java.awt.event.KeyListener; |
| createContentArea(); | ||
|
|
||
| // Create button panel (now includes all buttons) | ||
| createButtonPanel(); |
Copilot
AI
Jun 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call to createButtonPanel() appears unused (its result isn’t assigned or added). Remove the redundant invocation to avoid confusion.
| createButtonPanel(); |
| searchDialog.setVisible(true); | ||
| } | ||
|
|
||
| private void formatContent() { |
Copilot
AI
Jun 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting logic (JSON/XML parsing) runs on the EDT and may block the UI for large inputs. Consider moving it to a background thread or SwingWorker.
| isFormatted = true; | ||
| currentFormat = result.getFormatType(); | ||
| } else { | ||
| showWarning("Could not format content. Format not recognized or content is invalid."); |
Copilot
AI
Jun 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generic warning hides the underlying error. Use the formatter’s getErrorMessage() to display a more informative message.
| showWarning("Could not format content. Format not recognized or content is invalid."); | |
| String errorMessage = result.getErrorMessage(); | |
| if (errorMessage == null || errorMessage.trim().isEmpty()) { | |
| errorMessage = "Could not format content. Format not recognized or content is invalid."; | |
| } | |
| showWarning(errorMessage); |
Enhance the map variable viewer to support JSON/XML formatting, export to disk, etc.