package _VisualDVM.Passes.All;
import Common.Passes.Pass;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.ProjectData.Files.DBProjectFile;
import _VisualDVM.ProjectData.Files.FileState;
public class IncludeFile extends Pass<DBProjectFile> {
    @Override
    public String getIconPath() {
        return "/icons/Include.png";
    }
    @Override
    protected boolean canStart(Object... args) {
        if (args.length > 0) {
            target = (DBProjectFile) args[0];
            return target.state.equals(FileState.Excluded);
        }
        return Global.mainModule.Check(Log, Current.SelectedFile)
                && (target = Global.mainModule.getSelectedFile()).state.equals(FileState.Excluded);
    }
    @Override
    protected void body() throws Exception {
        target.Include();
    }
    @Override
    protected void showDone() throws Exception {
        Global.mainModule.getUI().getMainWindow().getProjectWindow().getFilesTreeForm().getTree().RefreshNode(target.node);
    }
}
