import org.apache.commons.lang.StringUtils;
import String com.vtradex.kangaroo.shell.Thorn4BaseShell.getShellByXX();
import com.vtradex.kangaroo.shell.ShellFactory;
protected void forwardByKeyboard(String value) throws BreakException {
if (value.equalsIgnoreCase("XX")) {
if(StringUtils.isEmpty(getShellByXX()))
forward(ShellFactory.getMainShell());
else
forward(getShellByXX());
} else if (value.equalsIgnoreCase("QQ")) {
if(StringUtils.isEmpty(getShellByQQ()))
forward(ShellFactory.getEntranceShell());
else
forward(getShellByQQ());
}else if(value.equalsIgnoreCase("*")){//跳转至上一屏
forwardByKeyboard("XX");
}else if(value.equalsIgnoreCase("**")){//退出登录
forwardByKeyboard("QQ");
}
else if (value.equalsIgnoreCase("$")) {
this.context.remove("_");
forward("boxOutSubstationShell", "重新选择调度单");
}
}
Java Shell键盘操作与跳转逻辑详解
本文深入解析了Java Shell中通过键盘输入实现的跳转逻辑,包括跳转到主界面、登录界面、上一屏及退出登录等功能的具体实现细节。

被折叠的 条评论
为什么被折叠?



