no message
This commit is contained in:
66
src/_VisualDVM/Passes/All/ShowCompilerHelp.java
Normal file
66
src/_VisualDVM/Passes/All/ShowCompilerHelp.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.Pass;
|
||||
public class ShowCompilerHelp extends Pass<String> {
|
||||
Pass<String> subpass;
|
||||
Compiler compiler;
|
||||
boolean needsShow = true;
|
||||
//-
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Help.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = null;
|
||||
if (args.length == 0) {
|
||||
if (Global.mainModule.Check(Log, Current.Compiler)) {
|
||||
compiler = Global.mainModule.getCompiler();
|
||||
needsShow = true;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
compiler = (Compiler) args[0];
|
||||
needsShow = (boolean) args[1];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
subpass = null;
|
||||
compiler.ResetHelp();
|
||||
if (Global.mainModule.getMachine().type.equals(MachineType.Local)) {
|
||||
subpass = Global.mainModule.getPass(PassCode.LocalSingleCommand);
|
||||
} else {
|
||||
subpass = Global.mainModule.getPass(PassCode.RemoteSingleCommand);
|
||||
}
|
||||
if (subpass != null) {
|
||||
if (compiler.helpLoaded = subpass.Do(compiler.getHelpCommand())) {
|
||||
target = subpass.target;
|
||||
compiler.helpText = target;
|
||||
compiler.ParseHelp();
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return (subpass != null) && (target != null);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
if (needsShow) {
|
||||
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
|
||||
ff.ShowDialog("Справка", target);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user