Skip to content

Commit

Permalink
add System Info Test function menu same as oshi-core
Browse files Browse the repository at this point in the history
  • Loading branch information
rememberber committed Dec 22, 2021
1 parent 26785cf commit fb1af9b
Show file tree
Hide file tree
Showing 5 changed files with 595 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/main/java/com/luoboduner/moo/info/ui/component/TopMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.luoboduner.moo.info.ui.dialog.AboutDialog;
import com.luoboduner.moo.info.ui.dialog.SettingDialog;
import com.luoboduner.moo.info.ui.dialog.SystemEnvResultDialog;
import com.luoboduner.moo.info.ui.dialog.SystemInfoTestDialog;
import com.luoboduner.moo.info.ui.form.MainWindow;
import com.luoboduner.moo.info.util.SystemUtil;
import com.luoboduner.moo.info.util.UpgradeUtil;
Expand Down Expand Up @@ -107,6 +108,12 @@ public void init() {
logMenuItem.addActionListener(e -> logActionPerformed());
appMenu.add(logMenuItem);

// System Info Test
JMenuItem syInfoTestMenuItem = new JMenuItem();
syInfoTestMenuItem.setText("System Info Test");
syInfoTestMenuItem.addActionListener(e -> sysInfoTestActionPerformed());
appMenu.add(syInfoTestMenuItem);

// System environment variables
JMenuItem sysEnvMenuItem = new JMenuItem();
sysEnvMenuItem.setText("System environment variables");
Expand Down Expand Up @@ -335,6 +342,16 @@ private void aboutActionPerformed() {
}
}

private void sysInfoTestActionPerformed() {
try {
SystemInfoTestDialog dialog = new SystemInfoTestDialog();
dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error("Show system info test dialog failed", e2);
}
}

private void sysEnvActionPerformed() {
try {
SystemEnvResultDialog dialog = new SystemEnvResultDialog();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.dialog.SystemInfoTestDialog">
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="48" y="54" width="436" height="297"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<hspacer id="98af6">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="9538f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="true" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e7465" class="javax.swing.JButton" binding="buttonOK">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Start"/>
</properties>
</component>
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Cancel"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="e3588" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="580ba">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="35d0a" class="javax.swing.JTextArea" binding="textArea1" default-binding="true">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
</children>
</grid>
</children>
</grid>
</form>
Loading

0 comments on commit fb1af9b

Please sign in to comment.