Android Open Source - TuxRemote Command






From Project

Back to project page TuxRemote.

License

The source code is released under:

GNU General Public License

If you think the Android project TuxRemote listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.tuxremote.app;
//from www .  j  a v a2s.  co  m
import android.content.Context;
import android.util.Log;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

import java.io.File;

public class Command {
    public String name = null;
    public String cmd = null;
    public String icon = null;

    /**
     * Constructor
     * @param name : String, command name.
     * @param cmd  : String, command shell.
     * @param icon : int, drawable ressource like "R.drawable.ressource", default close icon for icon = 0.
     */
    public Command(String name, String cmd, String icon){
        this.name = name;
        this.cmd = cmd;
        this.icon = icon;
    }

    public Command copy(){
        return new Command(
                ""+this.name, ""+this.cmd, ""+this.icon
        );
    }

    public void setIconToView(Context context, ImageView view){
        if(this.icon != null) {
            if (this.icon.equals("close")) {
                Picasso.with(context).load(TuxRemoteUtils.DEFAULT_CLOSE_RES).fit().centerInside().into(view);
            } else{
                File filePath = context.getFileStreamPath(this.icon);
                Picasso.with(context).load(filePath).fit().centerInside().into(view);
            }
        }
    }

    public String getName(){
        return this.name;
    }

    public static Command cmdClose(String hexaId){
        return new Command("close", "DISPLAY=:0 wmctrl -i -c "+hexaId, "close");
    }

    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }
}




Java Source Code List

com.tuxremote.app.AppFragment.java
com.tuxremote.app.AppListViewAdapter.java
com.tuxremote.app.App.java
com.tuxremote.app.CmdListViewAdapter.java
com.tuxremote.app.Command.java
com.tuxremote.app.ConfigXML.java
com.tuxremote.app.ConnectFragment.java
com.tuxremote.app.EmptyFragment.java
com.tuxremote.app.FileSelectorDialog.java
com.tuxremote.app.Global.java
com.tuxremote.app.MainActivity.java
com.tuxremote.app.NavigationDrawerFragment.java
com.tuxremote.app.Preference.java
com.tuxremote.app.SSHAsyncTask.java
com.tuxremote.app.Server.java
com.tuxremote.app.TuxRemoteUtils.java
com.tuxremote.app.TuxeRemoteSsh.BashReturn.java
com.tuxremote.app.TuxeRemoteSsh.MyUserInfo.java
com.tuxremote.app.TuxeRemoteSsh.SshSession.java