My task is necessary and shouldn\'t be canceled, how do I ask ProgressMonitor not to display the \"Cancel\" button, so when it finishes, it will auto close the panel.
That's not possible. You can however create a custom progress monitor as outlined in this tutorial.