}
public void run(){
ITextEditor thisEdit = (ITextEditor)ieditor;
IDocument doc = thisEdit.getDocumentProvider().getDocument(ieditor.getEditorInput());
ISelection sel = thisEdit.getSelectionProvider().getSelection();
FunctionEditDialog funcview = new FunctionEditDialog(this.shell, this.func);
funcview.setSelectedattributes(this.selectedattributes);
//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(), "" );