private ElementDescription chooseElement ( List < ElementDescription > elements ) { final ElementListSelectionDialog dialog = new ElementListSelectionDialog ( getShell ( ) , new LabelProvider ( ) ) ; dialog . setElements ( elements . toArray ( ) ) ; dialog . setTitle ( MessageFormat . format ( Messages . AbstractSarlScriptInteractiveSelector_3 , getElementLabel ( ) ) ) ; dialog . setMessage ( MessageFormat . format ( Messages . AbstractSarlScriptInteractiveSelector_3 , getElementLongLabel ( ) ) ) ; dialog . setMultipleSelection ( false ) ; final int result = dialog . open ( ) ; if ( result == Window . OK ) { return ( ElementDescription ) dialog . getFirstResult ( ) ; } return null ; }
Prompts the user to select an element from the given element types .