MyDialogWrapper (boolean isModal) { myDialogWrapper.setTitle(myTitle); myDialogWrapper.init(); myDialogWrapper.setModal(isModal); myDialogWrapper.show(); if (isModal) { myDialogWrapper.dispose(); } return myDialogWrapper; }