Skip to content

Commit 1a6e187

Browse files
committed
清理没用代码,更新废弃版本说明
1 parent aed8aea commit 1a6e187

File tree

13 files changed

+36
-454
lines changed

13 files changed

+36
-454
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
- Select the console sql log and right-click "Restore Sql" menu to restore sql.
1111

1212
## Button Features
13-
- Sql Text: Restore sql from text
14-
- Filter: Filter setting
15-
- Format Sql: Output beautiful formatted sql statements
16-
- Rerun: Rerun this plugin
17-
- Stop: Stop filter the sql log
13+
- **Sql Text**: Restore sql from text
14+
- **Filter**: Filter setting
15+
- **Format Sql**: Output beautiful formatted sql statements
16+
- **Rerun**: Rerun this plugin
17+
- **Stop**: Stop filter the sql log
1818

1919
## Example
2020
```sql
@@ -24,23 +24,25 @@ MyBatis Log Test: INFO sql2 - ==> Preparing: update t_table set name = ? where
2424
MyBatis Log Test: INFO sql2 - ==> Parameters: world(String), 123(Integer)
2525
MyBatis Log Test: WARN sql3 - ==> Preparing: delete from t_table where id = ?
2626
MyBatis Log Test: WARN sql3 - ==> Parameters: 123(Integer)
27+
MyBatis Log Test: ERROR sql4 - ==> Preparing: select * from t_table order by id asc
28+
MyBatis Log Test: ERROR sql4 - ==> Parameters:
2729
```
2830
MyBatis Log Plugin output executable sql statements:
2931
```sql
3032
-- 1 MyBatis Log Test: DEBUG sql1 - ==>
3133
select *
3234
FROM t_table
3335
WHERE name = 'hello';
34-
------------------------------------------------------------------------------------------------------------------------
36+
------------------------------------------------------------
3537
-- 2 MyBatis Log Test: INFO sql2 - ==>
3638
update t_table set name = 'world'
3739
WHERE id = 123;
38-
------------------------------------------------------------------------------------------------------------------------
40+
------------------------------------------------------------
3941
-- 3 MyBatis Log Test: WARN sql3 - ==>
4042
delete
4143
FROM t_table
4244
WHERE id = 123;
43-
------------------------------------------------------------------------------------------------------------------------
45+
------------------------------------------------------------
4446
-- 4 MyBatis Log Test: ERROR sql4 - ==>
4547
select *
4648
FROM t_table order by id asc;

resources/META-INF/plugin.xml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,33 @@
11
<idea-plugin>
22
<id>MyBatisLogPlugin</id>
3-
<name>MyBatis Log Plugin</name>
3+
<name>MyBatis Log Plugin(deprecated)</name>
44
<version>2.1.1</version>
55
<vendor email="[email protected]" url="">ob</vendor>
66

77
<description>
88
<![CDATA[
9-
MyBatis Log Plugin
10-
<br/>
11-
-----------------------------------------------------------------------------------------------------------------------
12-
<br/>
13-
Restore the mybatis generate sql to original whole sql.<br/>
14-
It will generate sql statements with replace ? to the really param value.<br/>
15-
Through the "Tools -> MyBatis Log Plugin" menu you can tail the sql log.<br/>
16-
You can selected the "Filter" button on the left to filter the contents don't wanna display.<br/>
17-
You can selected the "Format Sql" button on the left to format the generate sql statements.<br/>
18-
You can select the console sql log and right click "Restore Sql from Selection" menu to restore sql.<br/>
19-
Prerequisite: sql log must contain "Preparing:" and "Parameters:" <br/>
20-
-----------------------------------------------------------------------------------------------------------------------
21-
<br/>
22-
把 mybatis 输出的sql日志还原成完整的sql语句。<br/>
23-
将日志输出的sql语句中的问号 ? 替换成真正的参数值。<br/>
24-
通过 "Tools -> MyBatis Log Plugin" 菜单或快捷键 "Ctrl+Shift+Alt+O" 启用。<br/>
25-
点击窗口左边的 "Filter" 按钮,可以过滤不想要输出的sql语句。<br/>
26-
点击窗口左边的 "Format Sql" 按钮,可以格式化输出的sql语句。<br/>
27-
选中console的sql日志,右击 "Restore Sql from Selection" 菜单可以还原sql语句。<br/>
28-
前提条件:输出的sql日志必须包含"Preparing:"和"Parameters:"才能正常解析。<br/>
29-
<br/>
30-
<a href="https://github.com/kookob/mybatis-log-plugin">Github</a> | <a href="https://github.com/kookob/mybatis-log-plugin/issues">Issues</a><br/>
31-
<br/>
32-
Donate: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2FQY2FH24H4LC&item_name=MyBatis+Log+Plugin&currency_code=USD&source=url">PayPal</a>
33-
| <a href="https://github.com/kookob/mybatis-log-plugin/blob/master/DONATE.md">支付宝&微信</a><br/>
34-
<br/>
35-
<img src="https://plugins.jetbrains.com/files/10065/screenshot_17367.png" />
9+
<b>Restore mybatis sql log to original whole executable sql.</b>
10+
<div>Due to the poor implementation mechanism of this plugin, some version compatibility problems, registration failures, and performance problems often occur.</div>
11+
<div>Therefore, this plugin is no longer maintained and may be removed in the future.</div>
12+
<div>If the plugin works well on your machine, and you choose to continue using this version, there is no problem at all.</div>
13+
<div>I reimplemented the plugin in a better way, uploaded it to the official Marketplace, and set a minimum selling price ($1/year).</div>
14+
<div>If you would like to experience and support the new plugin, please visit the following address:</div>
15+
<div><a href="https://plugins.jetbrains.com/plugin/13905-mybatis-log-plugin"><b>MyBatis Log Plugin</b></a></div>
16+
<div>Thank you!</div>
17+
<div>------------------------------------------------------------</div>
18+
<div>这个插件因为原先的实现机制并不好,导致经常出现一些版本兼容、注册失败以及性能的问题。</div>
19+
<div>所以此插件后续不再维护,将来有可能会被移除。</div>
20+
<div>如果该插件在你机器上运行良好,并且你选择继续使用此版本,也是完全可以的。</div>
21+
<div>我用更好的方式重新实现了一个插件,并上传到官方的Marketplace,且设置了一个最低的售价($1/year)。</div>
22+
<div>如果你愿意体验并支持新的插件,请访问下面地址:
23+
<div><a href="https://plugins.jetbrains.com/plugin/13905-mybatis-log-plugin"><b>MyBatis Log Plugin</b></a></div>
24+
<div>谢谢!</div>
3625
]]>
3726
</description>
3827

3928
<change-notes>
4029
<![CDATA[
41-
<a href="https://github.com/kookob/mybatis-log-plugin/wiki/change-notes">change notes</a>
30+
<a href="https://github.com/kookob/mybatis-log-plugin/wiki/change-notes">Change Notes</a>
4231
<br/>
4332
<a href="https://github.com/kookob/mybatis-log-plugin/wiki/更新日志">更新日志</a>
4433
]]>
@@ -57,19 +46,18 @@
5746
<!-- Add your extensions here -->
5847
<consoleFilterProvider implementation="mybatis.log.MyBatisLogProvider"/>
5948
<executor implementation="mybatis.log.tail.TailRunExecutor" id="MyBatisLogTail"/>
60-
<postStartupActivity implementation="mybatis.log.MyBatisLogStartupActivity"/>
6149
</extensions>
6250

6351
<actions>
6452
<!-- Add your actions here -->
65-
<action id="TailMyBatisLog" class="mybatis.log.action.TailMyBatisLog" icon="/mybatis/log/icon/mybatis.png"
53+
<action id="TailMyBatisLog0" class="mybatis.log.action.TailMyBatisLog" icon="/mybatis/log/icon/mybatis.png"
6654
text="MyBatis Log Plugin" description="MyBatis Log Plugin">
6755
<add-to-group group-id="ToolsMenu" anchor="last"/>
6856
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt shift O"/>
6957
</action>
7058

7159
<!-- restore sql from selection -->
72-
<action class="mybatis.log.action.RestoreSqlForSelection" id="RestoreSqlAction" text="Restore Sql from Selection"
60+
<action class="mybatis.log.action.RestoreSqlForSelection" id="RestoreSqlAction0" text="Restore Sql from Selection"
7361
description="Restore Sql from Selection">
7462
<add-to-group group-id="EditorPopupMenu" anchor="last"/>
7563
<add-to-group group-id="ConsoleEditorPopupMenu" anchor="before" relative-to-action="ConsoleView.ClearAll"/>

src/mybatis/log/MyBatisLogStartupActivity.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/mybatis/log/action/ShowLogInConsoleAction.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.intellij.openapi.project.Project;
66
import com.intellij.openapi.util.Disposer;
77
import mybatis.log.action.gui.FilterSetting;
8-
import mybatis.log.action.gui.SqlText;
98
import mybatis.log.tail.TailContentExecutor;
109
import mybatis.log.util.ConfigUtil;
1110

@@ -21,7 +20,6 @@ public ShowLogInConsoleAction(Project project) {
2120
super();
2221
ConfigUtil.active = true;
2322
ConfigUtil.init(project);
24-
ConfigUtil.sqlTextDialog = new SqlText(project);
2523
}
2624

2725
@Override
@@ -49,13 +47,6 @@ public void showLogInConsole(final Project project) {
4947
dialog.setLocationRelativeTo(null);//位置居中显示
5048
dialog.setVisible(true);
5149
});
52-
executor.withText(() -> {
53-
SqlText sqlText = ConfigUtil.sqlTextDialog;
54-
sqlText.pack();
55-
sqlText.setSize(1000, 600);//配置大小
56-
sqlText.setLocationRelativeTo(null);//位置居中显示
57-
sqlText.setVisible(true);
58-
});
5950
executor.withActivateToolWindow(true);
6051
executor.run();
6152
}

src/mybatis/log/action/gui/FilterSetting.form

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</component>
9191
</children>
9292
</grid>
93-
<grid id="ff265" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
93+
<grid id="ff265" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
9494
<margin top="0" left="0" bottom="0" right="0"/>
9595
<constraints>
9696
<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"/>
@@ -100,15 +100,15 @@
100100
<children>
101101
<component id="897a3" class="javax.swing.JLabel">
102102
<constraints>
103-
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
103+
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
104104
</constraints>
105105
<properties>
106106
<text value="Preparing:"/>
107107
</properties>
108108
</component>
109109
<component id="52be5" class="javax.swing.JTextField" binding="preparingTextField" default-binding="true">
110110
<constraints>
111-
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
111+
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
112112
<preferred-size width="150" height="-1"/>
113113
</grid>
114114
</constraints>
@@ -118,39 +118,22 @@
118118
</component>
119119
<component id="deb76" class="javax.swing.JLabel">
120120
<constraints>
121-
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
121+
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
122122
</constraints>
123123
<properties>
124124
<text value="Parameters:"/>
125125
</properties>
126126
</component>
127127
<component id="68635" class="javax.swing.JTextField" binding="parametersTextField" default-binding="true">
128128
<constraints>
129-
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
129+
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
130130
<preferred-size width="150" height="-1"/>
131131
</grid>
132132
</constraints>
133133
<properties>
134134
<text value="Parameters:"/>
135135
</properties>
136136
</component>
137-
<component id="83725" class="javax.swing.JCheckBox" binding="startupCheckBox" default-binding="true">
138-
<constraints>
139-
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
140-
</constraints>
141-
<properties>
142-
<selected value="true"/>
143-
<text value=""/>
144-
</properties>
145-
</component>
146-
<component id="2b919" class="javax.swing.JLabel">
147-
<constraints>
148-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
149-
</constraints>
150-
<properties>
151-
<text value="Startup:"/>
152-
</properties>
153-
</component>
154137
</children>
155138
</grid>
156139
</children>

src/mybatis/log/action/gui/FilterSetting.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class FilterSetting extends JDialog {
2222
private JTextArea textArea;
2323
private JTextField preparingTextField;
2424
private JTextField parametersTextField;
25-
private JCheckBox startupCheckBox;
2625

2726
public FilterSetting(Project project) {
2827
this.setTitle("Filter Setting"); //设置标题
@@ -33,8 +32,6 @@ public FilterSetting(Project project) {
3332
}
3433
this.preparingTextField.setText(ConfigUtil.getPreparing(project));
3534
this.parametersTextField.setText(ConfigUtil.getParameters(project));
36-
int startup = PropertiesComponent.getInstance(project).getInt(StringConst.STARTUP_KEY, 1);
37-
startupCheckBox.setSelected(startup == 1);
3835

3936
setContentPane(contentPane);
4037
setModal(true);
@@ -79,7 +76,6 @@ private void onOK(Project project) {
7976
}
8077
ConfigUtil.setPreparing(project, preparingText);
8178
ConfigUtil.setParameters(project, parametersText);
82-
ConfigUtil.setStartup(project, startupCheckBox.isSelected() ? 1 : 0);
8379
this.setVisible(false);
8480
}
8581

0 commit comments

Comments
 (0)