Files
VisualSapfor/src/_VisualDVM/Passes/All/ShowInstruction.java

33 lines
984 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 _VisualDVM.Passes.All;
import Common.Passes.Pass;
import _VisualDVM.Global;
import _VisualDVM.Repository.Component.ComponentType;
import java.awt.*;
import java.io.File;
public class ShowInstruction extends Pass<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);
}
}
}