当前位置: 首页>>代码示例>>Java>>正文


Java TermSettings类代码示例

本文整理汇总了Java中jackpal.androidterm.util.TermSettings的典型用法代码示例。如果您正苦于以下问题:Java TermSettings类的具体用法?Java TermSettings怎么用?Java TermSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TermSettings类属于jackpal.androidterm.util包,在下文中一共展示了TermSettings类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
@Override
protected void init(final String initialCommand) {
    Handler uiHandler = new Handler(mContext.getMainLooper());
    uiHandler.post(new Runnable() {
        @Override
        public void run() {
            TermSettings settings = new TermSettings(mContext.getResources(), PreferenceManager.getDefaultSharedPreferences(mContext));
            try {
                mTermSession = new MyShellTermSession(settings, initialCommand);
                mTermSession.initializeEmulator(1024, 40);
            } catch (IOException e) {
                mInitException = new UncheckedIOException(e);
            }
        }
    });
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:17,代码来源:Shell.java

示例2: ShellTermSession

import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
public ShellTermSession(TermSettings settings, String initialCommand) {
    super();

    updatePrefs(settings);

    initializeSession();
    mInitialCommand = initialCommand;

    mWatcherThread = new Thread() {
         @Override
         public void run() {
            Log.i(TermDebug.LOG_TAG, "waiting for: " + mProcId);
            int result = Exec.waitFor(mProcId);
            Log.i(TermDebug.LOG_TAG, "Subprocess exited: " + result);
            mMsgHandler.sendMessage(mMsgHandler.obtainMessage(PROCESS_EXITED, result));
         }
    };
    mWatcherThread.setName("Process watcher");
}
 
开发者ID:MG-MaGeek,项目名称:AndLinux,代码行数:20,代码来源:ShellTermSession.java

示例3: MyShellTermSession

import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
public MyShellTermSession(TermSettings settings, String initialCommand) throws IOException {
    super(settings, initialCommand);
    PipedInputStream pipedInputStream = new PipedInputStream(8192);
    mBufferedReader = new BufferedReader(new InputStreamReader(pipedInputStream));
    mOutputStream = new PipedOutputStream(pipedInputStream);
    if (mShouldReadOutput) {
        startReadingThread();
    }
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:10,代码来源:Shell.java

示例4: initializeSession

import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
private void initializeSession() {
    TermSettings settings = mSettings;

    int[] processId = new int[1];

    String path = System.getenv("PATH");
    if (settings.doPathExtensions()) {
        String appendPath = settings.getAppendPath();
        if (appendPath != null && appendPath.length() > 0) {
            path = path + ":" + appendPath;
        }

        if (settings.allowPathPrepend()) {
            String prependPath = settings.getPrependPath();
            if (prependPath != null && prependPath.length() > 0) {
                path = prependPath + ":" + path;
            }
        }
    }
    if (settings.verifyPath()) {
        path = checkPath(path);
    }
    String[] env = new String[3];
    env[0] = "TERM=" + settings.getTermType();
    env[1] = "PATH=" + path;
    env[2] = "HOME=" + settings.getHomePath();

    createSubprocess(processId, settings.getShell(), env);
    mProcId = processId[0];

    setTermOut(new FileOutputStream(mTermFd));
    setTermIn(new FileInputStream(mTermFd));
}
 
开发者ID:MG-MaGeek,项目名称:AndLinux,代码行数:34,代码来源:ShellTermSession.java

示例5: updatePrefs

import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
public void updatePrefs(TermSettings settings, ColorScheme scheme) {
    if (scheme == null) {
        scheme = new ColorScheme(settings.getColorScheme());
    }

    setTextSize(settings.getFontSize());
    setUseCookedIME(settings.useCookedIME());
    setColorScheme(scheme);
    setBackKeyCharacter(settings.getBackKeyCharacter());
    setAltSendsEsc(settings.getAltSendsEscFlag());
    setControlKeyCode(settings.getControlKeyCode());
    setFnKeyCode(settings.getFnKeyCode());
    setTermType(settings.getTermType());
    setMouseTracking(settings.getMouseTrackingFlag());
}
 
开发者ID:MG-MaGeek,项目名称:AndLinux,代码行数:16,代码来源:TermView.java

示例6: updatePrefs

import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
public void updatePrefs(TermSettings settings) {
    mSettings = settings;
    setColorScheme(new ColorScheme(settings.getColorScheme()));
    setDefaultUTF8Mode(settings.defaultToUTF8Mode());
}
 
开发者ID:MG-MaGeek,项目名称:AndLinux,代码行数:6,代码来源:ShellTermSession.java


注:本文中的jackpal.androidterm.util.TermSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。