forked from magento/magento2-phpstorm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefaultAnalysisHandler.java
70 lines (60 loc) · 1.79 KB
/
DefaultAnalysisHandler.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
package com.magento.idea.magento2uct.execution.process;
import com.intellij.execution.process.ProcessAdapter;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.openapi.project.Project;
import com.magento.idea.magento2uct.execution.GenerateUctReportCommand;
import java.io.OutputStream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class DefaultAnalysisHandler extends ProcessHandler {
private final Project project;
/**
* Default analysis handler constructor.
*
* @param project Project
*/
public DefaultAnalysisHandler(final @NotNull Project project) {
super();
this.project = project;
this.addProcessListener(
new ProcessAdapter() {
@Override
public void startNotified(final @NotNull ProcessEvent event) {
DefaultAnalysisHandler.this.execute();
}
}
);
}
/**
* Run the main analysis process.
*/
public void execute() {
final GenerateUctReportCommand command = new GenerateUctReportCommand(
project,
new OutputWrapper(this),
this
);
command.execute();
}
@Override
protected void destroyProcessImpl() {
notifyProcessTerminated(0);
}
@Override
protected void detachProcessImpl() {
notifyProcessDetached();
}
@Override
public boolean detachIsDefault() {
return false;
}
@Override
public @Nullable OutputStream getProcessInput() {
return null;
}
}