/** * Get Tab with ID * * @param AD_Tab_ID * @return tab or null */ public UITab getTab(int AD_Tab_ID) { Integer tabKey = Integer.valueOf(AD_Tab_ID); UITab tab = m_tabs.get(tabKey); if (tab == null) { // Check added for referenced tabs if (m_referencetabs.get(tabKey) != null) return m_referencetabs.get(tabKey); throw new CompiereStateException("No such tab:" + AD_Tab_ID); } // find in window return tab; } // getTab
/** * Get Field * * @param AD_Field_ID id * @param windowNo relative windowNo * @return field or null */ public UIField getField(int AD_Field_ID, int windowNo) { Integer key = Integer.valueOf(AD_Field_ID); UIField field = m_fields.get(key); if (field == null) { UIFieldVOFactory fieldFactory = new UIFieldVOFactory(); UIFieldVO vo = fieldFactory.get(m_context, AD_Field_ID); // m_context.setSOTrx(windowNo, isSOTrx); if (vo != null) { field = new UIField(vo); field.initialize(m_context, windowNo); log.warning("Loaded directly: " + field); // SOTrx may not // be correct m_fields.put(key, field); // save in cache } } // create new return field; } // getField
/** Fill Tab and Field arrays */ private void fillTabsFieldsAndInitFieldsAndCreateDependencyRelations(UIWindow win, int windowNO) { ArrayList<UITab> tabs = win.getTabs(); for (int j = 0; j < tabs.size(); j++) { UITab winTab = tabs.get(j); Integer tabKey = Integer.valueOf(winTab.getAD_Tab_ID()); Integer ReferencetabKey = Integer.valueOf(winTab.getReferenced_Tab_ID()); m_tabs.put(tabKey, winTab); m_referencetabs.put(ReferencetabKey, winTab); // ArrayList<UIField> fields = winTab.getFields(); for (int k = 0; k < fields.size(); k++) { UIField field = fields.get(k); field.initialize(m_context, windowNO); Integer fieldKey = Integer.valueOf(field.getAD_Field_ID()); // set the correct value if (field.isLookup()) field.getLookup().setContext(m_context, windowNO); m_fields.put(fieldKey, field); } winTab.createDependencyRelations(); } } // fillTabsFields
/** * Logout * * @param expired expire */ public void logout(boolean expired) { // End Session MSession session = MSession.get(m_context); // finish if (session != null) { if (expired) { if (session.getDescription() == null) session.setDescription("Expired"); else session.setDescription(session.getDescription() + " Expired"); } session.logout(); // saves } if (m_context != null) { int gwtServerID = m_context.getContextAsInt(MRole.GWTSERVERID); if (gwtServerID > 0) MRole.resetGwt(gwtServerID); } // Clear Cache m_tabs.clear(); m_fields.clear(); // m_windows.clear(); m_context.clear(); m_results.clear(); // } // logout
public void putNode(String key, NodeVO node) { m_nodes.put(key, node); }
public NodeVO getNode(String key) { return m_nodes.get(key); }