@Override public final void onStart() { // differTodo.executeJS(hcj2seScript); // differTodo.loadJS("msg = \"hello' abc \\'world\";"); // 必须置于上两段初始代码传送之后 final boolean rtl = LangUtil.isRTL(UserThreadResourceUtil.getMobileLocaleFrom(coreSS)); if (rtl) { differTodo.setLTR(!rtl); } final ProjResponser projResponser = ServerUIAPIAgent.getProjResponserMaybeNull(projectContext); if (projResponser != null) { // AddHar下可能为null final String dftStyles = (String) projResponser.map.get(HCjar.PROJ_STYLES); final String defaultStyles = (dftStyles == null ? "" : dftStyles.trim()); // AddHAR可能出现null if (defaultStyles.length() > 0) { final String replaceVariable = StyleManager.replaceVariable(coreSS, defaultStyles, mlet, projectContext); // L.V = L.O ? false : LogManager.log(replaceVariable); differTodo.loadStyles(replaceVariable); } } ServerUIAPIAgent.setDiffTodo(mlet, differTodo); // printComp(scrolPanel, 0); // 必须置于notifyInitDone之前,因为有可能增加Mlet级样式和用户setStylesJComponentXX ScreenServer.onStartForMlet(coreSS, projectContext, mlet); }
private final Component searchComponentByHcCode( final JPanel jpanel, final int hcCode) { // in user thread if (differTodo.buildHcCode(jpanel) == hcCode) { return jpanel; } final int compCount = jpanel.getComponentCount(); for (int i = 0; i < compCount; i++) { final Component comp = jpanel.getComponent(i); if (comp instanceof JPanel) { final Component result = searchComponentByHcCode((JPanel) comp, hcCode); if (result != null) { return result; } } else { if (differTodo.buildHcCode(comp) == hcCode) { return comp; } } } return null; }