All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jnngl.totalcomputers.system.desktop.TaskBarLink Maven / Gradle / Ivy

/*
    Plugin for computers in vanilla minecraft!
    Copyright (C) 2022  JNNGL

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see .
 */

package com.jnngl.totalcomputers.system.desktop;

import com.jnngl.totalcomputers.system.TotalOS;

import java.awt.image.BufferedImage;

public class TaskBarLink extends Application {

    private final String path;

    public TaskBarLink(TotalOS os, String name, String path, BufferedImage icon) {
        super(os, name);
        this.path = path;
        setIcon(icon);
    }

    @Override
    protected void onStart() {
        if(!os.fs.launchFromApplication(path))
            os.fs.executeFile(os.fs.toFile(path));
    }

    @Override
    protected boolean onClose() {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy