1) It depends where this code is. Do you have a new viewer and you want to get the selection from the sequence view? Or is it an operation or something else entirely?
2) To add buttons to the built-in toolbar, override the method getActionProvider() in your DocumentViewer. Refer to the java doc on com.biomatters.geneious.publicapi.plugin.ActionProvider for details on how this works. You will probably want to override the getOtherActions() method in ActionProvider.