本文整理汇总了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);
}
}
});
}
示例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");
}
示例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();
}
}
示例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));
}
示例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());
}
示例6: updatePrefs
import jackpal.androidterm.util.TermSettings; //导入依赖的package包/类
public void updatePrefs(TermSettings settings) {
mSettings = settings;
setColorScheme(new ColorScheme(settings.getColorScheme()));
setDefaultUTF8Mode(settings.defaultToUTF8Mode());
}