-
Notifications
You must be signed in to change notification settings - Fork 2
feat(core): Add PropertiesDialog #2097
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
|
Thank you for following naming conventions! 😻 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's Guide by SourceryThis pull request introduces a new Sequence diagram for opening the PropertiesDialogsequenceDiagram
participant User
participant QeMenubarConfigrationProvider
participant FxAction
participant PropertiesDialog
User->>QeMenubarConfigrationProvider: Clicks 'Open Properties Dialog'
QeMenubarConfigrationProvider->>FxAction: openPropertiesDialog()
FxAction->>PropertiesDialog: openPropertiesDialog()
PropertiesDialog->>PropertiesDialog: Creates and displays dialog
PropertiesDialog-->>User: Shows the properties dialog
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Their most recently public accepted PR is: #2095 |
|
""" Walkthrough本次变更在应用程序中引入了“系统属性”窗口的功能。主要包括:新增 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Menubar
participant FxAction
participant PropertiesDialog
User->>Menubar: 点击“查看系统属性”菜单项
Menubar->>FxAction: 调用openPropertiesDialog()
FxAction->>PropertiesDialog: 调用openPropertiesDialog()
PropertiesDialog->>User: 显示系统属性对话框
Assessment against linked issues
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Hey @unknowIfGuestInDream - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a more descriptive name than
openPropertiesDialogfor the FxAction. - The
PropertiesDialogcould be made more generic by accepting aPropertiesobject to display.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Actionable comments posted: 2
🧹 Nitpick comments (4)
core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java (3)
39-42: 类注释的准确性可以提高类注释"Property弹窗"与实际功能相比过于简单。建议扩展注释来更准确地描述该对话框的用途和功能,例如"系统属性查看对话框,用于展示JVM相关信息"。
60-61: 考虑添加更多系统信息标签当前对话框只包含一个"JVM"标签。考虑添加更多有用的系统信息标签,如"操作系统"、"环境变量"或"应用程序"等,以提供更完整的系统属性视图。
68-70: 本地化对话框标题对话框标题"Property"是硬编码的,建议使用I18nUtils进行国际化处理,以支持多语言环境。
-FxDialog<VBox> dialog = new FxDialog<VBox>().setTitle("Property").setOwner(FxApp.primaryStage) +FxDialog<VBox> dialog = new FxDialog<VBox>().setTitle(I18nUtils.get("core.dialog.properties.title")).setOwner(FxApp.primaryStage)core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java (1)
407-409: 方法注释应该更详细方法注释"查看系统属性"比较简单,建议扩展注释以包含更多关于此方法功能的信息,例如说明它创建一个操作用于打开系统属性对话框,显示JVM相关信息等。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java(2 hunks)core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java(1 hunks)qe/src/main/java/com/tlcsdm/qe/provider/QeMenubarConfigrationProvider.java(2 hunks)smc/src/main/java/com/tlcsdm/smc/provider/SmcMenubarConfigrationProvider.java(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
smc/src/main/java/com/tlcsdm/smc/provider/SmcMenubarConfigrationProvider.java (2)
core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java (1)
FxAction(70-627)core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxActionGroup.java (1)
FxActionGroup(43-111)
qe/src/main/java/com/tlcsdm/qe/provider/QeMenubarConfigrationProvider.java (2)
core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java (1)
FxAction(70-627)core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxActionGroup.java (1)
FxActionGroup(43-111)
core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java (2)
core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java (1)
PropertiesDialog(43-75)cg/src/main/java/com/tlcsdm/cg/util/I18nUtils.java (1)
I18nUtils(39-58)
core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java (3)
core/src/main/java/com/tlcsdm/core/javafx/FxApp.java (1)
FxApp(41-102)core/src/main/java/com/tlcsdm/core/util/CoreConstant.java (1)
CoreConstant(39-108)core/src/main/java/com/tlcsdm/core/javafx/dialog/FxButtonType.java (1)
FxButtonType(37-56)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: build (17, macos-latest, false)
- GitHub Check: build (17, windows-latest, false)
- GitHub Check: build (21, ubuntu-latest, false)
- GitHub Check: build (21, windows-latest, false)
- GitHub Check: build (21, macos-latest, false)
- GitHub Check: build (17, ubuntu-latest, false)
- GitHub Check: qodana
- GitHub Check: StepSecurity Harden-Runner
- GitHub Check: Summary
🔇 Additional comments (4)
qe/src/main/java/com/tlcsdm/qe/provider/QeMenubarConfigrationProvider.java (2)
109-109: 新增系统属性查看功能成功添加了系统属性查看功能的菜单项,集成在帮助菜单中的适当位置。
195-196: 菜单项位置适当将系统属性对话框菜单项放置在
openUserData和第一个ACTION_SEPARATOR之间的位置合理,保持了菜单结构的一致性。smc/src/main/java/com/tlcsdm/smc/provider/SmcMenubarConfigrationProvider.java (2)
109-109: 新增系统属性查看功能成功添加了系统属性查看功能的菜单项,集成在帮助菜单中的适当位置。
194-195: 菜单项位置适当将系统属性对话框菜单项放置在
openUserData和第一个ACTION_SEPARATOR之间的位置合理,保持了菜单结构的一致性,且与QeMenubarConfigrationProvider中的实现保持了一致。
core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java
Outdated
Show resolved
Hide resolved
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
1fb47d0 to
93278e2
Compare
|
@unknowIfGuestInDream |
3 similar comments
|
@unknowIfGuestInDream |
|
@unknowIfGuestInDream |
|
@unknowIfGuestInDream |
93278e2 to
2e4adf2
Compare
2e4adf2 to
c01feda
Compare
|
@unknowIfGuestInDream |
3 similar comments
|
@unknowIfGuestInDream |
|
@unknowIfGuestInDream |
|
@unknowIfGuestInDream |
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Close #2071 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
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.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
core/src/main/java/com/tlcsdm/core/javafx/richtext/PropertiesArea.java (1)
59-72: 🛠️ Refactor suggestion建议与InformationArea保持一致的边缘情况处理
computeHighlighting方法与新添加的InformationArea类中的同名方法有类似的实现逻辑,但缺少对空文本和未包含等号行的完整处理。建议参考前面对InformationArea的修改建议,同样增强此方法的健壮性。建议统一两个类对边缘情况的处理方式,保持代码风格的一致性:
private StyleSpans<Collection<String>> computeHighlighting(String text) { + if (CharSequenceUtil.isEmpty(text)) { + return StyleSpans.singleton(Collections.emptyList(), 0); + } List<String> list = StrUtil.split(text, "\n"); StyleSpansBuilder<Collection<String>> spansBuilder = new StyleSpansBuilder<>(); + int processedLength = 0; for (String str : list) { List<String> l = CharSequenceUtil.split(str, '=', 2); if (l.size() != 2) { + spansBuilder.add(Collections.emptyList(), str.length() + 1); + processedLength += str.length() + 1; continue; } spansBuilder.add(Collections.singleton("propertyKey"), l.get(0).length()); spansBuilder.add(Collections.singleton("propertyEqu"), 1); spansBuilder.add(Collections.emptyList(), l.get(1).length() + 1); + processedLength += str.length() + 1; } + // 确保处理了所有文本 + if (processedLength < text.length()) { + spansBuilder.add(Collections.emptyList(), text.length() - processedLength); + } return spansBuilder.create(); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
core/src/main/resources/com/tlcsdm/core/static/menubar/properties.pngis excluded by!**/*.png
📒 Files selected for processing (10)
core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java(2 hunks)core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java(1 hunks)core/src/main/java/com/tlcsdm/core/javafx/richtext/InformationArea.java(1 hunks)core/src/main/java/com/tlcsdm/core/javafx/richtext/PropertiesArea.java(1 hunks)core/src/main/java/module-info.java(1 hunks)core/src/main/resources/com/tlcsdm/core/i18n/messages_en.properties(2 hunks)core/src/main/resources/com/tlcsdm/core/i18n/messages_ja.properties(2 hunks)core/src/main/resources/com/tlcsdm/core/i18n/messages_zh.properties(2 hunks)core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/information.css(1 hunks)core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/properties.css(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- core/src/main/java/module-info.java
- core/src/main/resources/com/tlcsdm/core/i18n/messages_zh.properties
- core/src/main/resources/com/tlcsdm/core/i18n/messages_ja.properties
- core/src/main/resources/com/tlcsdm/core/i18n/messages_en.properties
🚧 Files skipped from review as they are similar to previous changes (2)
- core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java
- core/src/main/java/com/tlcsdm/core/javafx/dialog/PropertiesDialog.java
🧰 Additional context used
🪛 Biome (1.9.4)
core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/information.css
[error] 29-29: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
[error] 33-33: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
[error] 34-34: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
[error] 38-38: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/properties.css
[error] 29-29: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: build (21, ubuntu-latest, false)
- GitHub Check: check_bad_merge
- GitHub Check: build (17, windows-latest, false)
- GitHub Check: build (21, windows-latest, false)
- GitHub Check: build (21, macos-latest, false)
- GitHub Check: build (17, ubuntu-latest, false)
- GitHub Check: build (17, macos-latest, false)
- GitHub Check: qodana
- GitHub Check: StepSecurity Harden-Runner
- GitHub Check: Summary
🔇 Additional comments (6)
core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/information.css (3)
28-30: 样式定义清晰明了为所有元素设置白色文本背景色,这与新的
InformationArea组件的设计风格相符。🧰 Tools
🪛 Biome (1.9.4)
[error] 29-29: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
32-35: 键名样式定义适当为信息键名(
.infoKey)设置黑色粗体样式,使键名在视觉上更加突出,有助于提高信息的可读性。🧰 Tools
🪛 Biome (1.9.4)
[error] 33-33: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
[error] 34-34: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
37-39: 等号样式设计合理为等号分隔符(
.infoEqu)使用深灰色(#323338),与键名形成适当的视觉对比,同时保持整体界面的和谐性。🧰 Tools
🪛 Biome (1.9.4)
[error] 38-38: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
core/src/main/java/com/tlcsdm/core/javafx/richtext/InformationArea.java (1)
46-54: 构造函数实现良好构造函数设置了合适的样式类并加载了相应的CSS资源,同时使用
Objects.requireNonNull进行了空检查,避免了潜在的NullPointerException。监听文本属性的变化并实时更新高亮样式的方法也很合理。core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/properties.css (1)
29-29: 背景色改变需考虑与InformationArea的视觉一致性背景色从白色改为灰色可能会影响文本的可读性,并与新添加的
InformationArea组件(使用白色背景)形成视觉上的不一致。建议确认这种对比是否为有意设计。请确认这种背景色的差异是否符合整体UI设计理念,以及是否会影响用户体验。特别是当系统同时显示
PropertiesArea和InformationArea时,不同的背景色是否会导致界面视觉上的不协调。🧰 Tools
🪛 Biome (1.9.4)
[error] 29-29: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
core/src/main/java/com/tlcsdm/core/javafx/richtext/PropertiesArea.java (1)
63-63: 拆分逻辑优化得当将拆分限制为最多2个部分(通过添加limit参数)是一个很好的改进。这样可以正确处理属性值中包含等号的情况,避免了过度拆分导致的样式应用错误。
Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
core/src/main/java/module-info.java(1 hunks)core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/information.css(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- core/src/main/java/module-info.java
🧰 Additional context used
🪛 Biome (1.9.4)
core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/information.css
[error] 29-29: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
[error] 33-33: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
[error] 34-34: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
[error] 38-38: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.
(lint/correctness/noUnknownProperty)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: build (21, windows-latest, false)
- GitHub Check: build (21, macos-latest, false)
- GitHub Check: build (17, ubuntu-latest, false)
- GitHub Check: build (17, windows-latest, false)
- GitHub Check: build (21, ubuntu-latest, false)
- GitHub Check: build (17, macos-latest, false)
- GitHub Check: qodana
- GitHub Check: StepSecurity Harden-Runner
- GitHub Check: Summary
🔇 Additional comments (3)
core/src/main/resources/com/tlcsdm/core/static/javafx/richtext/information.css (3)
1-26: BSD 许可头完整且符合规范
文件包含完整的 BSD 许可证头,版权归属和免责声明描述清晰。
32-35: JavaFX CSS 属性合法,无需更改
-fx-fill和-fx-font-weight是 JavaFX CSS 的标准属性,用于设置文本颜色和字体粗细。可忽略静态分析工具对noUnknownProperty的误报。🧰 Tools
🪛 Biome (1.9.4)
[error] 33-33: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
[error] 34-34: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)
37-39: JavaFX CSS 属性合法,无需更改
.infoEqu中的-fx-fill用于设置等号部分的颜色,符合预期,可以保留。🧰 Tools
🪛 Biome (1.9.4)
[error] 38-38: Unknown property is not allowed.
See CSS Specifications and browser specific properties for more details.
To resolve this issue, replace the unknown property with a valid CSS property.(lint/correctness/noUnknownProperty)

Sweep Summary
Added a new PropertiesDialog component to display system properties in a tabbed interface and integrated it into the help menu of both SMC and QE modules.
PropertiesDialog.javaclass that displays system properties in a tabbed interface with a JVM tab.openPropertiesDialog()methods toFxAction.javato provide standardized access to the new dialog.Ask Sweep AI questions about this PR
Close #2071
Fixes #
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
enhancement,bug,documentationordependenciesSummary by CodeRabbit