-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from rememberber/develop
Develop
- Loading branch information
Showing
13 changed files
with
610 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"windows": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.5.8/MooTool-1.5.8-windows.exe", | ||
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.5.8/MooTool_1.5.8.dmg", | ||
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.5.8/MooTool_1.5.8.deb" | ||
"windows": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.0/MooTool-1.6.0-windows.exe", | ||
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.0/MooTool_1.6.0.dmg", | ||
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.0/MooTool_1.6.0.deb" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/com/luoboduner/moo/tool/ui/dialog/JsonResultDialog.form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.tool.ui.dialog.JsonResultDialog"> | ||
<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="0" left="0" bottom="0" right="0"/> | ||
<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="10" bottom="10" right="10"/> | ||
<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="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="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="OK"/> | ||
</properties> | ||
</component> | ||
</children> | ||
</grid> | ||
</children> | ||
</grid> | ||
<grid id="e3588" binding="mainPanel" layout-manager="BorderLayout" hgap="0" vgap="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/> | ||
</grid> | ||
</children> | ||
</grid> | ||
</form> |
123 changes: 123 additions & 0 deletions
123
src/main/java/com/luoboduner/moo/tool/ui/dialog/JsonResultDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
package com.luoboduner.moo.tool.ui.dialog; | ||
|
||
import com.formdev.flatlaf.util.SystemInfo; | ||
import com.intellij.uiDesigner.core.GridConstraints; | ||
import com.intellij.uiDesigner.core.GridLayoutManager; | ||
import com.intellij.uiDesigner.core.Spacer; | ||
import com.luoboduner.moo.tool.App; | ||
import com.luoboduner.moo.tool.ui.component.textviewer.RegexRSyntaxTextViewer; | ||
import com.luoboduner.moo.tool.ui.component.textviewer.RegexRTextScrollPane; | ||
import com.luoboduner.moo.tool.util.ComponentUtil; | ||
import com.luoboduner.moo.tool.util.ScrollUtil; | ||
import com.luoboduner.moo.tool.util.SystemUtil; | ||
import com.luoboduner.moo.tool.util.UndoUtil; | ||
import org.fife.ui.rsyntaxtextarea.SyntaxConstants; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.KeyEvent; | ||
import java.awt.event.WindowAdapter; | ||
import java.awt.event.WindowEvent; | ||
|
||
public class JsonResultDialog extends JDialog { | ||
private JPanel contentPane; | ||
private JButton buttonOK; | ||
private JPanel mainPanel; | ||
|
||
private RegexRSyntaxTextViewer textArea; | ||
private RegexRTextScrollPane rTextScrollPane; | ||
|
||
public JsonResultDialog(String contentType) { | ||
|
||
super(App.mainFrame, "Result"); | ||
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.6, 0.8); | ||
setContentPane(contentPane); | ||
setModal(true); | ||
getRootPane().setDefaultButton(buttonOK); | ||
|
||
textArea = new RegexRSyntaxTextViewer(); | ||
if ("XML".equals(contentType)) { | ||
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML); | ||
} else if ("JSON".equals(contentType)) { | ||
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); | ||
} | ||
rTextScrollPane = new RegexRTextScrollPane(textArea); | ||
|
||
mainPanel.add(rTextScrollPane, BorderLayout.CENTER); | ||
|
||
UndoUtil.register(textArea); | ||
ScrollUtil.smoothPane(rTextScrollPane); | ||
|
||
if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) { | ||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true); | ||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true); | ||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true); | ||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false); | ||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout(); | ||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0)); | ||
} | ||
|
||
buttonOK.addActionListener(e -> onOK()); | ||
|
||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); | ||
addWindowListener(new WindowAdapter() { | ||
@Override | ||
public void windowClosing(WindowEvent e) { | ||
onOK(); | ||
} | ||
}); | ||
|
||
// call onCancel() on ESCAPE | ||
contentPane.registerKeyboardAction(e -> onOK(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); | ||
|
||
} | ||
|
||
private void onOK() { | ||
dispose(); | ||
} | ||
|
||
public void setToTextArea(String str) { | ||
textArea.setText(str); | ||
} | ||
|
||
{ | ||
// GUI initializer generated by IntelliJ IDEA GUI Designer | ||
// >>> IMPORTANT!! <<< | ||
// DO NOT EDIT OR ADD ANY CODE HERE! | ||
$$$setupUI$$$(); | ||
} | ||
|
||
/** | ||
* Method generated by IntelliJ IDEA GUI Designer | ||
* >>> IMPORTANT!! <<< | ||
* DO NOT edit this method OR call it in your code! | ||
* | ||
* @noinspection ALL | ||
*/ | ||
private void $$$setupUI$$$() { | ||
contentPane = new JPanel(); | ||
contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); | ||
final JPanel panel1 = new JPanel(); | ||
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 10, 10, 10), -1, -1)); | ||
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); | ||
final Spacer spacer1 = new Spacer(); | ||
panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); | ||
final JPanel panel2 = new JPanel(); | ||
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); | ||
panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); | ||
buttonOK = new JButton(); | ||
buttonOK.setText("OK"); | ||
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); | ||
mainPanel = new JPanel(); | ||
mainPanel.setLayout(new BorderLayout(0, 0)); | ||
contentPane.add(mainPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); | ||
} | ||
|
||
/** | ||
* @noinspection ALL | ||
*/ | ||
public JComponent $$$getRootComponent$$$() { | ||
return contentPane; | ||
} | ||
|
||
} |
Oops, something went wrong.