1 | public class AnalyzeTableAction extends SquirrelAction implements ISessionAction ↵ | | 1 | public class ExplainSelectTableAction extends SquirrelAction implements ISessionAction ↵
|
2 | {↵ | | 2 | {↵
|
3 | /** Current session. */↵ | | 3 | /** Current session. */↵
|
4 | private ISession _session;↵ | | 4 | private ISession _session;↵
|
|
5 | /** Current plugin. */↵ | | 5 | /** Current plugin. */↵
|
6 | private final MysqlPlugin _plugin;↵ | | 6 | private final MysqlPlugin _plugin;↵
|
|
7 | /**↵ | | 7 | /**↵
|
8 | * Ctor.↵ | | 8 | * Ctor.↵
|
9 | *↵ | | 9 | *↵
|
10 | * @param app Application API.↵ | | 10 | * @param app Application API.↵
|
11 | * @param rsrc Plugins resources.↵ | | 11 | * @param rsrc Plugins resources.↵
|
12 | * @param plugin This plugin.↵ | | 12 | * @param plugin This plugin.↵
|
13 | *↵ | | 13 | *↵
|
14 | * @throws IllegalArgumentException↵ | | 14 | * @throws IllegalArgumentException↵
|
15 | * Thrown if a?<TT>null</TT> <TT>IApplication</TT>,↵ | | 15 | * Thrown if a?<TT>null</TT> <TT>IApplication</TT>,↵
|
16 | * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.↵ | | 16 | * <TT>Resources</TT> or <TT>MysqlPlugin</TT> passed.↵
|
17 | *↵ | | 17 | *↵
|
18 | * @throws IllegalArgumentException↵ | | |
|
19 | * Thrown if an invalid <TT>checktype</TT> passed.↵ | | |
|
20 | */↵ | | |
|
21 | public Analyze↵ | | 18 | /↵
|
22 | TableAction(IApplication app, Resources rsrc,↵ | | 19 | public ExplainSelectTableAction(IApplication app, Resources rsrc,↵
|
23 | MysqlPlugin plugin)↵ | | 20 | MysqlPlugin plugin)↵
|
24 | {↵ | | 21 | {↵
|
25 | super(app, rsrc);↵ | | 22 | super(app, rsrc);↵
|
26 | if (app == null)↵ | | 23 | if (app == null)↵
|
27 | {↵ | | 24 | {↵
|
28 | throw new IllegalArgumentException("IApplication == null");↵ | | 25 | throw new IllegalArgumentException("IApplication == null");↵
|
29 | }↵ | | 26 | }↵
|
30 | if (rsrc == null)↵ | | 27 | if (rsrc == null)↵
|
31 | {↵ | | 28 | {↵
|
32 | throw new IllegalArgumentException("Resources == null");↵ | | 29 | throw new IllegalArgumentException("Resources == null");↵
|
33 | }↵ | | 30 | }↵
|
34 | if (plugin == null)↵ | | 31 | if (plugin == null)↵
|
35 | {↵ | | 32 | {↵
|
36 | throw new IllegalArgumentException("MysqlPlugin == null");↵ | | 33 | throw new IllegalArgumentException("MysqlPlugin == null");↵
|
37 | }↵ | | 34 | }↵
|
|
38 | _plugin = plugin;↵ | | 35 | _plugin = plugin;↵
|
39 | }↵ | | 36 | }↵
|
|
40 | public void actionPerformed(ActionEvent evt)↵ | | 37 | public void actionPerformed(ActionEvent evt)↵
|
41 | {↵ | | 38 | {↵
|
42 | if (_session != null)↵ | | 39 | if (_session != null)↵
|
43 | {↵ | | 40 | {↵
|
44 | try↵ | | 41 | try↵
|
45 | {↵ | | 42 | {↵
|
46 | new AnalyzeTableCommand(_session, _plugin).execute();↵ | | 43 | new ExplainSelectTableCommand(_session, _plugin).execute();↵
|
47 | }↵ | | 44 | }↵
|
48 | catch (Throwable th)↵ | | 45 | catch (Throwable th)↵
|
49 | {↵ | | 46 | {↵
|
50 | _session.showErrorMessage(th);↵ | | 47 | _session.showErrorMessage(th);↵
|
51 | }↵ | | 48 | }↵
|
52 | }↵ | | 49 | }↵
|
53 | }↵ | | 50 | }↵
|
|
54 | /**↵ | | 51 | /**↵
|
55 | * Set the current session.↵ | | 52 | * Set the current session.↵
|
56 | * ↵ | | 53 | * ↵
|
57 | * @param session The current session.↵ | | 54 | * @param session The current session.↵
|
58 | */↵ | | 55 | */↵
|
59 | public void setSession(ISession session)↵ | | 56 | public void setSession(ISession session)↵
|
60 | {↵ | | 57 | {↵
|
61 | _session = session | | 58 | _session = session
|