private String translateType ( String type , Map < String , String > attrs ) { String translated = type . toLowerCase ( ) ; if ( "select" . equals ( type ) ) translated = "radio" ; else if ( "boolean" . equals ( type ) ) translated = "checkbox" ; else if ( "list" . equals ( type ) ) { translated = "picklist" ; String lbl = attrs . get ( "label" ) ; if ( lbl == null ) lbl = attrs . get ( "name" ) ; if ( "Output Documents" . equals ( lbl ) ) { attrs . put ( "label" , "Documents" ) ; attrs . put ( "unselectedLabel" , "Read-Only" ) ; attrs . put ( "selectedLabel" , "Writable" ) ; } } else if ( "hyperlink" . equals ( type ) ) { if ( attrs . containsKey ( "url" ) ) translated = "link" ; else translated = "text" ; } else if ( "rule" . equals ( type ) ) { if ( "EXPRESSION" . equals ( attrs . get ( "type" ) ) ) { translated = "expression" ; } else if ( "TRANSFORM" . equals ( attrs . get ( "type" ) ) ) { translated = "edit" ; attrs . put ( "label" , "Transform" ) ; } else { translated = "edit" ; attrs . put ( "label" , "Script" ) ; } attrs . remove ( "type" ) ; } else if ( "Java" . equals ( attrs . get ( "name" ) ) ) { translated = "edit" ; } else { // asset-driven String source = attrs . get ( "source" ) ; if ( "Process" . equals ( source ) ) { translated = "asset" ; attrs . put ( "source" , "proc" ) ; } else if ( "TaskTemplates" . equals ( source ) ) { translated = "asset" ; attrs . put ( "source" , "task" ) ; } else if ( "RuleSets" . equals ( source ) ) { String format = attrs . get ( "type" ) ; if ( format != null ) { String exts = "" ; String [ ] formats = format . split ( "," ) ; for ( int i = 0 ; i < formats . length ; i ++ ) { String ext = Asset . getFileExtension ( formats [ i ] ) ; if ( ext != null ) { if ( exts . length ( ) > 0 ) exts += "," ; exts += ext . substring ( 1 ) ; } } if ( exts . length ( ) > 0 ) { translated = "asset" ; attrs . put ( "source" , exts ) ; } } } } return translated ; }
Translate widget type .