//do the closing action
if(funcview.open() == IDialogConstants.OK_ID){
//We get the set properties
Properties fieldStore = funcview.getFieldStore();
FunctionFormatter ff = new FunctionFormatter(this.func, fieldStore);
//now we have a format string, we put it at the start, so a starter encloser
Encloser encloser = new Encloser();
encloser.enclose(doc, (ITextSelection)sel,ff.getFunction(), "" );
}