public void setupSubMenus ( String strMenu ) { Record recMenu = this . getMainRecord ( ) ; try { String strCommandNoCommas = Utility . replace ( strMenu , "," , null ) ; // Get any commas out boolean bIsNumeric = Utility . isNumeric ( strCommandNoCommas ) ; if ( bIsNumeric ) { recMenu . setKeyArea ( Menus . ID_KEY ) ; recMenu . getField ( Menus . ID ) . setString ( strCommandNoCommas ) ; bIsNumeric = recMenu . seek ( "=" ) ; } if ( ! bIsNumeric ) { recMenu . setKeyArea ( Menus . CODE_KEY ) ; recMenu . getField ( Menus . CODE ) . setString ( strMenu ) ; if ( ! recMenu . seek ( "=" ) ) { // Not found, try the default main menu recMenu . getField ( Menus . CODE ) . setString ( HtmlConstants . MAIN_MENU_KEY ) ; recMenu . seek ( "=" ) ; } } } catch ( DBException ex ) { ex . printStackTrace ( ) ; // Never } String strParentID = recMenu . getField ( Menus . ID ) . toString ( ) ; BaseListener listener = recMenu . getListener ( StringSubFileFilter . class . getName ( ) ) ; if ( listener != null ) { // Should just change the string recMenu . removeListener ( listener , true ) ; } recMenu . setKeyArea ( Menus . PARENT_FOLDER_ID_KEY ) ; recMenu . addListener ( new StringSubFileFilter ( strParentID , recMenu . getField ( Menus . PARENT_FOLDER_ID ) , null , null , null , null ) ) ; }
SetupSubMenus Method .