Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/ShowInstruction.java
2024-10-09 22:21:57 +03:00

33 lines
1008 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package Visual_DVM_2021.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.Repository.Component.ComponentType;
import Visual_DVM_2021.Passes.Pass_2021;
import java.awt.*;
import java.io.File;
public class ShowInstruction extends Pass_2021<File> {
@Override
public String getIconPath() {
return "/icons/Help.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
target = Global.Components.get(ComponentType.Instruction).getFile();
if (!target.exists()) {
Log.Writeln("файл инструкции:\n" + target.getAbsolutePath() + "\е найден! Обновите компонент 'Инструкция'");
return false;
}
return true;
}
@Override
protected void body() throws Exception {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().open(target);
}
}
}